|
gpp4
1.3.1
|
Fortran API to ccp4_parser.c. More...
#include "ccp4_sysdep.h"#include "ccp4_fortran.h"#include "ccp4_parser.h"#include "ccp4_general.h"Macros | |
| #define | PARSER_DEBUG(x) |
Functions | |
| int | fparse_isblank (const char *line, const int line_len) |
| int | fparse_strncpypad (char *fstr, const char *cstr, const int lfstr) |
| int | fparse_populate_arrays (CCP4PARSERARRAY *parser, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec) |
| int | fparse_delimiters (CCP4PARSERARRAY *parser, char *new_delimiters, char *new_nulldelimiters) |
| FORTRAN_SUBR (PARSER, parser,(fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print, int key_len, int line_len, int cvalue_len),(fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print),(fpstr key, int key_len, fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print)) | |
| FORTRAN_SUBR (PARSE, parse,(fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n, int line_len, int cvalue_len),(fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n),(fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec, int *n)) | |
| FORTRAN_SUBR (PARSDL, parsdl,(fpstr newdlm, int *nnewdl, int *nspecd, int newdlm_len),(fpstr newdlm, int *nnewdl, int *nspecd),(fpstr newdlm, int newdlm_len, int *nnewdl, int *nspecd)) | |
Fortran API to ccp4_parser.c.
This file contains Fortran API functions which provide the following functionality originally found in the parser.f file:
plus internal utility functions which should not be accessed directly from an application.
| FORTRAN_SUBR | ( | PARSER | , |
| parser | , | ||
| (fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print, int key_len, int line_len, int cvalue_len) | , | ||
| (fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print) | , | ||
| (fpstr key, int key_len, fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print) | |||
| ) |
This function implements the Fortran equivalent of:
SUBROUTINE PARSER(KEY,LINE,IBEG,IEND,ITYP,FVALUE,CVALUE,IDEC,NTOK,LEND,PRINT)
which is the original CCP4 keyword parser. The function wraps the ccp4_parser routines to mimic the behaviour of the original subroutine.
| FORTRAN_SUBR | ( | PARSE | , |
| parse | , | ||
| (fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n, int line_len, int cvalue_len) | , | ||
| (fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n) | , | ||
| (fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec, int *n) | |||
| ) |
This function implements the Fortran equivalent of:
SUBROUTINE PARSE(LINE,IBEG,IEND,ITYP,FVALUE,CVALUE,IDEC,N)
References ccp4_FtoCString().
| FORTRAN_SUBR | ( | PARSDL | , |
| parsdl | , | ||
| (fpstr newdlm, int *nnewdl, int *nspecd, int newdlm_len) | , | ||
| (fpstr newdlm, int *nnewdl, int *nspecd) | , | ||
| (fpstr newdlm, int newdlm_len, int *nnewdl, int *nspecd) | |||
| ) |
Set delimiters for PARSE, PARSER
SUBROUTINE PARSDL(NEWDLM,NNEWDL,NSPECD)
| int fparse_delimiters | ( | CCP4PARSERARRAY * | parser, |
| char * | new_delimiters, | ||
| char * | new_nulldelimiters | ||
| ) |
Set and get delimiters for use in ccp4_parse(r). This should only be called internally (from PARSDL).
If called with parser set to NULL, the lists of characters in new_delimiters and new_nulldelimiters are stored.
When called with a valid pointer to a parser structure, the stored lists of characters form the new delimiter sets via a call to ccp4_parse_delimiters.
NB: if delimiter strings are set with a call to fparse_delimiters then they persist in memory unless a subsequent call is made with all arguments set to NULL. This represents a potential memory leak.
| int fparse_isblank | ( | const char * | line, |
| const int | line_len | ||
| ) |
Given a string and its length, returns 1 if the only characters are whitespace or newlines, and 0 if there are other characters.
References charmatch().
| int fparse_populate_arrays | ( | CCP4PARSERARRAY * | parser, |
| int * | ibeg, | ||
| int * | iend, | ||
| int * | ityp, | ||
| float * | fvalue, | ||
| fpstr | cvalue, | ||
| int | cvalue_len, | ||
| int * | idec | ||
| ) |
Given a pointer to a CCP4PARSERARRAY, will populate the equivalent arrays supplied by the Fortran application.
Should only be called from PARSER or PARSE.
| int fparse_strncpypad | ( | char * | fstr, |
| const char * | cstr, | ||
| const int | lfstr | ||
| ) |
Copy lfstr characters from C-style string cstr into Fortran-style string fstr. lfstr is the maximum length of the Fortran-style string.
If cstr contains fewer characters than lfstr then fstr is padded with spaces. Note that fstr will not contain an end-of-string null character, so printf using s may also show trailing garbage.
1.8.13