include/solaris-compat/compat.h File Reference

#include <alloca.h>
#include <strings.h>
#include <string.h>
#include <pthread.h>
#include <sys/stat.h>
#include <signal.h>
#include <netinet/in.h>

Include dependency graph for include/solaris-compat/compat.h:

Go to the source code of this file.

Defines

#define __BEGIN_DECLS
#define __BIG_ENDIAN   BIG_ENDIAN
#define __BYTE_ORDER   BYTE_ORDER
#define __END_DECLS
#define __LITTLE_ENDIAN   LITTLE_ENDIAN
#define __P(p)   p
#define BIG_ENDIAN   4321
#define BYTE_ORDER   LITTLE_ENDIAN
#define LITTLE_ENDIAN   1234

Typedefs

typedef unsigned short u_int16_t
typedef unsigned int u_int32_t
typedef unsigned char u_int8_t

Functions

int setenv (const char *name, const char *value, int overwrite)
char * strsep (char **str, const char *delims)
int unsetenv (const char *name)


Define Documentation

#define __BEGIN_DECLS

Definition at line 4 of file include/solaris-compat/compat.h.

#define __BIG_ENDIAN   BIG_ENDIAN

Definition at line 32 of file include/solaris-compat/compat.h.

#define __BYTE_ORDER   BYTE_ORDER

Definition at line 33 of file include/solaris-compat/compat.h.

Referenced by ogg_vorbis_read().

#define __END_DECLS

Definition at line 5 of file include/solaris-compat/compat.h.

#define __LITTLE_ENDIAN   LITTLE_ENDIAN

Definition at line 31 of file include/solaris-compat/compat.h.

#define __P (  )     p

Definition at line 8 of file include/solaris-compat/compat.h.

Referenced by __dbpanic().

#define BIG_ENDIAN   4321

Definition at line 21 of file include/solaris-compat/compat.h.

Referenced by __bt_open(), byteorder(), and init_hash().

#define BYTE_ORDER   LITTLE_ENDIAN

Definition at line 26 of file include/solaris-compat/compat.h.

Referenced by __get_page(), __put_page(), and init_hash().

#define LITTLE_ENDIAN   1234

Definition at line 20 of file include/solaris-compat/compat.h.

Referenced by __bt_open(), byteorder(), and init_hash().


Typedef Documentation

typedef unsigned short u_int16_t

Definition at line 39 of file include/solaris-compat/compat.h.

typedef unsigned int u_int32_t

Definition at line 40 of file include/solaris-compat/compat.h.

typedef unsigned char u_int8_t

Definition at line 38 of file include/solaris-compat/compat.h.


Function Documentation

int setenv ( const char *  name,
const char *  value,
int  overwrite 
)

Definition at line 68 of file strcompat.c.

References ast_alloca, and buf.

00069 {
00070    unsigned char *buf;
00071    int buflen;
00072 
00073    if (!overwrite && getenv(name))
00074       return 0;
00075 
00076    buflen = strlen(name) + strlen(value) + 2;
00077    buf = ast_alloca(buflen);
00078 
00079    snprintf(buf, buflen, "%s=%s", name, value);
00080 
00081    return putenv(buf);
00082 }

char* strsep ( char **  str,
const char *  delims 
)

Definition at line 41 of file strcompat.c.

References NULL.

00042 {
00043    char *token;
00044 
00045    if (!*str) {
00046       /* No more tokens */
00047       return NULL;
00048    }
00049 
00050    token = *str;
00051    while (**str != '\0') {
00052       if (strchr(delims, **str)) {
00053          **str = '\0';
00054          (*str)++;
00055          return token;
00056       }
00057       (*str)++;
00058    }
00059 
00060    /* There is no other token */
00061    *str = NULL;
00062 
00063    return token;
00064 }

int unsetenv ( const char *  name  ) 

Definition at line 86 of file strcompat.c.

References setenv().

00087 {
00088    return setenv(name, "", 0);
00089 }


Generated on Thu Apr 16 06:30:18 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6