| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef _ASTERISK_H |
| 19 |
#define _ASTERISK_H |
| 20 |
|
| 21 |
#include "asterisk/autoconfig.h" |
| 22 |
#include "asterisk/compat.h" |
| 23 |
#include "asterisk/astmm.h" |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#ifndef AST_DIR_MODE |
| 29 |
#define AST_DIR_MODE 0777 |
| 30 |
#endif |
| 31 |
#ifndef AST_FILE_MODE |
| 32 |
#define AST_FILE_MODE 0666 |
| 33 |
#endif |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
#ifndef PATH_MAX |
| 40 |
#define PATH_MAX 4096 |
| 41 |
#endif |
| 42 |
|
| 43 |
|
| 44 |
#define AST_CURL_USER_AGENT "asterisk-libcurl-agent/1.0" |
| 45 |
|
| 46 |
#define DEFAULT_LANGUAGE "en" |
| 47 |
|
| 48 |
#define DEFAULT_SAMPLE_RATE 8000 |
| 49 |
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000) |
| 50 |
#define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__ |
| 51 |
#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__ |
| 52 |
#define strtok __PLEASE_USE_strtok_r_INSTEAD_OF_strtok__ |
| 53 |
|
| 54 |
#if defined(DEBUG_FD_LEAKS) && !defined(STANDALONE) && !defined(STANDALONE2) && !defined(STANDALONE_AEL) |
| 55 |
|
| 56 |
#include <sys/stat.h> |
| 57 |
#include <sys/socket.h> |
| 58 |
#include <fcntl.h> |
| 59 |
|
| 60 |
#define open(a,...) __ast_fdleak_open(__FILE__,__LINE__,__PRETTY_FUNCTION__, a, __VA_ARGS__) |
| 61 |
#define pipe(a) __ast_fdleak_pipe(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 62 |
#define socketpair(a,b,c,d) __ast_fdleak_socketpair(a, b, c, d, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 63 |
#define socket(a,b,c) __ast_fdleak_socket(a, b, c, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 64 |
#define accept(a,b,c) __ast_fdleak_accept(a, b, c, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 65 |
#define close(a) __ast_fdleak_close(a) |
| 66 |
#define fopen(a,b) __ast_fdleak_fopen(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 67 |
#define fclose(a) __ast_fdleak_fclose(a) |
| 68 |
#define dup2(a,b) __ast_fdleak_dup2(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 69 |
#define dup(a) __ast_fdleak_dup(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 70 |
|
| 71 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 72 |
extern "C" { |
| 73 |
#endif |
| 74 |
int __ast_fdleak_open(const char *file, int line, const char *func, const char *path, int flags, ...); |
| 75 |
int __ast_fdleak_pipe(int *fds, const char *file, int line, const char *func); |
| 76 |
int __ast_fdleak_socketpair(int domain, int type, int protocol, int sv[2], |
| 77 |
const char *file, int line, const char *func); |
| 78 |
int __ast_fdleak_socket(int domain, int type, int protocol, const char *file, int line, const char *func); |
| 79 |
int __ast_fdleak_accept(int socket, struct sockaddr *address, socklen_t *address_len, |
| 80 |
const char *file, int line, const char *func); |
| 81 |
#if defined(HAVE_EVENTFD) |
| 82 |
#include <sys/eventfd.h> |
| 83 |
#define eventfd(a,b) __ast_fdleak_eventfd(a,b, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 84 |
int __ast_fdleak_eventfd(unsigned int initval, int flags, const char *file, int line, const char *func); |
| 85 |
#endif |
| 86 |
#if defined(HAVE_TIMERFD) |
| 87 |
#include <sys/timerfd.h> |
| 88 |
#define timerfd_create(a,b) __ast_fdleak_timerfd_create(a,b, __FILE__,__LINE__,__PRETTY_FUNCTION__) |
| 89 |
int __ast_fdleak_timerfd_create(int clockid, int flags, const char *file, int line, const char *func); |
| 90 |
#endif |
| 91 |
int __ast_fdleak_close(int fd); |
| 92 |
FILE *__ast_fdleak_fopen(const char *path, const char *mode, const char *file, int line, const char *func); |
| 93 |
int __ast_fdleak_fclose(FILE *ptr); |
| 94 |
int __ast_fdleak_dup2(int oldfd, int newfd, const char *file, int line, const char *func); |
| 95 |
int __ast_fdleak_dup(int oldfd, const char *file, int line, const char *func); |
| 96 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 97 |
} |
| 98 |
#endif |
| 99 |
#endif |
| 100 |
|
| 101 |
int ast_set_priority(int); |
| 102 |
int ast_fd_init(void); |
| 103 |
int ast_pbx_init(void); |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
int ast_register_atexit(void (*func)(void)); |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
int ast_register_cleanup(void (*func)(void)); |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
void ast_unregister_atexit(void (*func)(void)); |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
int ast_cancel_shutdown(void); |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
int ast_shutting_down(void); |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
int ast_shutdown_final(void); |
| 176 |
|
| 177 |
#ifdef MTX_PROFILE |
| 178 |
#define HAVE_MTX_PROFILE |
| 179 |
#endif |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
int ast_add_profile(const char *, uint64_t scale); |
| 197 |
int64_t ast_profile(int, int64_t); |
| 198 |
int64_t ast_mark(int, int start1_stop0); |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
struct ast_channel; |
| 207 |
struct ast_frame; |
| 208 |
struct ast_module; |
| 209 |
struct ast_variable; |
| 210 |
struct ast_str; |
| 211 |
struct ast_sched_context; |
| 212 |
struct ast_json; |
| 213 |
|
| 214 |
|
| 215 |
#define __stringify_1(x) #x |
| 216 |
#define __stringify(x) __stringify_1(x) |
| 217 |
|
| 218 |
#if defined(AST_IN_CORE) \ |
| 219 |
|| (!defined(AST_MODULE_SELF_SYM) \ |
| 220 |
&& (defined(STANDALONE) || defined(STANDALONE2) || defined(AST_NOT_MODULE))) |
| 221 |
|
| 222 |
#define AST_MODULE_SELF NULL |
| 223 |
|
| 224 |
#elif defined(AST_MODULE_SELF_SYM) |
| 225 |
|
| 226 |
|
| 227 |
#define AST_MODULE_SELF AST_MODULE_SELF_SYM() |
| 228 |
|
| 229 |
struct ast_module; |
| 230 |
|
| 231 |
struct ast_module *AST_MODULE_SELF_SYM(void); |
| 232 |
|
| 233 |
#else |
| 234 |
|
| 235 |
#error "Externally compiled modules must declare AST_MODULE_SELF_SYM." |
| 236 |
|
| 237 |
#endif |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
int ast_pbx_uuid_get(char *pbx_uuid, int length); |
| 245 |
|
| 246 |
#endif |