revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / smbfs / source_code / smbfs.h
blob905a37a56166c1112f6f88dfcaca19e63f19479e
1 /*
2 * $Id$
4 * :ts=4
6 * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API
8 * Copyright (C) 2000-2016 by Olaf `Olsen' Barthel <obarthel -at- gmx -dot- net>
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.
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.
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.
25 #ifndef _SMBFS_H
26 #define _SMBFS_H 1
28 /****************************************************************************/
30 #ifndef _SYSTEM_HEADERS_H
31 #include "system_headers.h"
32 #endif /* _SYSTEM_HEADERS_H */
34 #ifndef _ASSERT_H
35 #include "assert.h"
36 #endif /* _ASSERT_H */
38 /****************************************************************************/
40 #define SAME (0)
41 #define OK (0)
42 #define NOT !
44 /****************************************************************************/
46 #ifndef ZERO
47 #define ZERO ((BPTR)NULL)
48 #endif /* ZERO */
50 /****************************************************************************/
52 #ifndef AMIGA_COMPILER_H
54 /****************************************************************************/
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 #define STDARGS __stdargs
62 #endif /* __SASC */
64 #if defined(__GNUC__)
65 #define FAR
66 #define ASM
67 #define REG(r,p) p __asm(#r)
68 #define INLINE __inline__
69 #define STDARGS
70 #endif /* __GNUC__ */
72 /****************************************************************************/
74 #ifndef VARARGS68K
75 #define VARARGS68K
76 #endif /* VARARGS68K */
78 /*****************************************************************************/
80 #endif /* AMIGA_COMPILER_H */
82 /*****************************************************************************/
84 #ifndef min
85 #define min(a,b) ((a) < (b) ? (a) : (b))
86 #endif /* min */
88 /****************************************************************************/
90 #if defined(__SASC)
91 extern struct Library * FAR AbsExecBase;
92 #else
93 #ifndef AbsExecBase
94 #define AbsExecBase (*(struct Library **)4)
95 #endif /* AbsExecBase */
96 #endif /* __SASC */
98 /****************************************************************************/
100 extern struct Library * SocketBase;
101 extern struct ExecBase * SysBase;
102 extern struct Library * DOSBase;
104 /****************************************************************************/
106 #if defined(__amigaos4__)
108 /****************************************************************************/
110 extern struct ExecIFace * IExec;
111 extern struct DOSIFace * IDOS;
112 extern struct SocketIFace * ISocket;
114 /****************************************************************************/
116 #endif /* __amigaos4__ */
118 /****************************************************************************/
120 #ifndef h_errno
121 extern int h_errno;
122 #endif
124 /****************************************************************************/
126 extern int BroadcastNameQuery(char *name, char *scope, UBYTE *address);
127 extern LONG CompareNames(STRPTR a,STRPTR b);
128 extern LONG GetTimeZoneDelta(VOID);
129 extern STRPTR amitcp_strerror(int error);
130 extern STRPTR host_strerror(int error);
131 extern time_t MakeTime(const struct tm * const tm);
132 extern ULONG GetCurrentTime(VOID);
133 extern VOID GMTime(time_t seconds,struct tm * tm);
134 #ifdef __AROS__
135 #define ReportError(...) do { \
136 kprintf("[SMB] "); \
137 kprintf(__VA_ARGS__); \
138 kprintf("\n"); } while (0)
139 #define SPrintf(buf, ...) sprintf(buf, __VA_ARGS__)
140 #else
141 extern VOID VARARGS68K ReportError(STRPTR fmt,...);
142 extern VOID VARARGS68K SPrintf(STRPTR buffer, STRPTR formatString,...);
143 #endif
144 extern VOID StringToUpper(STRPTR s);
146 /****************************************************************************/
148 size_t strlcpy(char *dst, const char *src, size_t siz);
149 size_t strlcat(char *dst, const char *src, size_t siz);
151 /****************************************************************************/
153 extern void smb_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
154 extern void smb_nt_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
156 /****************************************************************************/
158 extern VOID FreeMemory(APTR address);
159 extern APTR AllocateMemory(ULONG size);
161 #define malloc(s) AllocateMemory(s)
162 #define free(m) FreeMemory(m)
164 /****************************************************************************/
166 #undef memcpy
167 #define memcpy(to,from,size) ((void)CopyMem((APTR)(from),(APTR)(to),(ULONG)(size)))
169 /****************************************************************************/
171 #endif /* _SMBFS_H */