blob: 7a23dfeb471b0459ae2ab6dee165b6843a3d88a6 [file] [log] [blame]
nethercote5912c812004-02-15 15:38:08 +00001/* This file is part of hp2ps, a graph drawer for memory profiles.
2 Copyright (C) 2002 The University Court of the University of Glasgow.
3 This program is governed by the license contained in the file LICENSE. */
4
nethercotec9f36922004-02-14 16:40:02 +00005#ifndef HP_FILE_H
6#define HP_FILE_H
7
8typedef enum {
9 /* These tokens are found in ".hp" files */
10
11 EOF_TOK,
12 INTEGER_TOK,
13 FLOAT_TOK,
14 IDENTIFIER_TOK,
15 STRING_TOK,
16 BEGIN_SAMPLE_TOK,
17 END_SAMPLE_TOK,
18 JOB_TOK,
19 DATE_TOK,
20 SAMPLE_UNIT_TOK,
21 VALUE_UNIT_TOK,
22 MARK_TOK,
23
24 /* These extra ones are found only in ".aux" files */
25
26 X_RANGE_TOK,
27 Y_RANGE_TOK,
28 ORDER_TOK,
29 SHADE_TOK
30} token;
31
32struct datapoint {
33 int bucket;
34 floatish value;
35};
36
37struct chunk {
38 struct chunk *next;
39 short nd; /* 0 .. N_CHUNK - 1 */
40 struct datapoint *d;
41};
42
43
44struct entry {
45 struct entry *next;
46 struct chunk *chk;
47 char *name;
48};
49
50extern char *theident;
51extern char *thestring;
52extern int theinteger;
53extern floatish thefloatish;
54extern int g_ch;
55extern token thetok;
56extern int linenum;
57extern int endfile;
58
59char *TokenToString PROTO((token));
60
61extern struct entry** identtable;
62
63extern floatish *samplemap;
64extern floatish *markmap;
65
66void GetHpFile PROTO((FILE *));
67void StoreSample PROTO((struct entry *, intish, floatish));
68struct entry *MakeEntry PROTO((char *));
69
70token GetNumber PROTO((FILE *));
71void GetIdent PROTO((FILE *));
72void GetString PROTO((FILE *));
73boolish IsIdChar PROTO((int)); /* int is a "char" from getc */
74
75extern char *jobstring;
76extern char *datestring;
77
78extern char *sampleunitstring;
79extern char *valueunitstring;
80
81#endif /* HP_FILE_H */