File: aug_std.h

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (148 lines) | stat: -rw-r--r-- 4,409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
 * $Id: aug_std.h,v 1.1.1.1 2005/06/13 16:47:43 bogdan_iancu Exp $
 *
 * POSTGRES module, portions of this code were templated using
 * the mysql module, thus it's similarity.
 *
 * Copyright (C) 2003 August.Net Services, LLC
 *
 * This file is part of openser, a free SIP server.
 *
 * openser is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version
 *
 * openser is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * ---
 *
 * History
 * -------
 * 2003-04-06 initial code written (Greg Fausak/Andy Fullford)
 *
 */
/*
** ________________________________________________________________________
**
**
**                      $RCSfile: aug_std.h,v $
**                     $Revision: 1.1.1.1 $
**
**             Last change $Date: 2005/06/13 16:47:43 $
**           Last change $Author: bogdan_iancu $
**                        $State: Exp $
**                       $Locker:  $
**
**               Original author: Andrew Fullford
**
**           Copyright (C) August Associates  1995
**
** ________________________________________________________________________
*/

/*  AM_TYPE: (INSTALL_INC)  */

#ifndef AUG_STD_H
#define AUG_STD_H

#include "aug_sysdep.h"

/*
**  The rest of the libaug package has dependencies on these
**  system includes.
*/
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <time.h>

/*
**  Some boolean verbosity.
*/
#ifndef augBool
#define augBool		char
#endif
#define augFALSE	0
#define augTRUE		1

/*
**  Exit codes.
**
**  To just indicate success or failure, use augEXIT_OK and augEXIT_BAD.
**  For more esoteric codes, use the others.  Their numbers are chosen
**  so that they are unlikely to be generated by other applications, and
**  also to avoid signal numbers or error counts.
**
**  Note that augEXIT_NOMEM will be generated by aug_alloc failures
**  if they are not handled.
*/
#define augEXIT_YES	0
#define augEXIT_NO	1
#define augEXIT_NOMEM	99
#define augEXIT_ABORT	(augEXIT_NOMEM-1)
#define augEXIT_FATAL	(augEXIT_NOMEM-2)
#define augEXIT_ERROR	(augEXIT_NOMEM-3)
#define augEXIT_WARN	(augEXIT_NOMEM-4)
#define augEXIT_USAGE	(augEXIT_NOMEM-5)

/*
**  Used as a tag to explicitly signify externally accessible symbols.
**  I don't like leaving off the storage class; it's just too quiet.
*/
#define augExport

/*
**  Some utility prototypes.
*/
extern char *aug_cpy(char *tgt, char *src, int size);
extern char *aug_cat(char *tgt, char *src, int size);
extern char *aug_strip(char *tgt);
extern char *aug_upper(char *tgt);
extern char *aug_lower(char *tgt);
extern int aug_strexpand(char *tgt, char *src, int tgt_size);
extern char *aug_getsym(char *name, char *default_value);
extern void aug_abort_va(char *file, int line, char *fmt, va_list ap);
extern void aug_abort(char *file, int line, char *fmt, ...);
extern void aug_exit(int exit_code);
extern void aug_setmodule(char *name);
extern char *aug_module(void);
extern void aug_setenv(char *name, char *value);
extern char *aug_tempnam(char *dir, char *pfx, void *parent);

extern char *aug_hostname(void);
extern char *aug_domain(void);
extern char *aug_fqdn(char *addr);

extern int aug_getport(char *name);

extern void aug_sockopts(int s);

extern int aug_signal_max(void);
extern int aug_signal_num(char *signame);
extern char *aug_signal_name(int sig);

extern int aug_utc_offset(time_t tim);

extern unsigned long aug_random(void);
extern void aug_srandom(unsigned long seed);
extern unsigned long aug_random_seed(int entropy);
extern int aug_mkdir(char *name, int mode);

extern char *aug_encrypt(char *type, char *key, char *string, void *parent);
extern char *aug_decrypt(char *key, char *string, void *parent);

extern char **aug_mxresolv(char *domain, int timeout, int retry, void *parent);
extern char *aug_mxget(char *domain);

#include "aug_debug.h"
#include "aug_alloc.h"

#endif /* AUG_STD_H */