sys.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* $NetBSD: sys.h,v 1.5 2002/03/18 16:00:59 christos Exp $ */
  2. /*-
  3. * Copyright (c) 1992, 1993
  4. * The Regents of the University of California. All rights reserved.
  5. *
  6. * This code is derived from software contributed to Berkeley by
  7. * Christos Zoulas of Cornell University.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. All advertising materials mentioning features or use of this software
  18. * must display the following acknowledgement:
  19. * This product includes software developed by the University of
  20. * California, Berkeley and its contributors.
  21. * 4. Neither the name of the University nor the names of its contributors
  22. * may be used to endorse or promote products derived from this software
  23. * without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  26. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  28. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  29. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35. * SUCH DAMAGE.
  36. *
  37. * @(#)sys.h 8.1 (Berkeley) 6/4/93
  38. */
  39. /*
  40. * sys.h: Put all the stupid compiler and system dependencies here...
  41. */
  42. #ifndef _h_sys
  43. #define _h_sys
  44. #ifndef public
  45. # define public /* Externally visible functions/variables */
  46. #endif
  47. #ifndef private
  48. # define private static /* Always hidden internals */
  49. #endif
  50. #ifndef protected
  51. # define protected /* Redefined from elsewhere to "static" */
  52. /* When we want to hide everything */
  53. #endif
  54. #ifndef _PTR_T
  55. # define _PTR_T
  56. typedef void *ptr_t;
  57. #endif
  58. #ifndef _IOCTL_T
  59. # define _IOCTL_T
  60. typedef void *ioctl_t;
  61. #endif
  62. #include <stdio.h>
  63. #ifndef HAVE_FGETLN
  64. #define fgetln libedit_fgetln
  65. char *fgetln(FILE *fp, size_t *len);
  66. #endif
  67. #ifndef HAVE_STRLCPY
  68. #undef strlcpy /* We define this in top-level Asterisk to point towards ast_copy_string */
  69. #define strlcpy libedit_strlcpy
  70. size_t strlcpy(char *dst, const char *src, size_t siz);
  71. #endif
  72. #ifndef HAVE_STRLCAT
  73. #undef strlcat /* We define this in top-level Asterisk to point towards the ast_str_* APIs */
  74. #define strlcat libedit_strlcat
  75. size_t strlcat(char *dst, const char *src, size_t siz);
  76. #endif
  77. #define REGEX /* Use POSIX.2 regular expression functions */
  78. #undef REGEXP /* Use UNIX V8 regular expression functions */
  79. #ifdef SUNOS
  80. # undef REGEX
  81. # undef REGEXP
  82. /* # include <malloc.h> XXX Removed for Solaris build XXX */
  83. typedef void (*sig_t)(int);
  84. # ifdef __GNUC__
  85. /*
  86. * Broken hdrs.
  87. */
  88. #ifndef SOLARIS
  89. extern int tgetent(const char *bp, char *name);
  90. extern int tgetflag(const char *id);
  91. extern int tgetnum(const char *id);
  92. extern char *tgetstr(const char *id, char **area);
  93. #endif
  94. extern char *tgoto(const char *cap, int col, int row);
  95. extern int tputs(const char *str, int affcnt, int (*putc)(int));
  96. extern char *getenv(const char *);
  97. extern int fprintf(FILE *, const char *, ...);
  98. extern int sigsetmask(int);
  99. extern int sigblock(int);
  100. extern int fputc(int, FILE *);
  101. extern int fgetc(FILE *);
  102. extern int fflush(FILE *);
  103. extern int tolower(int);
  104. extern int toupper(int);
  105. extern int errno, sys_nerr;
  106. extern char *sys_errlist[];
  107. extern void perror(const char *);
  108. # include <string.h>
  109. # define strerror(e) sys_errlist[e]
  110. # endif
  111. # ifdef SABER
  112. extern ptr_t memcpy(ptr_t, const ptr_t, size_t);
  113. extern ptr_t memset(ptr_t, int, size_t);
  114. # endif
  115. extern char *fgetline(FILE *, int *);
  116. #endif
  117. #ifdef HAVE_SYS_CDEFS_H
  118. #include <sys/cdefs.h>
  119. #endif
  120. #endif /* _h_sys */