Back to index

tetex-bin  3.0
Defines | Functions
lib.h File Reference
#include <kpathsea/c-proto.h>
#include <kpathsea/types.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define FATAL_PERROR(str)
#define START_FATAL()
#define END_FATAL()   fputs (".\n", stderr); exit (1); } while (0)
#define FATAL(str)   START_FATAL (); fputs (str, stderr); END_FATAL ()
#define FATAL1(str, e1)   START_FATAL (); fprintf (stderr, str, e1); END_FATAL ()
#define FATAL2(str, e1, e2)   START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL ()
#define FATAL3(str, e1, e2, e3)   START_FATAL (); fprintf (stderr, str, e1, e2, e3); END_FATAL ()
#define FATAL4(str, e1, e2, e3, e4)   START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4); END_FATAL ()
#define FATAL5(str, e1, e2, e3, e4, e5)   START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5); END_FATAL ()
#define FATAL6(str, e1, e2, e3, e4, e5, e6)   START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5, e6); END_FATAL ()
#define START_WARNING()   do { fputs ("warning: ", stderr)
#define END_WARNING()   fputs (".\n", stderr); fflush (stderr); } while (0)
#define WARNING(str)   START_WARNING (); fputs (str, stderr); END_WARNING ()
#define WARNING1(str, e1)   START_WARNING (); fprintf (stderr, str, e1); END_WARNING ()
#define WARNING2(str, e1, e2)   START_WARNING (); fprintf (stderr, str, e1, e2); END_WARNING ()
#define WARNING3(str, e1, e2, e3)   START_WARNING (); fprintf (stderr, str, e1, e2, e3); END_WARNING ()
#define WARNING4(str, e1, e2, e3, e4)   START_WARNING (); fprintf (stderr, str, e1, e2, e3, e4); END_WARNING ()
#define STREQ(s1, s2)   ((s1) && (s2) && (strcmp (s1, s2) == 0))
#define STRNEQ(s1, s2, n)   ((s1) && (s2) && (strncmp (s1, s2, n) == 0))
#define FILESTRCASEEQ   STREQ
#define FILESTRNCASEEQ   STRNEQ
#define FILECHARCASEEQ(c1, c2)   ((c1) == (c2))
#define MAX_INT_LENGTH   21
#define ENVVAR(test, default)   (getenv (test) ? (test) : (default))
#define XTALLOC(n, t)   ((t *) xmalloc ((n) * sizeof (t)))
#define XTALLOC1(t)   XTALLOC (1, t)
#define XRETALLOC(addr, n, t)   ((addr) = (t *) xrealloc (addr, (n) * sizeof(t)))

Functions

KPSEDLL string concat P2H (const_string s1, const_string s2)
KPSEDLL string concat3 P3H (const_string, const_string, const_string)
KPSEDLL string xstrdup P1H (const_string s)
KPSEDLL string make_prefix P2H (string stem_prefix, string name)
KPSEDLL void xputenv_int P2H (const_string var, int value)
KPSEDLL string xgetcwd P1H (void)
KPSEDLL int dir_links P2H (const_string fn, long nlinks)
KPSEDLL void xfclose P2H (FILE *, const_string filename)
KPSEDLL void xfseek P4H (FILE *, long, int, string filename)
KPSEDLL unsigned long xftell P2H (FILE *, string filename)
KPSEDLL address xmalloc P1H (unsigned size)
KPSEDLL address xrealloc P2H (address old_address, unsigned new_size)
KPSEDLL address xcalloc P2H (unsigned nelem, unsigned elsize)

Define Documentation

#define END_FATAL ( )    fputs (".\n", stderr); exit (1); } while (0)

Definition at line 36 of file lib.h.

#define END_WARNING ( )    fputs (".\n", stderr); fflush (stderr); } while (0)

Definition at line 55 of file lib.h.

#define ENVVAR (   test,
  default 
)    (getenv (test) ? (test) : (default))

Definition at line 92 of file lib.h.

#define FATAL (   str)    START_FATAL (); fputs (str, stderr); END_FATAL ()

Definition at line 38 of file lib.h.

#define FATAL1 (   str,
  e1 
)    START_FATAL (); fprintf (stderr, str, e1); END_FATAL ()

Definition at line 40 of file lib.h.

#define FATAL2 (   str,
  e1,
  e2 
)    START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL ()

Definition at line 42 of file lib.h.

#define FATAL3 (   str,
  e1,
  e2,
  e3 
)    START_FATAL (); fprintf (stderr, str, e1, e2, e3); END_FATAL ()

Definition at line 44 of file lib.h.

#define FATAL4 (   str,
  e1,
  e2,
  e3,
  e4 
)    START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4); END_FATAL ()

Definition at line 46 of file lib.h.

#define FATAL5 (   str,
  e1,
  e2,
  e3,
  e4,
  e5 
)    START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5); END_FATAL ()

Definition at line 48 of file lib.h.

#define FATAL6 (   str,
  e1,
  e2,
  e3,
  e4,
  e5,
  e6 
)    START_FATAL (); fprintf (stderr, str, e1, e2, e3, e4, e5, e6); END_FATAL ()

Definition at line 50 of file lib.h.

#define FATAL_PERROR (   str)
Value:
do { \
  fprintf (stderr, "%s: ", program_invocation_name); \
  perror (str); exit (EXIT_FAILURE); } while (0)

Definition at line 30 of file lib.h.

#define FILECHARCASEEQ (   c1,
  c2 
)    ((c1) == (c2))

Definition at line 82 of file lib.h.

#define FILESTRCASEEQ   STREQ

Definition at line 80 of file lib.h.

#define FILESTRNCASEEQ   STRNEQ

Definition at line 81 of file lib.h.

#define MAX_INT_LENGTH   21

Definition at line 88 of file lib.h.

#define START_FATAL ( )
Value:
do { \
  fprintf (stderr, "%s: fatal: ", program_invocation_name);

Definition at line 34 of file lib.h.

#define START_WARNING ( )    do { fputs ("warning: ", stderr)

Definition at line 54 of file lib.h.

#define STREQ (   s1,
  s2 
)    ((s1) && (s2) && (strcmp (s1, s2) == 0))

Definition at line 70 of file lib.h.

#define STRNEQ (   s1,
  s2,
  n 
)    ((s1) && (s2) && (strncmp (s1, s2, n) == 0))

Definition at line 71 of file lib.h.

#define WARNING (   str)    START_WARNING (); fputs (str, stderr); END_WARNING ()

Definition at line 57 of file lib.h.

#define WARNING1 (   str,
  e1 
)    START_WARNING (); fprintf (stderr, str, e1); END_WARNING ()

Definition at line 59 of file lib.h.

#define WARNING2 (   str,
  e1,
  e2 
)    START_WARNING (); fprintf (stderr, str, e1, e2); END_WARNING ()

Definition at line 61 of file lib.h.

#define WARNING3 (   str,
  e1,
  e2,
  e3 
)    START_WARNING (); fprintf (stderr, str, e1, e2, e3); END_WARNING ()

Definition at line 63 of file lib.h.

#define WARNING4 (   str,
  e1,
  e2,
  e3,
  e4 
)    START_WARNING (); fprintf (stderr, str, e1, e2, e3, e4); END_WARNING ()

Definition at line 65 of file lib.h.

#define XRETALLOC (   addr,
  n,
  t 
)    ((addr) = (t *) xrealloc (addr, (n) * sizeof(t)))

Definition at line 179 of file lib.h.

#define XTALLOC (   n,
  t 
)    ((t *) xmalloc ((n) * sizeof (t)))

Definition at line 177 of file lib.h.

#define XTALLOC1 (   t)    XTALLOC (1, t)

Definition at line 178 of file lib.h.


Function Documentation

KPSEDLL string xgetcwd P1H ( void  ) [read]

Definition at line 260 of file afm2tfm.c.

                  {
   register char *p ;
   register int c ;

   param = buffer ;
   for (p=buffer; (c=getc(afmin)) != EOF;) {
      if (p - buffer >= INBUFSIZE)
         error("! input line too long; perhaps input file is malformed?") ;
      *p++ = c ;
      if (c == '\r') {
         c = getc(afmin) ;
         if (c != EOF) {
            if (c == '\n') {
               *p++ = c ;
            } else {
               ungetc(c, afmin) ;
            }
         }
         break ;
      } else if (c == '\n') {
         break ;
      }
   }
   *p = 0 ;
   (void)strcpy(obuffer, buffer) ;
   if (p == buffer && c == EOF)
      return(0) ;
   else
      return(1) ;
}
KPSEDLL address xmalloc P1H ( unsigned  size)
KPSEDLL string make_prefix P2H ( string  stem_prefix,
string  name 
)
KPSEDLL void xputenv_int P2H ( const_string  var,
int  value 
)
KPSEDLL int dir_links P2H ( const_string  fn,
long  nlinks 
)
KPSEDLL void xfclose P2H ( FILE ,
const_string  filename 
)
KPSEDLL unsigned long xftell P2H ( FILE ,
string  filename 
)
KPSEDLL address xrealloc P2H ( address  old_address,
unsigned  new_size 
)
KPSEDLL address xcalloc P2H ( unsigned  nelem,
unsigned  elsize 
)
void printversionandexit P3H ( const_string  ,
const_string  ,
const_string   
)
KPSEDLL void xfseek P4H ( FILE ,
long  ,
int  ,
string  filename 
)