Back to index

tetex-bin  3.0
Classes | Defines | Typedefs | Functions | Variables
util.h File Reference
#include "types.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  ps_value
struct  ps_obj
struct  ps_dict

Defines

#define TRUE   (1)
#define FALSE   (0)
#define MAX_ULONG   (~(ULONG)(0))
#define MAX_INTEGER   ((LONG)((((ULONG) 1)<<(sizeof(ULONG)*8-1))-1))
#define MIN_INTEGER   ((-MAX_INTEGER)-1)
#define MAX_ARRAY_CNT   (65535)
#define MAX_DICT_CNT   (65535)
#define MAX_STRING_LEN   (65535)
#define MAX_NAME_LEN   (128)
#define VM_SIZE   (50*1024)
#define MIN(a, b)   (((a)<(b)) ? a : b )
#define vm_next_byte()   (vm_next)
#define vm_free_bytes()   (vm_free)
#define vm_avail(B)   (B <= vm_free)
#define OBJ_INTEGER   (0)
#define OBJ_REAL   (1)
#define OBJ_BOOLEAN   (2)
#define OBJ_ARRAY   (3)
#define OBJ_STRING   (4)
#define OBJ_NAME   (5)
#define OBJ_FILE   (6)
#define OBJ_ENCODING   (7)
#define objIsInteger(o)   ((o).type == OBJ_INTEGER)
#define objIsReal(o)   ((o).type == OBJ_REAL)
#define objIsBoolean(o)   ((o).type == OBJ_BOOLEAN)
#define objIsArray(o)   ((o).type == OBJ_ARRAY)
#define objIsString(o)   ((o).type == OBJ_STRING)
#define objIsName(o)   ((o).type == OBJ_NAME)
#define objIsFile(o)   ((o).type == OBJ_FILE)
#define objSetInteger(o)   ((o).type = OBJ_INTEGER)
#define objSetReal(o)   ((o).type = OBJ_REAL)
#define objSetBoolean(o)   ((o).type = OBJ_BOOLEAN)
#define objSetArray(o)   ((o).type = OBJ_ARRAY)
#define objSetString(o)   ((o).type = OBJ_STRING)
#define objSetName(o)   ((o).type = OBJ_NAME)
#define objSetFile(o)   ((o).type = OBJ_FILE)
#define objPIsInteger(o)   ((o)->type == OBJ_INTEGER)
#define objPIsReal(o)   ((o)->type == OBJ_REAL)
#define objPIsBoolean(o)   ((o)->type == OBJ_BOOLEAN)
#define objPIsArray(o)   ((o)->type == OBJ_ARRAY)
#define objPIsString(o)   ((o)->type == OBJ_STRING)
#define objPIsName(o)   ((o)->type == OBJ_NAME)
#define objPIsFile(o)   ((o)->type == OBJ_FILE)
#define objPSetInteger(o)   ((o)->type = OBJ_INTEGER)
#define objPSetReal(o)   ((o)->type = OBJ_REAL)
#define objPSetBoolean(o)   ((o)->type = OBJ_BOOLEAN)
#define objPSetArray(o)   ((o)->type = OBJ_ARRAY)
#define objPSetString(o)   ((o)->type = OBJ_STRING)
#define objPSetName(o)   ((o)->type = OBJ_NAME)
#define objPSetFile(o)   ((o)->type = OBJ_FILE)

Typedefs

typedef int boolean
typedef union ps_value psvalue
typedef struct ps_obj psobj
typedef struct ps_dict psdict

Functions

boolean vm_init ()
char * vm_alloc ()
psobjGetType1CharString ()

Variables

LONG vm_free
LONG vm_size
char * vm_next

Class Documentation

union ps_value

Definition at line 103 of file util.h.

Collaboration diagram for ps_value:
Class Members
struct ps_obj * arrayP
int boolean
FILE * fileP
int integer
char * nameP
float real
unsigned char * stringP
int value
char * valueP
struct ps_obj

Definition at line 118 of file util.h.

Class Members
unsigned short len
char type
char unused
struct ps_dict

Definition at line 128 of file util.h.

Collaboration diagram for ps_dict:
Class Members
psobj key
psobj value

Define Documentation

#define FALSE   (0)

Definition at line 45 of file util.h.

#define MAX_ARRAY_CNT   (65535)

Definition at line 59 of file util.h.

#define MAX_DICT_CNT   (65535)

Definition at line 60 of file util.h.

#define MAX_INTEGER   ((LONG)((((ULONG) 1)<<(sizeof(ULONG)*8-1))-1))

Definition at line 55 of file util.h.

#define MAX_NAME_LEN   (128)

Definition at line 62 of file util.h.

#define MAX_STRING_LEN   (65535)

Definition at line 61 of file util.h.

#define MAX_ULONG   (~(ULONG)(0))

Definition at line 53 of file util.h.

#define MIN (   a,
  b 
)    (((a)<(b)) ? a : b )

Definition at line 70 of file util.h.

#define MIN_INTEGER   ((-MAX_INTEGER)-1)

Definition at line 57 of file util.h.

#define OBJ_ARRAY   (3)

Definition at line 96 of file util.h.

#define OBJ_BOOLEAN   (2)

Definition at line 95 of file util.h.

#define OBJ_ENCODING   (7)

Definition at line 100 of file util.h.

#define OBJ_FILE   (6)

Definition at line 99 of file util.h.

#define OBJ_INTEGER   (0)

Definition at line 93 of file util.h.

#define OBJ_NAME   (5)

Definition at line 98 of file util.h.

#define OBJ_REAL   (1)

Definition at line 94 of file util.h.

#define OBJ_STRING   (4)

Definition at line 97 of file util.h.

#define objIsArray (   o)    ((o).type == OBJ_ARRAY)

Definition at line 141 of file util.h.

#define objIsBoolean (   o)    ((o).type == OBJ_BOOLEAN)

Definition at line 140 of file util.h.

#define objIsFile (   o)    ((o).type == OBJ_FILE)

Definition at line 144 of file util.h.

#define objIsInteger (   o)    ((o).type == OBJ_INTEGER)

Definition at line 138 of file util.h.

#define objIsName (   o)    ((o).type == OBJ_NAME)

Definition at line 143 of file util.h.

#define objIsReal (   o)    ((o).type == OBJ_REAL)

Definition at line 139 of file util.h.

#define objIsString (   o)    ((o).type == OBJ_STRING)

Definition at line 142 of file util.h.

#define objPIsArray (   o)    ((o)->type == OBJ_ARRAY)

Definition at line 163 of file util.h.

#define objPIsBoolean (   o)    ((o)->type == OBJ_BOOLEAN)

Definition at line 162 of file util.h.

#define objPIsFile (   o)    ((o)->type == OBJ_FILE)

Definition at line 166 of file util.h.

#define objPIsInteger (   o)    ((o)->type == OBJ_INTEGER)

Definition at line 160 of file util.h.

#define objPIsName (   o)    ((o)->type == OBJ_NAME)

Definition at line 165 of file util.h.

#define objPIsReal (   o)    ((o)->type == OBJ_REAL)

Definition at line 161 of file util.h.

#define objPIsString (   o)    ((o)->type == OBJ_STRING)

Definition at line 164 of file util.h.

#define objPSetArray (   o)    ((o)->type = OBJ_ARRAY)

Definition at line 174 of file util.h.

#define objPSetBoolean (   o)    ((o)->type = OBJ_BOOLEAN)

Definition at line 173 of file util.h.

#define objPSetFile (   o)    ((o)->type = OBJ_FILE)

Definition at line 177 of file util.h.

#define objPSetInteger (   o)    ((o)->type = OBJ_INTEGER)

Definition at line 171 of file util.h.

#define objPSetName (   o)    ((o)->type = OBJ_NAME)

Definition at line 176 of file util.h.

#define objPSetReal (   o)    ((o)->type = OBJ_REAL)

Definition at line 172 of file util.h.

#define objPSetString (   o)    ((o)->type = OBJ_STRING)

Definition at line 175 of file util.h.

#define objSetArray (   o)    ((o).type = OBJ_ARRAY)

Definition at line 152 of file util.h.

#define objSetBoolean (   o)    ((o).type = OBJ_BOOLEAN)

Definition at line 151 of file util.h.

#define objSetFile (   o)    ((o).type = OBJ_FILE)

Definition at line 155 of file util.h.

#define objSetInteger (   o)    ((o).type = OBJ_INTEGER)

Definition at line 149 of file util.h.

#define objSetName (   o)    ((o).type = OBJ_NAME)

Definition at line 154 of file util.h.

#define objSetReal (   o)    ((o).type = OBJ_REAL)

Definition at line 150 of file util.h.

#define objSetString (   o)    ((o).type = OBJ_STRING)

Definition at line 153 of file util.h.

#define TRUE   (1)

Definition at line 41 of file util.h.

#define vm_avail (   B)    (B <= vm_free)

Definition at line 86 of file util.h.

#define vm_free_bytes ( )    (vm_free)

Definition at line 85 of file util.h.

#define vm_next_byte ( )    (vm_next)

Definition at line 84 of file util.h.

#define VM_SIZE   (50*1024)

Definition at line 66 of file util.h.


Typedef Documentation

typedef int boolean

Definition at line 36 of file util.h.

typedef struct ps_dict psdict
typedef struct ps_obj psobj
typedef union ps_value psvalue

Function Documentation

char* vm_alloc ( )

Definition at line 58 of file util.c.

{
  /* Check whether it is the first piece of memory for the
     current font or not. If so, simulate lacking memory to
     indicate that the font should be tried to load with a
     vitual memory twice as large!
     */
  if (vm_init_count>0){
    vm_init_count++;
    return(FALSE);
  }
  vm_init_count++;
  
  vm_next = vm_base = (char *) calloc( vm_init_amount, sizeof(char));

  if (vm_base != NULL) {
    vm_free = vm_init_amount;
    vm_size = vm_init_amount;
    tokenMaxP = vm_next_byte() + vm_init_amount;
    return(TRUE);
  }
  else
    return(FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 40 of file util.c.

char* vm_next

Definition at line 39 of file util.c.

Definition at line 41 of file util.c.