| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef GRPARSER_H_INCLUDED |
| #define GRPARSER_H_INCLUDED |
|
|
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
|
|
| |
|
|
| |
|
|
| #define NGP_ALLOCCHUNK (1000) |
| #define NGP_MAX_INCLUDE (10) |
| #define NGP_MAX_COMMENT (80) |
| #define NGP_MAX_NAME FLEN_KEYWORD |
| |
| #define NGP_MAX_STRING (80) |
| #define NGP_MAX_ARRAY_DIM (999) |
| #define NGP_MAX_FNAME (1000) |
| #define NGP_MAX_ENVFILES (10000) |
|
|
| #define NGP_TOKEN_UNKNOWN (-1) |
| #define NGP_TOKEN_INCLUDE (0) |
| #define NGP_TOKEN_GROUP (1) |
| #define NGP_TOKEN_END (2) |
| #define NGP_TOKEN_XTENSION (3) |
| #define NGP_TOKEN_SIMPLE (4) |
| #define NGP_TOKEN_EOF (5) |
|
|
| #define NGP_TTYPE_UNKNOWN (0) |
| #define NGP_TTYPE_BOOL (1) |
| #define NGP_TTYPE_STRING (2) |
| #define NGP_TTYPE_INT (3) |
| #define NGP_TTYPE_REAL (4) |
| #define NGP_TTYPE_COMPLEX (5) |
| #define NGP_TTYPE_NULL (6) |
| #define NGP_TTYPE_RAW (7) |
|
|
| #define NGP_FOUND_EQUAL_SIGN (1) |
|
|
| #define NGP_FORMAT_OK (0) |
| #define NGP_FORMAT_ERROR (1) |
|
|
| #define NGP_NODE_INVALID (0) |
| #define NGP_NODE_IMAGE (1) |
| #define NGP_NODE_ATABLE (2) |
| #define NGP_NODE_BTABLE (3) |
|
|
| #define NGP_NON_SYSTEM_ONLY (0) |
| #define NGP_REALLY_ALL (1) |
|
|
| #define NGP_XTENSION_SIMPLE (1) |
| #define NGP_XTENSION_FIRST (2) |
|
|
| #define NGP_LINE_REREAD (1) |
|
|
| #define NGP_BITPIX_INVALID (-12345) |
|
|
| |
|
|
| #ifdef NGP_PARSER_DEBUG_MALLOC |
|
|
| #define ngp_alloc(x) dal_malloc(x) |
| #define ngp_free(x) dal_free(x) |
| #define ngp_realloc(x,y) dal_realloc(x,y) |
|
|
| #else |
|
|
| #define ngp_alloc(x) malloc(x) |
| #define ngp_free(x) free(x) |
| #define ngp_realloc(x,y) realloc(x,y) |
|
|
| #endif |
|
|
| |
|
|
| typedef struct NGP_RAW_LINE_STRUCT |
| { char *line; |
| char *name; |
| char *value; |
| int type; |
| char *comment; |
| int format; |
| int flags; |
| } NGP_RAW_LINE; |
|
|
|
|
| typedef union NGP_TOKVAL_UNION |
| { char *s; |
| char b; |
| int i; |
| double d; |
| struct NGP_COMPLEX_STRUCT |
| { double re; |
| double im; |
| } c; |
| } NGP_TOKVAL; |
|
|
|
|
| typedef struct NGP_TOKEN_STRUCT |
| { int type; |
| char name[NGP_MAX_NAME]; |
| NGP_TOKVAL value; |
| char comment[NGP_MAX_COMMENT]; |
| } NGP_TOKEN; |
|
|
|
|
| typedef struct NGP_HDU_STRUCT |
| { int tokcnt; |
| NGP_TOKEN *tok; |
| } NGP_HDU; |
|
|
|
|
| typedef struct NGP_TKDEF_STRUCT |
| { char *name; |
| int code; |
| } NGP_TKDEF; |
|
|
|
|
| typedef struct NGP_EXTVER_TAB_STRUCT |
| { char *extname; |
| int version; |
| } NGP_EXTVER_TAB; |
|
|
|
|
| |
|
|
| extern NGP_RAW_LINE ngp_curline; |
| extern NGP_RAW_LINE ngp_prevline; |
|
|
| extern int ngp_extver_tab_size; |
| extern NGP_EXTVER_TAB *ngp_extver_tab; |
|
|
|
|
| |
|
|
| int ngp_get_extver(char *extname, int *version); |
| int ngp_set_extver(char *extname, int version); |
| int ngp_delete_extver_tab(void); |
| int ngp_line_from_file(FILE *fp, char **p); |
| int ngp_free_line(void); |
| int ngp_free_prevline(void); |
| int ngp_read_line_buffered(FILE *fp); |
| int ngp_unread_line(void); |
| int ngp_extract_tokens(NGP_RAW_LINE *cl); |
| int ngp_include_file(char *fname); |
| int ngp_read_line(int ignore_blank_lines); |
| int ngp_keyword_is_write(NGP_TOKEN *ngp_tok); |
| int ngp_keyword_all_write(NGP_HDU *ngph, fitsfile *ffp, int mode); |
| int ngp_hdu_init(NGP_HDU *ngph); |
| int ngp_hdu_clear(NGP_HDU *ngph); |
| int ngp_hdu_insert_token(NGP_HDU *ngph, NGP_TOKEN *newtok); |
| int ngp_append_columns(fitsfile *ff, NGP_HDU *ngph, int aftercol); |
| int ngp_read_xtension(fitsfile *ff, int parent_hn, int simple_mode); |
| int ngp_read_group(fitsfile *ff, char *grpname, int parent_hn); |
|
|
| |
|
|
| #ifdef __cplusplus |
| } |
| #endif |
|
|
| #endif |
|
|