Set default st_blocksize, added Volker's directory fix - save the attributes
[Samba.git] / source / include / safe_string.h
blob4517d824a5844327440b72ccca5be93903c61375
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 Safe string handling routines.
5 Copyright (C) Andrew Tridgell 1994-1998
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _SAFE_STRING_H
23 #define _SAFE_STRING_H
25 #ifdef bcopy
26 #undef bcopy
27 #endif /* bcopy */
28 #define bcopy(src,dest,size) __ERROR__XX__NEVER_USE_BCOPY___;
30 #ifdef strcpy
31 #undef strcpy
32 #endif /* strcpy */
33 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
35 #ifdef strcat
36 #undef strcat
37 #endif /* strcat */
38 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
40 #ifdef sprintf
41 #undef sprintf
42 #endif /* sprintf */
43 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
45 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
46 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
47 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
48 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
50 #define fstrterminate(d) (((d)[sizeof(fstring)-1]) = '\0')
51 #define pstrterminate(d) (((d)[sizeof(pstring)-1]) = '\0')
53 #define wpstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wpstring))
54 #define wpstrcat(d,s) safe_strcat_w((d),(s),sizeof(wpstring))
55 #define wfstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wfstring))
56 #define wfstrcat(d,s) safe_strcat_w((d),(s),sizeof(wfstring))
58 #endif