Back to index

texmacs  1.0.7.15
pst.h
Go to the documentation of this file.
00001 /*  $Header: /home/cvsroot/dvipdfmx/src/pst.h,v 1.2 2003/11/29 16:21:17 hirata Exp $
00002 
00003     This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
00004 
00005     Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
00006     the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
00007 
00008     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014 
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU General Public License for more details.
00019 
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00023 */
00024 
00025 #ifndef _PST_H_
00026 #define _PST_H_
00027 
00028 #include <stdio.h>
00029 
00030 #define PST_TYPE_UNKNOWN   -1
00031 #define PST_TYPE_NULL       0
00032 #define PST_TYPE_BOOLEAN    1
00033 #define PST_TYPE_INTEGER    2
00034 #define PST_TYPE_REAL       3
00035 #define PST_TYPE_STRING     5
00036 #define PST_TYPE_NAME       6
00037 #define PST_TYPE_MARK       7
00038 
00039 typedef struct pst_obj pst_obj;
00040 typedef int            pst_type;
00041 
00042 extern pst_obj *pst_get_token (unsigned char **inbuf, unsigned char *inbufend);
00043 
00044 extern pst_obj *pst_new_obj    (pst_type type, void *data);
00045 extern void     pst_release_obj(pst_obj *obj);
00046 extern pst_obj *pst_new_mark   (void);
00047 
00048 extern pst_type pst_type_of   (pst_obj *obj);
00049 extern long     pst_length_of (pst_obj *obj);
00050 
00051 extern long     pst_getIV (pst_obj *obj);
00052 extern double   pst_getRV (pst_obj *obj);
00053 extern unsigned char  *pst_getSV (pst_obj *obj);
00054 
00055 extern void    *pst_data_ptr (pst_obj *obj);
00056 
00057 #define PST_NAME_LEN_MAX   127
00058 #define PST_STRING_LEN_MAX 4096
00059 #define PST_MAX_DIGITS     10
00060 #define PST_TOKEN_LEN_MAX  PST_STRING_LEN_MAX
00061 
00062 #define PST_NULLTYPE(o)    (pst_type_of((o)) == PST_TYPE_NULL)
00063 #define PST_BOOLEANTYPE(o) (pst_type_of((o)) == PST_TYPE_BOOLEAN)
00064 #define PST_NAMETYPE(o)    (pst_type_of((o)) == PST_TYPE_NAME)
00065 #define PST_STRINGTYPE(o)  (pst_type_of((o)) == PST_TYPE_STRING)
00066 #define PST_INTEGERTYPE(o) (pst_type_of((o)) == PST_TYPE_INTEGER)
00067 #define PST_REALTYPE(o)    (pst_type_of((o)) == PST_TYPE_REAL)
00068 #define PST_NUMBERTYPE(o)  (PST_INTEGERTYPE((o))||PST_REALTYPE((o)))
00069 #define PST_MARKTYPE(o)    (pst_type_of((o)) == PST_TYPE_MARK)
00070 #define PST_UNKNOWNTYPE(o) (pst_type_of((o)) < 0)
00071 
00072 #define PST_TOKEN_END(s,e) ((s) == (e) || is_delim(*(s)) || is_space(*(s)))
00073 
00074 #endif /* _PST_H_ */