Miscellaneous macros and functions

Name

Miscellaneous macros and functions -- Various utilities.

Synopsis


#include <gts.h>


#define     GTS_COMMENTS

gint        gts_get_token                   (FILE *fptr,
                                             GString *buf,
                                             const char *delimiters,
                                             const char *comments);
void        gts_get_newline                 (FILE *fptr);

Description

The gts_get_token() and gts_get_newline() functions are used for parsing GTS geometric files.

Details

GTS_COMMENTS

#define GTS_COMMENTS  "#%!"

Set of characters used as comments identifiers in GTS geometric files.


gts_get_token ()

gint        gts_get_token                   (FILE *fptr,
                                             GString *buf,
                                             const char *delimiters,
                                             const char *comments);

Reads characters from fptr and fills buf with a string delimited by characters in delimiters. Comments starts with a character in comments and ends with a newline character ('\n').

fptr : a file pointer.
buf : a buffer in which to return the result.
delimiters : a string of characters used to delimit the fields.
comments : a string of characters defining the start of a comment.
Returns : the last character read from fptr.


gts_get_newline ()

void        gts_get_newline                 (FILE *fptr);

Reads characters from fptr until a '\n' character is met.

fptr : a file pointer.