src/util/util.h File Reference

#include <stdio.h>
#include <ctype.h>
#include <math.h>
Include dependency graph for util.h:

Go to the source code of this file.

Defines

#define strchr   index
#define assert(ex)
#define fail(why)
#define ARGS(args)   ()
#define NULLARGS   ()
#define EXTERN   extern
#define UNUSED
#define NIL(type)   ((type *) 0)
#define ALLOC(type, num)   ((type *) MMalloc(sizeof(type) * (unsigned long) (num)))
#define REALLOC(type, obj, num)   ((type *) MMrealloc((void *) (obj), sizeof(type) * (unsigned long) (num)))
#define FREE(obj)   ((obj) ? (free((void *) (obj)), (obj) = 0) : 0)
#define ABS(a)   ((a) < 0 ? -(a) : (a))
#define ptime()   util_cpu_time()
#define print_time(t)   util_print_time(t)
#define HUGE   8.9884656743115790e+307
#define HUGE_VAL   HUGE
#define MAXINT   (1 << 30)

Functions

EXTERN void util_print_cpu_stats ARGS ((FILE *))
EXTERN long util_cpu_time ARGS ((void))
EXTERN int util_getopt ARGS ((int, char *const *, char const *))
EXTERN int util_check_file ARGS ((char const *, char const *))
EXTERN char *util_path_search ARGS ((char const *))
EXTERN char *util_file_search ARGS ((char const *, char *, char const *))
EXTERN char *util_print_time ARGS ((long))
EXTERN char *util_inttostr ARGS ((int))
EXTERN char *util_strcat3 ARGS ((char const *, char const *, char const *))
EXTERN char *util_strcat4 ARGS ((char const *, char const *, char const *, char const *))
EXTERN void MMout_of_memory ARGS ((unsigned long))
EXTERN void *MMrealloc ARGS ((void *, unsigned long))
EXTERN void MMfree ARGS ((void *))

Variables

int util_optind
char * util_optarg

Define Documentation

#define ABS (  )     ((a) < 0 ? -(a) : (a))

Definition at line 197 of file util.h.

#define ALLOC ( type,
num   )     ((type *) MMalloc(sizeof(type) * (unsigned long) (num)))

Definition at line 180 of file util.h.

#define ARGS ( args   )     ()

Definition at line 115 of file util.h.

#define assert ( ex   ) 
Value:
{\
    if (! (ex)) {\
        (void) fprintf(stderr,\
            "Assertion failed: file %s, line %d\n\"%s\"\n",\
            __FILE__, __LINE__, "ex");\
        (void) fflush(stdout);\
        abort();\
    }\
}

Definition at line 85 of file util.h.

#define EXTERN   extern

Definition at line 134 of file util.h.

#define fail ( why   ) 
Value:
{\
    (void) fprintf(stderr, "Fatal error: file %s, line %d\n%s\n",\
        __FILE__, __LINE__, why);\
    (void) fflush(stdout);\
    abort();\
}

Definition at line 97 of file util.h.

#define FREE ( obj   )     ((obj) ? (free((void *) (obj)), (obj) = 0) : 0)

Definition at line 184 of file util.h.

#define HUGE   8.9884656743115790e+307

Definition at line 213 of file util.h.

#define HUGE_VAL   HUGE

Definition at line 215 of file util.h.

#define MAXINT   (1 << 30)

Definition at line 219 of file util.h.

#define NIL ( type   )     ((type *) 0)

Definition at line 158 of file util.h.

#define NULLARGS   ()

Definition at line 123 of file util.h.

#define print_time (  )     util_print_time(t)

Definition at line 209 of file util.h.

 
#define ptime (  )     util_cpu_time()

Definition at line 208 of file util.h.

#define REALLOC ( type,
obj,
num   )     ((type *) MMrealloc((void *) (obj), sizeof(type) * (unsigned long) (num)))

Definition at line 182 of file util.h.

#define strchr   index

CHeaderFile*****************************************************************

FileName [ util.h ]

PackageName [ util ]

Synopsis [ Very low-level utilities ]

Description [ Includes file access, pipes, forks, time, and temporary file access. ]

Author [ Stephen Edwards <sedwards@eecs.berkeley.edu> and many others]

Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. All rights reserved.

Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.]

Revision [

Id
util.h,v 1.19 2009/04/11 02:04:46 fabio Exp

]

Definition at line 64 of file util.h.

#define UNUSED

Definition at line 147 of file util.h.


Function Documentation

EXTERN void MMfree ARGS ( (void *)   ) 
EXTERN void* MMrealloc ARGS ( (void *, unsigned long)   ) 
EXTERN void MMout_of_memory ARGS ( (unsigned long)   ) 
EXTERN char* util_strcat4 ARGS ( (char const *, char const *, char const *, char const *)   ) 
EXTERN char* util_strcat3 ARGS ( (char const *, char const *, char const *)   ) 
EXTERN char* util_inttostr ARGS ( (int)   ) 
EXTERN void util_srandom ARGS ( (long)   ) 
EXTERN char* util_file_search ARGS ( (char const *, char *, char const *)   ) 
EXTERN char *util_tilde_expand ARGS ( (char const *)   ) 
EXTERN char *util_tempnam ARGS ( (char const *, char const *)   ) 
EXTERN int util_getopt ARGS ( (int, char *const *, char const *)   ) 
EXTERN long util_cpu_time ARGS ( (void)   ) 
EXTERN void util_print_cpu_stats ARGS ( (FILE *)   ) 

Variable Documentation

char* util_optarg

Definition at line 24 of file getopt.c.

Definition at line 25 of file getopt.c.


Generated on Tue Jan 12 13:57:29 2010 for glu-2.2 by  doxygen 1.6.1