2
0

sbstdinc.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * File: sbstdinc.h $TOG: sbstdinc.h /main/7 1998/07/31 17:50:45 mgreess $
  25. * Language: C
  26. *
  27. * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
  28. *
  29. * (c) Copyright 1993, 1994 Hewlett-Packard Company *
  30. * (c) Copyright 1993, 1994 International Business Machines Corp. *
  31. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
  32. * (c) Copyright 1993, 1994 Novell, Inc. *
  33. */
  34. #ifndef _sbstdinc_h
  35. #define _sbstdinc_h
  36. #include <sys/types.h>
  37. #include <sys/param.h>
  38. #ifdef SVR4
  39. #include <netdb.h> /* MAXHOSTNAMELEN */
  40. #endif /* SVR4 */
  41. #ifndef howmany
  42. #define howmany(x, y) (((x)+((y)-1))/(y)) /* From <sys/param.h>, but not an XPG3 file */
  43. #endif
  44. #include <stdlib.h>
  45. #include <unistd.h>
  46. #include <string.h>
  47. #include <sys/stat.h>
  48. #include <stdio.h>
  49. #include <fcntl.h>
  50. #include <Dt/MsgCatP.h>
  51. /************************************************************************/
  52. /* Routines not defined in include files (yet). */
  53. /************************************************************************/
  54. /* BSD has bzero(), bcmp(), and bcopy() defined. */
  55. #if !defined(__bsd) && !defined(CSRG_BASED)
  56. #if defined(__STDC__)
  57. #if !defined(__linux__) && !defined(_XFUNCS_H_) && !defined(sun)
  58. extern void bcopy(char *b1, char *b2, int length);
  59. extern int bcmp(char *b1, char *b2, int length);
  60. extern void bzero(char *b, int length);
  61. #endif
  62. extern char *mktemp(char *tmplate);
  63. #elif ! defined(__cplusplus)
  64. #if !defined(__linux__) && !defined(_XFUNCS_H_)
  65. extern void bcopy();
  66. extern int bcmp();
  67. extern void bzero();
  68. #endif
  69. extern char *mktemp();
  70. #endif
  71. #endif
  72. #ifndef SBSTDINC_H_NO_REDEFINE /* sbstdinc.c turns this on */
  73. /************************************************************************/
  74. /* Routines from <string.h> */
  75. /* --- These always get redefined so we can catch null ptr deref's */
  76. /************************************************************************/
  77. #if defined(__STDC__) || defined(__cplusplus)
  78. extern XeString Xestrcat(XeString s1, ConstXeString s2);
  79. #else
  80. extern XeString Xestrcat();
  81. #endif
  82. #ifdef strcat
  83. # undef strcat
  84. #endif
  85. #define strcat Xestrcat
  86. #if defined(__STDC__) || defined(__cplusplus)
  87. extern XeString Xestrncat(XeString s1, ConstXeString s2, size_t n);
  88. #else
  89. extern XeString Xestrncat();
  90. #endif
  91. #ifdef strncat
  92. # undef strncat
  93. #endif
  94. #define strncat Xestrncat
  95. #if defined(__STDC__) || defined(__cplusplus)
  96. extern int Xestrcmp(ConstXeString s1, ConstXeString s2);
  97. #else
  98. extern int Xestrcmp();
  99. #endif
  100. #ifdef strcmp
  101. # undef strcmp
  102. #endif
  103. #define strcmp Xestrcmp
  104. #if defined(__STDC__) || defined(__cplusplus)
  105. extern int Xestrncmp(ConstXeString s1, ConstXeString s2, size_t n);
  106. #else
  107. extern int Xestrncmp();
  108. #endif
  109. #ifdef strncmp
  110. # undef strncmp
  111. #endif
  112. #define strncmp Xestrncmp
  113. #if defined(__STDC__) || defined(__cplusplus)
  114. extern XeString Xestrcpy(XeString s1, ConstXeString s2);
  115. #else
  116. extern XeString Xestrcpy();
  117. #endif
  118. #ifdef strcpy
  119. # undef strcpy
  120. #endif
  121. #define strcpy Xestrcpy
  122. #if defined(__STDC__) || defined(__cplusplus)
  123. extern XeString Xestrncpy(XeString s1, ConstXeString s2, size_t n);
  124. #else
  125. extern XeString Xestrncpy();
  126. #endif
  127. #ifdef strncpy
  128. # undef strncpy
  129. #endif
  130. #define strncpy Xestrncpy
  131. #if defined(__STDC__) || defined(__cplusplus)
  132. extern int Xestrcoll(ConstXeString s1, ConstXeString s2);
  133. #else
  134. extern int Xestrcoll();
  135. #endif
  136. #ifdef strcoll
  137. # undef strcoll
  138. #endif
  139. #define strcoll Xestrcoll
  140. #if defined(__STDC__) || defined(__cplusplus)
  141. extern size_t Xestrxfrm(XeString s1, ConstXeString s2, size_t n);
  142. #else
  143. extern size_t Xestrxfrm();
  144. #endif
  145. #ifdef strxfrm
  146. # undef strxfrm
  147. #endif
  148. #define strxfrm Xestrxfrm
  149. #if defined(__STDC__) || defined(__cplusplus)
  150. extern XeString Xestrchr(ConstXeString s, int c);
  151. #else
  152. extern XeString Xestrchr();
  153. #endif
  154. #ifdef strchr
  155. # undef strchr
  156. #endif
  157. #define strchr Xestrchr
  158. #if defined(__STDC__) || defined(__cplusplus)
  159. extern XeString Xestrpbrk(ConstXeString s1, ConstXeString s2);
  160. #else
  161. extern XeString Xestrpbrk();
  162. #endif
  163. #ifdef strpbrk
  164. # undef strpbrk
  165. #endif
  166. #define strpbrk Xestrpbrk
  167. #if defined(__STDC__) || defined(__cplusplus)
  168. extern XeString Xestrrchr(ConstXeString s, int c);
  169. #else
  170. extern XeString Xestrrchr();
  171. #endif
  172. #ifdef strrchr
  173. # undef strrchr
  174. #endif
  175. #define strrchr Xestrrchr
  176. #if defined(__STDC__) || defined(__cplusplus)
  177. extern XeString Xestrstr(ConstXeString s1, ConstXeString s2);
  178. #else
  179. extern XeString Xestrstr();
  180. #endif
  181. #ifdef strstr
  182. # undef strstr
  183. #endif
  184. #define strstr Xestrstr
  185. #if defined(__STDC__) || defined(__cplusplus)
  186. extern XeString Xestrtok(XeString s1, ConstXeString s2);
  187. #else
  188. extern XeString Xestrtok();
  189. #endif
  190. #ifdef strtok
  191. # undef strtok
  192. #endif
  193. #define strtok Xestrtok
  194. #if defined(__STDC__) || defined(__cplusplus)
  195. extern size_t Xestrlen(ConstXeString s);
  196. #else
  197. extern size_t Xestrlen();
  198. #endif
  199. #ifdef strlen
  200. # undef strlen
  201. #endif
  202. #define strlen Xestrlen
  203. #if defined(__STDC__) || defined(__cplusplus)
  204. extern XeString Xestrdup(ConstXeString s);
  205. #else
  206. extern XeString Xestrdup();
  207. #endif
  208. #ifdef strdup
  209. # undef strdup
  210. #endif
  211. #define strdup Xestrdup
  212. #endif /* ifndef SBSTDINC_H_NO_REDEFINE */
  213. #endif /* _sbstdinc_h */