aug_std.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * $Id$
  3. *
  4. * POSTGRES module, portions of this code were templated using
  5. * the mysql module, thus it's similarity.
  6. *
  7. *
  8. * Copyright (C) 2003 August.Net Services, LLC
  9. *
  10. * This file is part of ser, a free SIP server.
  11. *
  12. * ser is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version
  16. *
  17. * For a license to use the ser software under conditions
  18. * other than those described here, or to purchase support for this
  19. * software, please contact iptel.org by e-mail at the following addresses:
  20. * [email protected]
  21. *
  22. * ser is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  30. *
  31. * ---
  32. *
  33. * History
  34. * -------
  35. * 2003-04-06 initial code written (Greg Fausak/Andy Fullford)
  36. *
  37. */
  38. /*
  39. ** ________________________________________________________________________
  40. **
  41. **
  42. ** $RCSfile$
  43. ** $Revision$
  44. **
  45. ** Last change $Date$
  46. ** Last change $Author$
  47. ** $State$
  48. ** $Locker$
  49. **
  50. ** Original author: Andrew Fullford
  51. **
  52. ** Copyright (C) August Associates 1995
  53. **
  54. ** ________________________________________________________________________
  55. */
  56. /* AM_TYPE: (INSTALL_INC) */
  57. #ifndef AUG_STD_H
  58. #define AUG_STD_H
  59. #include "aug_sysdep.h"
  60. /*
  61. ** The rest of the libaug package has dependencies on these
  62. ** system includes.
  63. */
  64. #include <stdlib.h>
  65. #include <stddef.h>
  66. #include <stdarg.h>
  67. #include <time.h>
  68. /*
  69. ** Some boolean verbosity.
  70. */
  71. #ifndef augBool
  72. #define augBool char
  73. #endif
  74. #define augFALSE 0
  75. #define augTRUE 1
  76. /*
  77. ** Exit codes.
  78. **
  79. ** To just indicate success or failure, use augEXIT_OK and augEXIT_BAD.
  80. ** For more esoteric codes, use the others. Their numbers are chosen
  81. ** so that they are unlikely to be generated by other applications, and
  82. ** also to avoid signal numbers or error counts.
  83. **
  84. ** Note that augEXIT_NOMEM will be generated by aug_alloc failures
  85. ** if they are not handled.
  86. */
  87. #define augEXIT_YES 0
  88. #define augEXIT_NO 1
  89. #define augEXIT_NOMEM 99
  90. #define augEXIT_ABORT (augEXIT_NOMEM-1)
  91. #define augEXIT_FATAL (augEXIT_NOMEM-2)
  92. #define augEXIT_ERROR (augEXIT_NOMEM-3)
  93. #define augEXIT_WARN (augEXIT_NOMEM-4)
  94. #define augEXIT_USAGE (augEXIT_NOMEM-5)
  95. /*
  96. ** Used as a tag to explicitly signify externally accessible symbols.
  97. ** I don't like leaving off the storage class; it's just too quiet.
  98. */
  99. #define augExport
  100. /*
  101. ** Some utility prototypes.
  102. */
  103. extern char *aug_cpy(char *tgt, char *src, int size);
  104. extern char *aug_cat(char *tgt, char *src, int size);
  105. extern char *aug_strip(char *tgt);
  106. extern char *aug_upper(char *tgt);
  107. extern char *aug_lower(char *tgt);
  108. extern int aug_strexpand(char *tgt, char *src, int tgt_size);
  109. extern char *aug_getsym(char *name, char *default_value);
  110. extern void aug_abort_va(char *file, int line, char *fmt, va_list ap);
  111. extern void aug_abort(char *file, int line, char *fmt, ...);
  112. extern void aug_exit(int exit_code);
  113. extern void aug_setmodule(char *name);
  114. extern char *aug_module(void);
  115. extern void aug_setenv(char *name, char *value);
  116. extern char *aug_tempnam(char *dir, char *pfx, void *parent);
  117. extern char *aug_hostname(void);
  118. extern char *aug_domain(void);
  119. extern char *aug_fqdn(char *addr);
  120. extern int aug_getport(char *name);
  121. extern void aug_sockopts(int s);
  122. extern int aug_signal_max(void);
  123. extern int aug_signal_num(char *signame);
  124. extern char *aug_signal_name(int sig);
  125. extern int aug_utc_offset(time_t tim);
  126. extern unsigned long aug_random(void);
  127. extern void aug_srandom(unsigned long seed);
  128. extern unsigned long aug_random_seed(int entropy);
  129. extern int aug_mkdir(char *name, int mode);
  130. extern char *aug_encrypt(char *type, char *key, char *string, void *parent);
  131. extern char *aug_decrypt(char *key, char *string, void *parent);
  132. extern char **aug_mxresolv(char *domain, int timeout, int retry, void *parent);
  133. extern char *aug_mxget(char *domain);
  134. #include "aug_debug.h"
  135. #include "aug_alloc.h"
  136. #endif /* AUG_STD_H */