mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-06 05:13:49 +00:00
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r60603 | russell | 2007-04-06 15:58:43 -0500 (Fri, 06 Apr 2007) | 13 lines To be able to achieve the things that we would like to achieve with the Asterisk GUI project, we need a fully functional HTTP interface with access to the Asterisk manager interface. One of the things that was intended to be a part of this system, but was never actually implemented, was the ability for the GUI to be able to upload files to Asterisk. So, this commit adds this in the most minimally invasive way that we could come up with. A lot of work on minimime was done by Steve Murphy. He fixed a lot of bugs in the parser, and updated it to be thread-safe. The ability to check permissions of active manager sessions was added by Dwayne Hubbard. Then, hacking this all together and do doing the modifications necessary to the HTTP interface was done by me. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
130 lines
2.5 KiB
C
130 lines
2.5 KiB
C
/*
|
|
* Asterisk -- A telephony toolkit for Linux.
|
|
*
|
|
* Copyright (C) 1999-2006, Digium, Inc.
|
|
*
|
|
* Mark Spencer <markster@digium.com>
|
|
*
|
|
* This program is free software, distributed under the terms of
|
|
* the GNU General Public License
|
|
*/
|
|
|
|
/*! \file
|
|
* \brief General Definitions for Asterisk top level program
|
|
*/
|
|
|
|
#ifndef _COMPAT_H
|
|
#define _COMPAT_H
|
|
|
|
#include "asterisk/autoconfig.h"
|
|
#include <inttypes.h>
|
|
#include <sys/types.h>
|
|
#include <stdarg.h>
|
|
|
|
#if !defined(HAVE_ASPRINTF) && !defined(__AST_DEBUG_MALLOC)
|
|
int asprintf(char **str, const char *fmt, ...);
|
|
#endif
|
|
|
|
#ifndef HAVE_GETLOADAVG
|
|
int getloadavg(double *list, int nelem);
|
|
#endif
|
|
|
|
#ifndef HAVE_SETENV
|
|
int setenv(const char *name, const char *value, int overwrite);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRCASESTR
|
|
char *strcasestr(const char *, const char *);
|
|
#endif
|
|
|
|
#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
|
|
char *strndup(const char *, size_t);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRNLEN
|
|
size_t strnlen(const char *, size_t);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRSEP
|
|
char* strsep(char** str, const char* delims);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRTOQ
|
|
uint64_t strtoq(const char *nptr, char **endptr, int base);
|
|
#endif
|
|
|
|
#ifndef HAVE_UNSETENV
|
|
int unsetenv(const char *name);
|
|
#endif
|
|
|
|
#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
|
|
int vasprintf(char **strp, const char *fmt, va_list ap);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRLCAT
|
|
size_t strlcat(char *dst, const char *src, size_t siz);
|
|
#endif
|
|
|
|
#ifndef HAVE_STRLCPY
|
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
|
#endif
|
|
|
|
#ifdef SOLARIS
|
|
#define __BEGIN_DECLS
|
|
#define __END_DECLS
|
|
|
|
#ifndef __P
|
|
#define __P(p) p
|
|
#endif
|
|
|
|
#include <alloca.h>
|
|
#include <strings.h>
|
|
#include <string.h>
|
|
#include <pthread.h>
|
|
#include <sys/stat.h>
|
|
#include <signal.h>
|
|
#include <netinet/in.h>
|
|
#include <dat/dat_platform_specific.h>
|
|
|
|
#ifndef BYTE_ORDER
|
|
#define LITTLE_ENDIAN 1234
|
|
#define BIG_ENDIAN 4321
|
|
|
|
#ifdef __sparc__
|
|
#define BYTE_ORDER BIG_ENDIAN
|
|
#else
|
|
#define BYTE_ORDER LITTLE_ENDIAN
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef __BYTE_ORDER
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
#endif
|
|
|
|
#ifndef __BIT_TYPES_DEFINED__
|
|
#define __BIT_TYPES_DEFINED__
|
|
typedef unsigned char u_int8_t;
|
|
typedef unsigned short u_int16_t;
|
|
typedef unsigned int u_int32_t;
|
|
#endif
|
|
|
|
#endif /* SOLARIS */
|
|
|
|
#ifdef __CYGWIN__
|
|
#define _WIN32_WINNT 0x0500
|
|
#ifndef INET_ADDRSTRLEN
|
|
#define INET_ADDRSTRLEN 16
|
|
#endif
|
|
#ifndef INET6_ADDRSTRLEN
|
|
#define INET6_ADDRSTRLEN 46
|
|
#endif
|
|
#endif /* __CYGWIN__ */
|
|
|
|
#ifdef __CYGWIN__
|
|
typedef unsigned long long uint64_t;
|
|
#endif
|
|
|
|
#endif
|