/******************************************************************************
 *
 * RCS ID
 * $Id: stubs,v 1.2 2002/11/17 16:43:22 david Exp $
 *
 * HISTORY
 * $Log: stubs,v $
 * Revision 1.2  2002/11/17 16:43:22  david
 * Updates to compiler with new 32-bit compiler
 *
 * Revision 1.1  2000/04/22 14:50:58  david
 * Updates for nmbd module debugging.
 * Updates for integrating nmbd with main smbserver application
 *
 *
 *
 *****************************************************************************/

#include "includes.h"
#include "protonmbd.h"

int DEBUGLEVEL=10;
int dontConvertName=0;
int Client=0;
pstring sesssetup_user,samlogon_user;
int sam_logon_in_ssb=0;
fstring local_machine;
fstring remote_machine;
fstring global_myworkgroup;
int  smb_read_error=0;
connection_struct * g_conn=NULL;

void BlockSignals(BOOL block,int signum)
{

}

mode_t umask(mode_t mask)
{
   return mask;
}

void fault_setup(void (*fn)(void *))
{

}

void pidfile_create(char *name)
{

}

BOOL process_exists(int pid)
{
  return False;
}

fstring *remoteMachine(int fd)
{
  return &remote_machine;
}                       

fstring *localMachine(int fd)
{
  return &local_machine;
}



struct passwd guestPasswd;
int get_pwname_count=0;

struct passwd *stub_Get_Pwnam(char *user,BOOL allow_change)
{ 
  if (get_pwname_count==0)
  { 
    get_pwname_count++;
    guestPasswd.pw_name=(char*) malloc(strlen(user)+1);
    strcpy(guestPasswd.pw_name,user);
    guestPasswd.pw_passwd=(char*) malloc(strlen("hello")+1);
    strcpy(guestPasswd.pw_passwd,"hello");
    guestPasswd.pw_uid=500;
    guestPasswd.pw_gid=500;              
    guestPasswd.pw_gecos=(char*) malloc(sizeof("Guest")+1);
    strcpy(guestPasswd.pw_gecos,"Guest");
    guestPasswd.pw_dir=(char *) malloc(sizeof("\\")+1);
    strcpy(guestPasswd.pw_dir,"\\");                   
    guestPasswd.pw_shell=(char *) malloc(sizeof("RISCOS")+1);
    strcpy(guestPasswd.pw_shell,"RISCOS");                     
  }

  return &guestPasswd;
}    

BOOL isFdSocket(int fd)
{            
#if 0
   tpClients aclient=clients;
   BOOL      result=FALSE;
          
   while (aclient!=NULL)
   {
      if (fd==aclient->clientFd)
      {
        result=TRUE;
        break;
      }  
      aclient=aclient->next;
   }                                  

   return result;
#endif         
   DEBUG(0,("isFdSocket %d\n",fd));
   return True;
}

int file_find_name(int fd,char *fname)
{                       
   int error=EBADF;

   return error;
}

void samba_shutdown(int severity)
{
  exit(0);
}         

void wimp_werr(int severity,char *msg)
{
  
}

typedef int MessagesFD;

MessagesFD *getMsgFd(void)
{
  return NULL;
}             

char *getMsgFilename(void)
{
  return NULL;
}


/*******************************************************************
check a files mod time
********************************************************************/
time_t file_modtime(char *fname)
{ 

  SMB_STRUCT_STAT st;
  
  if (sys_stat(fname,&st) != 0) 
    return(0);

  return(st.st_mtime); 

}


int dup2(int oldfd, int newfd)
{
  return oldfd;
}     

char *gidtoname(gid_t gid)
{
   return "group";
}
  
int registerSocket(int whichSet, int fd)
{
  return 0;
}

int deregisterSocket(int whichSet, int fd)
{         
  return 0;
}







              



