home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / amigaos4_only / smbfs / source / smbfs.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-08-03  |  4.7 KB  |  160 lines

  1. /*
  2.  * $Id: smbfs.h,v 1.5 2004/05/18 08:39:13 obarthel Exp $
  3.  *
  4.  * :ts=4
  5.  *
  6.  * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API
  7.  *
  8.  * Copyright (C) 2000-2004 by Olaf `Olsen' Barthel <olsen@sourcery.han.de>
  9.  *
  10.  * This program is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published by
  12.  * the Free Software Foundation; either version 2 of the License, or
  13.  * (at your option) any later version.
  14.  *
  15.  * This program is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with this program; if not, write to the Free Software
  22.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #ifndef _SMBFS_H
  26. #define _SMBFS_H 1
  27.  
  28. /****************************************************************************/
  29.  
  30. #ifndef _SYSTEM_HEADERS_H
  31. #include "system_headers.h"
  32. #endif /* _SYSTEM_HEADERS_H */
  33.  
  34. #ifndef _ASSERT_H
  35. #include "assert.h"
  36. #endif /* _ASSERT_H */
  37.  
  38. /****************************************************************************/
  39.  
  40. #define SAME (0)
  41. #define OK (0)
  42. #define NOT !
  43.  
  44. /****************************************************************************/
  45.  
  46. #ifndef ZERO
  47. #define ZERO ((BPTR)NULL)
  48. #endif /* ZERO */
  49.  
  50. /****************************************************************************/
  51.  
  52. #ifndef AMIGA_COMPILER_H
  53.  
  54. /****************************************************************************/
  55.  
  56. #if defined(__SASC)
  57. #define FAR __far
  58. #define ASM __asm
  59. #define REG(r,p) register __##r p
  60. #define INLINE __inline
  61. #endif /* __SASC */
  62.  
  63. #if defined(__GNUC__)
  64. #define FAR
  65. #define ASM
  66. #define REG(r,p) p __asm(#r)
  67. #define INLINE __inline__
  68. #endif /* __GNUC__ */
  69.  
  70. /****************************************************************************/
  71.  
  72. #ifndef VARARGS68K
  73. #define VARARGS68K
  74. #endif /* VARARGS68K */
  75.  
  76. /*****************************************************************************/
  77.  
  78. #endif /* AMIGA_COMPILER_H */
  79.  
  80. /*****************************************************************************/
  81.  
  82. #ifndef min
  83. #define min(a,b) ((a) < (b) ? (a) : (b))
  84. #endif /* min */
  85.  
  86. /****************************************************************************/
  87.  
  88. #if defined(__SASC)
  89. extern struct Library * FAR AbsExecBase;
  90. #else
  91. #ifndef AbsExecBase
  92. #define AbsExecBase (*(struct Library **)4)
  93. #endif /* AbsExecBase */
  94. #endif /* __SASC */
  95.  
  96. /****************************************************************************/
  97.  
  98. extern struct Library * SocketBase;
  99. extern struct Library * SysBase;
  100. extern struct Library * DOSBase;
  101.  
  102. /****************************************************************************/
  103.  
  104. #if defined(__amigaos4__)
  105.  
  106. /****************************************************************************/
  107.  
  108. extern struct ExecIFace *    IExec;
  109. extern struct DOSIFace *    IDOS;
  110. extern struct SocketIFace *    ISocket;
  111.  
  112. /****************************************************************************/
  113.  
  114. #endif /* __amigaos4__ */
  115.  
  116. /****************************************************************************/
  117.  
  118. extern int h_errno;
  119.  
  120. /****************************************************************************/
  121.  
  122. extern int BroadcastNameQuery(char *name, char *scope, UBYTE *address);
  123. extern LONG CompareNames(STRPTR a,STRPTR b);
  124. extern LONG GetTimeZoneDelta(VOID);
  125. extern STRPTR amitcp_strerror(int error);
  126. extern STRPTR host_strerror(int error);
  127. extern time_t MakeTime(const struct tm * const tm);
  128. extern ULONG GetCurrentTime(VOID);
  129. extern VOID LocalTime(time_t seconds,struct tm * tm);
  130. extern VOID VARARGS68K ReportError(STRPTR fmt,...);
  131. extern VOID StringToUpper(STRPTR s);
  132. extern VOID VARARGS68K SPrintf(STRPTR buffer, STRPTR formatString,...);
  133.  
  134. /****************************************************************************/
  135.  
  136. size_t strlcpy(char *dst, const char *src, size_t siz);
  137. size_t strlcat(char *dst, const char *src, size_t siz);
  138.  
  139. /****************************************************************************/
  140.  
  141. extern void smb_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
  142. extern void smb_nt_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
  143.  
  144. /****************************************************************************/
  145.  
  146. extern VOID FreeMemory(APTR address);
  147. extern APTR AllocateMemory(ULONG size);
  148.  
  149. #define malloc(s) AllocateMemory(s)
  150. #define free(m) FreeMemory(m)
  151.  
  152. /****************************************************************************/
  153.  
  154. #undef memcpy
  155. #define memcpy(to,from,size) ((void)CopyMem((APTR)(from),(APTR)(to),(ULONG)(size)))
  156.  
  157. /****************************************************************************/
  158.  
  159. #endif /* _SMBFS_H */
  160.