
/******************************************************************************
 *
 * RCS ID
 * $Id: mytypes,v 1.4 2002/11/17 16:43:00 david Exp $
 *
 * HISTORY
 * $Log: mytypes,v $
 * Revision 1.4  2002/11/17 16:43:00  david
 * Updates to compiler with new 32-bit compiler
 *
 * Revision 1.3  2000/04/02 16:56:29  david
 * Updates to use the Internet event, use wimp poll event,
 * use non blocking sockets correctly,
 * compile libs in format suitable for RISCOS module
 * new nmbd module
 *
 * Revision 1.2  2000/01/29 17:18:20  david
 * Updates to support passwords
 *
 * Revision 1.1  1999/05/16 13:22:12  david
 * Initial revision
 *
 *
 *****************************************************************************/


#define	EPERM		1		/* Not owner */
#define	ENOENT		2		/* No such file or directory */
#define	ESRCH		3		/* No such process */
#define	EINTR		4		/* Interrupted system call */
#define	EIO		5		/* I/O error */
#define	ENXIO		6		/* No such device or address */
#define	E2BIG		7		/* Arg list too long */
#define	ENOEXEC		8		/* Exec format error */
#define	EBADF		9		/* Bad file number */
#define	ECHILD		10		/* No children */
/* changed #define	EAGAIN		11		*//* No more processes */
#define	ENOMEM		12		/* Not enough core */
#define	EACCES		13		/* Permission denied */
#define	EFAULT		14		/* Bad address */
#define	ENOTBLK		15		/* Block device required */
#define	EBUSY		16		/* Mount device busy */
#define	EEXIST		17		/* File exists */
#define	EXDEV		18		/* Cross-device link */
#define	ENODEV		19		/* No such device */
#define	ENOTDIR		20		/* Not a directory*/
#define	EISDIR		21		/* Is a directory */
#define	EINVAL		22		/* Invalid argument */
#define	ENFILE		23		/* File table overflow */
#define	EMFILE		24		/* Too many open files */
#define	ENOTTY		25		/* Not a typewriter */
#define	ETXTBSY		26		/* Text file busy */
#define	EFBIG		27		/* File too large */
#define	ENOSPC		28		/* No space left on device */
#define	ESPIPE		29		/* Illegal seek */
#define	EROFS		30		/* Read-only file system */
#define	EMLINK		31		/* Too many links */
#define	EPIPE		32		/* Broken pipe */

#define SMB_DEV_T int
#define SMB_INO_T int
#define SMB_OFF_T int
#define SMB_BIG_UINT unsigned int


/*#define LMHOSTSFILE "lmhosts"*/
#define LMHOSTSFILE "<InetDBase$Path>hosts"
/*#define CONFIGFILE  "smb.conf"*/
#define CONFIGFILE "<samba$dir>.Resources.smb/conf"
#define SMBLOGFILE   "smb.log"
#define CODEPAGEDIR "<samba$dir>.codepages"
#define SWATDIR     "swatdir"
#define SBINDIR     "sbindir"
/*#define LOCKDIR     "lockdir"*/
#define LOCKDIR     "<samba$dir>.Resources"
#define SMBRUN      "smbrun"
#define DRIVERFILE  "driverfile"
#define BINDIR      "bindir"
#define SMB_PASSWD_FILE "<samba$dir>.Resources.sharepass" 
#define SMB_SHARE_PASSWD_FILE "<samba$dir>.Resources.sharepass" 
#define SMB_USER_PASSWD_FILE "<samba$dir>.Resources.userpass"
#define PASSWD_PROGRAM "passprog"
#define SERVER_LIST "<Samba$dir>.Resources.browse/dat"

#define USE_SMBPASS_DB 1

#ifndef uchar
#define uchar unsigned char
#endif

#ifndef uint8
#define uint8 unsigned char
#endif

#ifndef int8
#define int8 char
#endif

#if !defined(int16)
#define int16 short
#endif       

#if !defined(uint16)
#define uint16 unsigned short
#endif       
                        
#if !defined(int32)
#define int32 long
#endif       
                  
#if !defined(uint32)
#define uint32 unsigned long
#endif       

#if 0
/* DRHB 16/11/02 */
typedef int mode_t;       
#endif

extern int DEBUGLEVEL;

#define  MAXNAMLEN  255

struct  dirent
  {
  off_t 	d_off;		/* offset of next disk directory entry */
  ino_t 	d_fileno;		/* file number of entry */
  size_t	d_reclen;		/* length of this record */
  size_t	d_namlen;		/* length of d_name */
  unsigned char d_type;			/* file type, possibly unknown */
  char		d_name[MAXNAMLEN];	/* name */
  };

typedef struct
  {
  int		dd_fd;		/* file descriptor (unused) */
  char		*dd_name;	/* directory name */
  size_t	dd_loc; 	/* buffer offset */
  size_t	dd_size;	/* amount of valid data in buffer */
  size_t	dd_bsize;	/* buffer size */
  size_t	dd_off; 	/* directory offset */
  int		dd_off2;	/* offset of next read */
  char		*dd_buf;	/* directory data buffer */
  } DIR;
           
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short
#endif

typedef struct sSmbHeader 
{
   BYTE   smbidf[4];   /* contains 0xFF, 'SMB' */
   BYTE   smbcom;      /* command code */
   BYTE   smbrcls;     /* error code class */
   BYTE   smbreh;      /* reserved (contains AH if DOS INT-24 ERR) */
   WORD   smberr;      /* error code */
   BYTE   smbreb;      /* reserved */
   WORD   smbres[7];   /* reserved */
   WORD   smbtid;      /* tree id #  */
   WORD   smbpid;      /* caller's process id # */
   WORD   smbuid;      /* user id # */
   WORD   smbmid;      /* mutiplex id #  */
   BYTE   smbwct;      /* count of parameter words */
   WORD   *smbvwv;    /* variable # words of params */
   WORD   smbbcc;      /* # bytes of data following */
   char   *smbdata;   /* data bytes */
} tSmbHeader, *tpSmbHeader;

/* in pwd.h */
#if 0
/* The passwd structure.  */
struct passwd
{
  char *pw_name;		/* Username.  */
  char *pw_passwd;		/* Password.  */
  uid_t pw_uid;		/* User ID.  */
  gid_t pw_gid;		/* Group ID.  */
  char *pw_gecos;		/* Real name.  */
  char *pw_dir;			/* Home directory.  */
  char *pw_shell;		/* Shell program.  */
};
#endif

struct utimbuf
{
  time_t actime;
  time_t modtime;
};

#if 0 
/* DRHB 16/11/02 */
typedef int pid_t;
typedef int ssize_t;  
#endif
typedef int gif_t;


extern int dontConvertName;

