00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #define __EXTENSIONS__
00022 #include "defs.h"
00023
00024 #include <netdb.h>
00025 #include <sys/socket.h>
00026 #include <netinet/in.h>
00027
00028 #if STD_UNIX_VERSION < SUV_SUS3
00029 #ifdef SOLARIS
00030 #undef __EXTENSIONS__
00031 #endif
00032 #endif
00033 #include "macrostr.h"
00034 #ifndef DARWIN
00035 #include <sys/msg.h>
00036 #endif
00037 #include <sys/sem.h>
00038 #include <sys/shm.h>
00039 #include <sys/mman.h>
00040
00041 static struct {
00042 char *ms_cat;
00043 intptr_t ms_code;
00044 char *ms_macro;
00045 char *ms_desc;
00046 } macrostr_db[] = {
00047 #include "macrostr.incl"
00048 { NULL, 0, NULL, NULL}
00049 };
00050
00051 char *get_macrostr(const char *cat, int code, char **desc)
00052 {
00053 int i;
00054
00055 for (i = 0; macrostr_db[i].ms_cat != NULL; i++)
00056 if (strcmp(macrostr_db[i].ms_cat, cat) == 0 &&
00057 macrostr_db[i].ms_code == code) {
00058 if (desc != NULL)
00059 *desc = macrostr_db[i].ms_desc;
00060 return macrostr_db[i].ms_macro;
00061 }
00062 if (desc != NULL)
00063 *desc = "?";
00064 return "?";
00065 }