Back to index

plt-scheme  4.2.1
Defines | Functions | Variables
util.c File Reference
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <libit/ctype.h>
#include <wbuild.h>
#include <wsym.h>
#include <varargs.h>
#include <libintl.h>
#include <libit/malloc.h>

Go to the source code of this file.

Defines

#define _(String)   gettext(String)
#define new(ptr)   ptr = xmalloc(sizeof(*(ptr)))
#define HASHSIZE   8009
#define valid(n)   (0 <= r2[n] && r2[n] < nused && r1[r2[n]] == n)
#define copy_directory

Functions

void wbuild_comment (FILE *f)
void copy_taglist (taglist *dest, taglist *src)
void zero_taglist (taglist *dest)
void add_doctype (Doctype d)
static char * escape_string (char *src)
void set_doctag (taglist tag, char *name, char *open, char *close)
void add_class (Class c)
voidxmalloc (size_t size)
char * xstrdup (char *s)
static int hashval (char *name)
STRING hash (char *s)
void delete (STRING s)
char * get (STRING s)
STRING hdup (STRING s)
STRING catstr (va_alist)
size_t Strlen (STRING s)
STRING get_classname (STRING s)
STRING get_instname (STRING s)
STRING get_word (char *s)
STRING get_headerPname (char *dir, Class c)
static Class find_class (STRING name)
Class find_superclass (Class c, STRING name)
Class find_classvar_class (Class c, STRING name)
Class find_instvar_class (Class c, STRING name)
Class find_constr_class (Class c, STRING name)
Class find_method_class (Class c, STRING name)
Section find_method (Class c, STRING m)
int has_method (Class c, STRING m)
int has_classvar (Class c, STRING m)
Section find_pubvar (Class c, STRING m)
Section find_pubvar_back (Class c, STRING m)
Section find_constraint (Class c, STRING m)
STRING find_classvar_value (Class c, STRING name)
STRING find_instvar_value (Class c, STRING name)
int set_hierarchy (void)
int strneq (char *a, char *b, int n)

Variables

Doctype doctypes = 0
Class classes = 0
int classnodoc = 0
int classnocode = 0
STRING classfilename = 0
static STRING hashtable [HASHSIZE]
static int r2 [HASHSIZE]
static int r1 [HASHSIZE]
static int nused = 0
Class toplevel = NULL

Define Documentation

#define _ (   String)    gettext(String)

Definition at line 46 of file util.c.

#define copy_directory
Value:
if (dir != NULL && dir[0] != '\0') {                           \
              strcpy(s, dir);                                         \
              if (dir[strlen(dir)-1] != '/')                          \
                     strcat(s, "/");                                  \
       }

Definition at line 718 of file util.c.

#define HASHSIZE   8009

Definition at line 408 of file util.c.

#define new (   ptr)    ptr = xmalloc(sizeof(*(ptr)))

Definition at line 362 of file util.c.

#define valid (   n)    (0 <= r2[n] && r2[n] < nused && r1[r2[n]] == n)

Definition at line 452 of file util.c.


Function Documentation

Definition at line 342 of file util.c.

{
       c->next = classes;
       classes = c;
}

Definition at line 82 of file util.c.

{
       d->next = doctypes;
       doctypes = d;
}
STRING catstr ( va_alist  )

Definition at line 570 of file util.c.

{
       va_list ap;
#if !HAVE_STDARG_H
       int n;
#endif /* !HAVE_STDARG_H */
       unsigned int len = 0;
       char *s, *s1;
       STRING t;
       int i;

#ifdef HAVE_STDARG_H
       va_start(ap, n);
#else /* !HAVE_STDARG_H */
       va_start(ap);
       n = va_arg(ap, int);
#endif /* !HAVE_STDARG_H */
       if (n == 0) {
              va_end(ap);
              return 0;
       } else {
              for (i = n; i > 0; i--) {
                     s1 = va_arg(ap, char *);
                     len += s1 ? strlen(s1) : 0;
              }
              va_end(ap);
              s = xmalloc((len + 2) * sizeof(char));
              s[0] = '\0';
#if HAVE_STDARG_H
              va_start(ap, n);
#else /* !HAVE_STDARG_H */
              va_start(ap);
              n = va_arg(ap, int);
#endif /* !HAVE_STDARG_H */
              for (i = n; i > 0; i--) {
                     s1 = va_arg(ap, char *);
                     if (s1) strcat(s, s1);
              }
              va_end(ap);
              t = hash(s);
              return t;
       }
}

Here is the call graph for this function:

void copy_taglist ( taglist dest,
taglist src 
)

Definition at line 62 of file util.c.

{
       int i;

       for (i = 0; i <= t_privconstraint; i++) {
              (*dest)[i][0] = (*src)[i][0];
              (*dest)[i][1] = (*src)[i][1];
       }
}
void delete ( STRING  s)

Definition at line 504 of file util.c.

{
#if 0
#ifdef NDEBUG
       int h; STRING t;
#endif /*NDEBUG*/

       if (!s)
              return;

       s->linkcount--;
       if (s->linkcount > 0)
              return; /* still in use elsewhere */

#ifdef NDEBUG
       h = hashval(s->s);
       if (hashtable[h] == s)
              hashtable[h] = s->next;
       else {
              for (t = hashtable[h]; t->next != s; t = t->next) ;
              t->next = s->next;
       }
       if (s->s)
              free(s->s);
       free(s);
#else /*NDEBUG*/
       if (s->linkcount < 0)
              debug(("linkcount on %s is %d\n", s->s, s->linkcount));
#endif /*NDEBUG*/
#endif
}

Here is the call graph for this function:

static char* escape_string ( char *  src) [static]

Definition at line 89 of file util.c.

{
       char *dest, *s;

       dest = s = malloc(strlen(src) + 1);
       while (*src) {
              switch (*src) {
                     case '\\':
                            src++;
                            switch (*src) {
                                   case 'a': *s = '\a'; break;
                                   case 'b': *s = '\b'; break;
                                   case 'f': *s = '\f'; break;
                                   case 'n': *s = '\n'; break;
                                   case 'r': *s = '\r'; break;
                                   case 't': *s = '\t'; break;
                                   case 'v': *s = '\v'; break;
                                   case 'B': *s = '\\'; break;
                                   default: *s = *src;
                            }
                            src++;
                            s++;
                            break;
                     case '\"':
                            src++;
                            break;
                     default:
                            *s = *src;
                            s++;
                            src++;
              }
       }
       *s = 0;
       return dest;
}

Here is the caller graph for this function:

static Class find_class ( STRING  name) [static]

Definition at line 831 of file util.c.

{
       Class h;
       h = classes;
       while (h && h->name != name)
              h = h->next;
       return h;
}

Here is the caller graph for this function:

Definition at line 862 of file util.c.

{
       Class h;
       Section d;
       if (!c)
              return NULL;
       if ((h = find_classvar_class(c->super, name)))
              return h;
       for (d = c->classvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return c;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1033 of file util.c.

{
       Section d;

       for (d = c->classvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return d->decl->value;
       if (c->super)
              return find_classvar_value(c->super, name);
       else
              return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Class find_constr_class ( Class  c,
STRING  name 
)

Definition at line 894 of file util.c.

{
       Class h;
       Section d;

       if (!c)
              return 0;
       if ((h = find_constr_class(c->super, name)))
              return h;
       for (d = c->constraints; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return c;
       for (d = c->privconstr; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return c;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1012 of file util.c.

{
       Section d, h;

       if (!c)
              return 0;
       if ((h = find_constraint(c->super, m)))
              return h;
       for (d = c->constraints; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == m)
                     return d;
       for (d = c->privconstr; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == m)
                     return d;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Class find_instvar_class ( Class  c,
STRING  name 
)

Definition at line 876 of file util.c.

{
       Class h;
       Section d;

       if (!c)
              return 0;
       if ((h = find_instvar_class(c->super, name)))
              return h;
       for (d = c->publicvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return c;
       for (d = c->privatevars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return c;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1050 of file util.c.

{
       Section d;

       for (d = c->publicvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return d->decl->value;
       for (d = c->privatevars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == name)
                     return d->decl->value; /* should be NULL, though */
       if (c->super)
              return find_instvar_value(c->super, name);
       else
              return NULL;
}
Section find_method ( Class  c,
STRING  m 
)

Definition at line 931 of file util.c.

{
       Section d, h;

       if (!c)
              return 0;
       if ((h = find_method(c->super, m)))
              return h;
       for (d = c->methods; d; d = d->next)
              if (d->decl && d->decl->tp == Proc && d->decl->name == m)
                     return d;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Class find_method_class ( Class  c,
STRING  name 
)

Definition at line 912 of file util.c.

{
       Class h;
       Section d;

       if (!c)
              return 0;
       if ((h = find_method_class(c->super, name)))
              return h;
       for (d = c->methods; d; d = d->next)
              if (d->decl && d->decl->tp == Proc && d->decl->name == name)
                     return c;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Section find_pubvar ( Class  c,
STRING  m 
)

Definition at line 976 of file util.c.

{
       Section d, h;

       if (!c)
              return 0;
       if ((h = find_pubvar(c->super, m)))
              return h;
       for (d = c->publicvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == m)
                     return d;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 994 of file util.c.

{
       Section d, h;

       if (!c)
              return 0;
       for (d = c->publicvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == m)
                     return d;
       if ((h = find_pubvar(c->super, m)))
              return h;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Class find_superclass ( Class  c,
STRING  name 
)

Definition at line 844 of file util.c.

{
       if (!c)
              return 0;
       else if (c->name == name)
              return c;
       else
              return find_superclass(c->super, name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* get ( STRING  s)

Definition at line 541 of file util.c.

{
       if (!s)
              return "";
       else
              return s->s;
}

Definition at line 631 of file util.c.

{
       char *h, *h1;
       STRING t;
       h = h1 = xstrdup(s->s);
       if (*h == '$') h++;
       if ('a' <= h[0] && h[0] <= 'z') h[0] += 'A' - 'a';
       if (h[0] == 'X' && 'a' <= h[1] && h[1] <= 'z') h[1] += 'A' - 'a';
       t = hash(h); free(h1);
       return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STRING get_headerPname ( char *  dir,
Class  c 
)

Definition at line 750 of file util.c.

{
       char *s;
       static STRING file = 0;
       STRING t;

       if (!file)
              file = hash("file");

       s = xmalloc((dir != NULL ? strlen(dir) : 0) + 16);
       if (dir != NULL && dir[0] != '\0') {
              strcpy(s, dir);
              if (dir[strlen(dir)-1] != '/')
                     strcat(s, "/");
       }
       if (c->filenamepart)
              t = c->filenamepart;
       else
              t = c->name;
       /* strncat(s, get(t), 9); */
       strcat(s, get(t));
       strcat(s, "P.h");
       t = hash(s);
       free(s);
       return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 650 of file util.c.

{
       char *h, *h1;
       STRING t;
       h = h1 = xstrdup(s->s);
       if (*h == '$') h++;
       if ('A' <= h[0] && h[0] <= 'Z') h[0] += 'a' - 'A';
       if (h[0] == 'x' && 'A' <= h[1] && h[1] <= 'Z') h[1] += 'a' - 'A';
       t = hash(h); free(h1);
       return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STRING get_word ( char *  s)

Definition at line 667 of file util.c.

{
       char *word;
       STRING t;
       int i;

       if (!s)
              return 0;
       else {
              word = xmalloc(sizeof(char) * strlen(s) + 1);
              for (i = 0; isalnum(s[i]) || s[i] == '_'; i++)
                     word[i] = s[i];
              word[i] = '\0';
              t = hash(word);
              free(word);
              return t;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int has_classvar ( Class  c,
STRING  m 
)

Definition at line 963 of file util.c.

{
       Section d;
       for (d = c->classvars; d; d = d->next)
              if (d->decl && d->decl->tp == Var && d->decl->name == m)
                     return 1;
       return 0;
}
int has_method ( Class  c,
STRING  m 
)

Definition at line 950 of file util.c.

{
       Section d;
       for (d = c->methods; d; d = d->next)
              if (d->decl && d->decl->tp == Proc && d->decl->name == m)
                     return 1;
       return 0;
}

Here is the caller graph for this function:

STRING hash ( char *  s)

Definition at line 454 of file util.c.

{
       int h;
       STRING t;

       if (!s || s[0] == '\0')
              return 0;

       h = hashval(s);
       if (! valid(h)) {
              new(t);
              t->s = xstrdup(s);
              t->linkcount = 1;
              t->next = 0;
              do {
                     r2[h] = nused;
                     r1[nused] = h;
                     nused++;
              } while (0);
              hashtable[h] = t;
              return t;
       }
       for (t = hashtable[h]; t; t = t->next) {
              if (strcmp(t->s, s) == 0) {
                     t->linkcount++;
                     return t;
              }
       }
       new(t);
       t->s = xstrdup(s);
       t->linkcount = 1;
       t->next = hashtable[h];
       hashtable[h] = t;
       return t;
}

Here is the call graph for this function:

static int hashval ( char*  name) [static]

Definition at line 419 of file util.c.

{
       char *p;
       unsigned int h = 0, g, n = 20;

       if (name == NULL)
              return 0;

       for (p = name; n && *p; p++, n--) {
              h = (h << 4) + (*p);
              if ((g = h & 0xf0000000)) {
                     h = h ^ (g >> 24);
                     h = h ^ g;
              }
       }
       return h % HASHSIZE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STRING hdup ( STRING  s)

Definition at line 550 of file util.c.

{
       if (!s)
              return 0;
       s->linkcount++;
       return s;
}

Here is the caller graph for this function:

void set_doctag ( taglist  tag,
char *  name,
char *  open,
char *  close 
)

Definition at line 125 of file util.c.

{
       name = escape_string(name);
       open = escape_string(open);
       close = escape_string(close);
       if (!strcmp("filename", name)) {
              tag[t_filename][0] = strdup(open);
              tag[t_filename][1] = strdup(close);
       }
       if (!strcmp("start", name)) {
              tag[t_start][0] = strdup(open);
              tag[t_start][1] = strdup(close);
       }
       if (!strcmp("class", name)) {
              tag[t_class][0] = strdup(open);
              tag[t_class][1] = strdup(close);
       }
       if (!strcmp("name", name)) {
              tag[t_name][0] = strdup(open);
              tag[t_name][1] = strdup(close);
       }
       if (!strcmp("name2", name)) {
              tag[t_name2][0] = strdup(open);
              tag[t_name2][1] = strdup(close);
       }
       if (!strcmp("superclass", name)) {
              tag[t_superclass][0] = strdup(open);
              tag[t_superclass][1] = strdup(close);
       }
       if (!strcmp("publicvars", name)) {
              tag[t_publicvars][0] = strdup(open);
              tag[t_publicvars][1] = strdup(close);
       }
       if (!strcmp("privatevars", name)) {
              tag[t_privatevars][0] = strdup(open);
              tag[t_privatevars][1] = strdup(close);
       }
       if (!strcmp("actions", name)) {
              tag[t_actions][0] = strdup(open);
              tag[t_actions][1] = strdup(close);
       }
       if (!strcmp("translations", name)) {
              tag[t_translations][0] = strdup(open);
              tag[t_translations][1] = strdup(close);
       }
       if (!strcmp("exports", name)) {
              tag[t_exports][0] = strdup(open);
              tag[t_exports][1] = strdup(close);
       }
       if (!strcmp("methods", name)) {
              tag[t_methods][0] = strdup(open);
              tag[t_methods][1] = strdup(close);
       }
       if (!strcmp("imports", name)) {
              tag[t_imports][0] = strdup(open);
              tag[t_imports][1] = strdup(close);
       }
       if (!strcmp("utilities", name)) {
              tag[t_utilities][0] = strdup(open);
              tag[t_utilities][1] = strdup(close);
       }
       if (!strcmp("classvars", name)) {
              tag[t_classvars][0] = strdup(open);
              tag[t_classvars][1] = strdup(close);
       }
       if (!strcmp("section", name)) {
              tag[t_section][0] = strdup(open);
              tag[t_section][1] = strdup(close);
       }
       if (!strcmp("macro", name)) {
              tag[t_macro][0] = strdup(open);
              tag[t_macro][1] = strdup(close);
       }
       if (!strcmp("publicvar", name)) {
              tag[t_publicvar][0] = strdup(open);
              tag[t_publicvar][1] = strdup(close);
       }
       if (!strcmp("action", name)) {
              tag[t_action][0] = strdup(open);
              tag[t_action][1] = strdup(close);
       }
       if (!strcmp("code", name)) {
              tag[t_code][0] = strdup(open);
              tag[t_code][1] = strdup(close);
       }
       if (!strcmp("table", name)) {
              tag[t_table][0] = strdup(open);
              tag[t_table][1] = strdup(close);
       }
       if (!strcmp("tablehead", name)) {
              tag[t_tablehead][0] = strdup(open);
              tag[t_tablehead][1] = strdup(close);
       }
       if (!strcmp("row", name)) {
              tag[t_row][0] = strdup(open);
              tag[t_row][1] = strdup(close);
       }
       if (!strcmp("resname", name)) {
              tag[t_resname][0] = strdup(open);
              tag[t_resname][1] = strdup(close);
       }
       if (!strcmp("resclass", name)) {
              tag[t_resclass][0] = strdup(open);
              tag[t_resclass][1] = strdup(close);
       }
       if (!strcmp("restype", name)) {
              tag[t_restype][0] = strdup(open);
              tag[t_restype][1] = strdup(close);
       }
       if (!strcmp("resdefault", name)) {
              tag[t_resdefault][0] = strdup(open);
              tag[t_resdefault][1] = strdup(close);
       }
       if (!strcmp("inline", name)) {
              tag[t_inline][0] = strdup(open);
              tag[t_inline][1] = strdup(close);
       }
       if (!strcmp("underline", name)) {
              tag[t_underline][0] = strdup(open);
              tag[t_underline][1] = strdup(close);
       }
       if (!strcmp("backslash", name)) {
              tag[t_backslash][0] = strdup(open);
              tag[t_backslash][1] = strdup(close);
       }
       if (!strcmp("tilde", name)) {
              tag[t_tilde][0] = strdup(open);
              tag[t_tilde][1] = strdup(close);
       }
       if (!strcmp("hashmark", name)) {
              tag[t_hashmark][0] = strdup(open);
              tag[t_hashmark][1] = strdup(close);
       }
       if (!strcmp("dollar", name)) {
              tag[t_dollar][0] = strdup(open);
              tag[t_dollar][1] = strdup(close);
       }
       if (!strcmp("less", name)) {
              tag[t_less][0] = strdup(open);
              tag[t_less][1] = strdup(close);
       }
       if (!strcmp("greater", name)) {
              tag[t_greater][0] = strdup(open);
              tag[t_greater][1] = strdup(close);
       }
       if (!strcmp("percent", name)) {
              tag[t_percent][0] = strdup(open);
              tag[t_percent][1] = strdup(close);
       }
       if (!strcmp("caret", name)) {
              tag[t_caret][0] = strdup(open);
              tag[t_caret][1] = strdup(close);
       }
       if (!strcmp("ampersand", name)) {
              tag[t_ampersand][0] = strdup(open);
              tag[t_ampersand][1] = strdup(close);
       }
       if (!strcmp("lbrace", name)) {
              tag[t_lbrace][0] = strdup(open);
              tag[t_lbrace][1] = strdup(close);
       }
       if (!strcmp("rbrace", name)) {
              tag[t_rbrace][0] = strdup(open);
              tag[t_rbrace][1] = strdup(close);
       }
       if (!strcmp("bar", name)) {
              tag[t_bar][0] = strdup(open);
              tag[t_bar][1] = strdup(close);
       }
       if (!strcmp("at", name)) {
              tag[t_at][0] = strdup(open);
              tag[t_at][1] = strdup(close);
       }
       if (!strcmp("type", name)) {
              tag[t_type][0] = strdup(open);
              tag[t_type][1] = strdup(close);
       }
       if (!strcmp("incl", name)) {
              tag[t_incl][0] = strdup(open);
              tag[t_incl][1] = strdup(close);
       }
       if (!strcmp("constraints", name)) {
              tag[t_constraints][0] = strdup(open);
              tag[t_constraints][1] = strdup(close);
       }
       if (!strcmp("constraint", name)) {
              tag[t_constraint][0] = strdup(open);
              tag[t_constraint][1] = strdup(close);
       }
       if (!strcmp("privconstraints", name)) {
              tag[t_privconstraints][0] = strdup(open);
              tag[t_privconstraints][1] = strdup(close);
       }
       if (!strcmp("privconstraint", name)) {
              tag[t_privconstraint][0] = strdup(open);
              tag[t_privconstraint][1] = strdup(close);
       }
       free(open);
       free(close);
       free(name);
}

Here is the call graph for this function:

Definition at line 1090 of file util.c.

{
       Class c, c1;
       char *p;
       int err = 0;

       for (c = classes; c; c = c->next) {
              if ((p = strrchr(get(c->superclass), '/')))
                     c->super = find_class(hash(p + 1));
              else
                     c->super = find_class(c->superclass);
              if (c->super == NULL) {
                     c->sister = toplevel;
                     toplevel = c;
              } else {
                     c->sister = c->super->daughters;
                     c->super->daughters = c;
              }
       }
       for (c = classes; c; c = c->next) {
              for (c1 = c->super; c1; c1 = c1->super) {
                     if (c1 == c) {
                            fprintf(stderr,
                                   _("%s:%d: cyclic dependency found "
                                   "in superclasses of %s\n"),
                                   get(c->filename), c->lineno,
                                   get(c->name));
                            err++;
                            break;
                     }
              }
       }
       return err;
}

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Strlen ( STRING  s)

Definition at line 619 of file util.c.

{
       return s ? (s->s != NULL ? strlen(s->s) : 0) : 0;
}

Here is the caller graph for this function:

int strneq ( char *  a,
char *  b,
int  n 
)

Definition at line 1128 of file util.c.

{
       if (!a)
              return (!b) || (*b == '\0');
       if (!b)
              return 0;
       while (n && *a && (*a == *b)) {
              a++;
              b++;
              n--;
       }
       return n == 0 || *a == *b /* == '\0' */;
}

Here is the caller graph for this function:

void wbuild_comment ( FILE *  f)

Definition at line 50 of file util.c.

{
       fprintf(f,
              "/* Generated by wbuild\n"
              " * (generator version %s)\n"
              " */\n", "3.2");
}

Here is the caller graph for this function:

void* xmalloc ( size_t  size)

Definition at line 369 of file util.c.

{
       void *t;

       t = malloc(size);
       if (t == NULL) {
              /* I deliberately decided NOT to internationalize--see above
               */
              fprintf(stderr, "out of memory\n");
              exit(1);
       }
       return t;
}

Here is the caller graph for this function:

char* xstrdup ( char *  s)

Definition at line 384 of file util.c.

{
       char *t;
       if (s) {
              t = xmalloc(strlen(s) + 1);
              strcpy(t, s);
       } else {
              t = xmalloc(1);
              *t = 0;
       }
       return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void zero_taglist ( taglist dest)

Definition at line 72 of file util.c.

{
       int i;

       for (i = 0; i <= t_privconstraint; i++) {
              (*dest)[i][0] = (*dest)[i][1] = 0;
       }
}

Variable Documentation

Definition at line 333 of file util.c.

Definition at line 335 of file util.c.

Definition at line 334 of file util.c.

Definition at line 334 of file util.c.

Definition at line 60 of file util.c.

Definition at line 410 of file util.c.

int nused = 0 [static]

Definition at line 412 of file util.c.

int r1[HASHSIZE] [static]

Definition at line 411 of file util.c.

int r2[HASHSIZE] [static]

Definition at line 411 of file util.c.

Definition at line 1075 of file util.c.