Back to index

tetex-bin  3.0
Classes | Functions | Variables
vfpacket.c File Reference
#include "ptexlib.h"

Go to the source code of this file.

Classes

struct  packet_entry
struct  vf_entry

Functions

 define_array (packet)
 define_array (vf)
integer newvfpacket (internalfontnumber f)
void storepacket (integer f, integer c, integer s)
void pushpacketstate ()
void poppacketstate ()
void startpacket (internalfontnumber f, integer c)
eightbits packetbyte ()
void vf_free (void)

Variables

static char * packet_data_ptr

Class Documentation

struct packet_entry

Definition at line 25 of file vfpacket.c.

Class Members
char * dataptr
internalfontnumber font
int len
struct vf_entry

Definition at line 34 of file vfpacket.c.

Class Members
char ** data
internalfontnumber font
int * len

Function Documentation

define_array ( packet  )
integer newvfpacket ( internalfontnumber  f)

Definition at line 45 of file vfpacket.c.

{
    int i,
        n = fontec[f] - fontbc[f] + 1;
    alloc_array(vf, 1, SMALL_ARRAY_SIZE);
    vf_ptr->len = xtalloc(n, int);
    vf_ptr->data = xtalloc(n, char *);
    for (i = 0; i < n; i++) {
        vf_ptr->data[i] = NULL;
        vf_ptr->len[i] = 0;
    }
    vf_ptr->font = f;
    return vf_ptr++ - vf_array;
}

Definition at line 94 of file vfpacket.c.

{
    vfpacketlength--;
    return *packet_data_ptr++;
}

Definition at line 78 of file vfpacket.c.

{
    if (packet_ptr == packet_array)
        pdftex_fail("packet stack empty, impossible to pop");
    packet_ptr--;
    f = packet_ptr->font;
    packet_data_ptr = packet_ptr->dataptr;
    vfpacketlength = packet_ptr->len;
}

Definition at line 69 of file vfpacket.c.

{
    alloc_array(packet, 1, SMALL_ARRAY_SIZE);
    packet_ptr->font = f;
    packet_ptr->dataptr = packet_data_ptr;
    packet_ptr->len = vfpacketlength;
    packet_ptr++;
}
void startpacket ( internalfontnumber  f,
integer  c 
)

Definition at line 88 of file vfpacket.c.

{
    packet_data_ptr = vf_array[vfpacketbase[f]].data[c - fontbc[f]];
    vfpacketlength = vf_array[vfpacketbase[f]].len[c - fontbc[f]];
}
void storepacket ( integer  f,
integer  c,
integer  s 
)

Definition at line 60 of file vfpacket.c.

{
    int l = strstart[s + 1] - strstart[s];
    vf_array[vfpacketbase[f]].len[c - fontbc[f]] = l;
    vf_array[vfpacketbase[f]].data[c - fontbc[f]] = xtalloc(l, char);
    memcpy((void *)vf_array[vfpacketbase[f]].data[c - fontbc[f]], 
           (void *)(strpool + strstart[s]), (unsigned)l);
}

Here is the call graph for this function:

void vf_free ( void  )

Definition at line 100 of file vfpacket.c.

{
    vf_entry *v;
    int n;
    char **p;
    if (vf_array != NULL) {
        for (v = vf_array; v < vf_ptr; v++) {
            xfree(v->len);
            n = fontec[v->font] - fontec[v->font] + 1;
            for (p = v->data; p - v->data < n ; p++)
                xfree(*p);
            xfree(v->data);
        }
        xfree(vf_array);
    }
    xfree(packet_array);
}

Here is the caller graph for this function:


Variable Documentation

char* packet_data_ptr [static]

Definition at line 43 of file vfpacket.c.