| 1 |
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. |
| 2 |
|
| 3 |
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata, |
| 4 |
the dvipdfmx project team. |
| 5 |
|
| 6 |
Copyright (C) 1998, 1999 by Mark A. Wicks <[email protected]> |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with this program; if not, write to the Free Software |
| 20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef _PST_H_ |
| 24 |
#define _PST_H_ |
| 25 |
|
| 26 |
#include <stdio.h> |
| 27 |
|
| 28 |
#define PST_TYPE_UNKNOWN -1 |
| 29 |
#define PST_TYPE_NULL 0 |
| 30 |
#define PST_TYPE_BOOLEAN 1 |
| 31 |
#define PST_TYPE_INTEGER 2 |
| 32 |
#define PST_TYPE_REAL 3 |
| 33 |
#define PST_TYPE_STRING 5 |
| 34 |
#define PST_TYPE_NAME 6 |
| 35 |
#define PST_TYPE_MARK 7 |
| 36 |
|
| 37 |
typedef struct pst_obj pst_obj; |
| 38 |
typedef int pst_type; |
| 39 |
|
| 40 |
extern pst_obj *pst_get_token (unsigned char **inbuf, unsigned char *inbufend); |
| 41 |
|
| 42 |
extern pst_obj *pst_new_obj (pst_type type, void *data); |
| 43 |
extern void pst_release_obj(pst_obj *obj); |
| 44 |
extern pst_obj *pst_new_mark (void); |
| 45 |
|
| 46 |
extern pst_type pst_type_of (pst_obj *obj); |
| 47 |
extern int pst_length_of (pst_obj *obj); |
| 48 |
|
| 49 |
extern int pst_getIV (pst_obj *obj); |
| 50 |
extern double pst_getRV (pst_obj *obj); |
| 51 |
extern unsigned char *pst_getSV (pst_obj *obj); |
| 52 |
|
| 53 |
extern void *pst_data_ptr (pst_obj *obj); |
| 54 |
|
| 55 |
#define PST_NAME_LEN_MAX 127 |
| 56 |
#define PST_STRING_LEN_MAX 32767 |
| 57 |
#define PST_MAX_DIGITS 10 |
| 58 |
#define PST_TOKEN_LEN_MAX PST_STRING_LEN_MAX |
| 59 |
|
| 60 |
#define PST_NULLTYPE(o) (pst_type_of((o)) == PST_TYPE_NULL) |
| 61 |
#define PST_BOOLEANTYPE(o) (pst_type_of((o)) == PST_TYPE_BOOLEAN) |
| 62 |
#define PST_NAMETYPE(o) (pst_type_of((o)) == PST_TYPE_NAME) |
| 63 |
#define PST_STRINGTYPE(o) (pst_type_of((o)) == PST_TYPE_STRING) |
| 64 |
#define PST_INTEGERTYPE(o) (pst_type_of((o)) == PST_TYPE_INTEGER) |
| 65 |
#define PST_REALTYPE(o) (pst_type_of((o)) == PST_TYPE_REAL) |
| 66 |
#define PST_NUMBERTYPE(o) (PST_INTEGERTYPE((o))||PST_REALTYPE((o))) |
| 67 |
#define PST_MARKTYPE(o) (pst_type_of((o)) == PST_TYPE_MARK) |
| 68 |
#define PST_UNKNOWNTYPE(o) (pst_type_of((o)) < 0) |
| 69 |
|
| 70 |
#define PST_TOKEN_END(s,e) ((s) == (e) || is_delim(*(s)) || is_space(*(s))) |
| 71 |
|
| 72 |
#endif /* _PST_H_ */ |