ARPDAS_QNX6 1.0
Classes | Defines | Typedefs | Functions | Variables
tma_file.c File Reference
#include <malloc.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "nortlib.h"
#include "tma.h"
#include "cmdalgo.h"
Include dependency graph for tma_file.c:

Go to the source code of this file.

Classes

struct  command_st

Defines

#define TK_NUMBER   256
#define TK_TMCCMD   257
#define TK_QSTR   258
#define KW_VALIDATE   259
#define TK_NAME   260
#define TK_EOF   261
#define TK_ERR   262
#define KW_AND   263
#define KW_OR   264
#define KW_HOLD   265
#define KW_ELSE   266
#define KW_RESUME   267
#define BEGIN_BUFFER   lexbufpos = 0
#define BUFFER_CHAR(c)   if ( buffer_char( c ) ) return TK_ERR
#define END_BUFFER   BUFFER_CHAR(0)

Typedefs

typedef struct command_st command_t

Functions

static void synt_err (char *txt)
static int buffer_char (char c)
static void yyunlex (int token)
static int yylex (FILE *fp)
static int tma_strdup (command_t **ptr, const char *str, command_t *next)
static slurp_valfind_slurp (const char *statename)
static int read_a_cmd (FILE *fp, command_t **cmdl, const char *mycase)
static int read_a_tcmd (FILE *fp, const char *mycase, long int *dtp, command_t **cmdl)
static void free_tmacmds (tma_ifile *spec)
static int read_tmafile (tma_ifile *spec, FILE *fp)
void tma_read_file (tma_ifile *ifilespec)

Variables

char rcsid_tma_file_c [] = "$Header: /cvsroot/arp-das/QNX6/tmlib/src/tma_file.c,v 1.2 2009/11/18 20:46:18 ntallen Exp $"
static const char * yy_filename
static int yy_lineno
static char * yy_text
static long int yy_val
static int lexbufsize
static int lexbufpos
static int yyunlexed = 0
static long int last_time

Define Documentation

#define BEGIN_BUFFER   lexbufpos = 0

Definition at line 53 of file tma_file.c.

Referenced by yylex().

#define BUFFER_CHAR (   c)    if ( buffer_char( c ) ) return TK_ERR

Definition at line 54 of file tma_file.c.

Referenced by yylex().

#define END_BUFFER   BUFFER_CHAR(0)

Definition at line 55 of file tma_file.c.

Referenced by yylex().

#define KW_AND   263

Definition at line 30 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define KW_ELSE   266

Definition at line 33 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define KW_HOLD   265

Definition at line 32 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define KW_OR   264

Definition at line 31 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define KW_RESUME   267

Definition at line 34 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define KW_VALIDATE   259

Definition at line 26 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define TK_EOF   261

Definition at line 28 of file tma_file.c.

Referenced by read_a_tcmd(), and yylex().

#define TK_ERR   262

Definition at line 29 of file tma_file.c.

Referenced by yylex().

#define TK_NAME   260

Definition at line 27 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define TK_NUMBER   256

Definition at line 23 of file tma_file.c.

Referenced by read_a_cmd(), read_a_tcmd(), and yylex().

#define TK_QSTR   258

Definition at line 25 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().

#define TK_TMCCMD   257

Definition at line 24 of file tma_file.c.

Referenced by read_a_cmd(), and yylex().


Typedef Documentation

typedef struct command_st command_t

Function Documentation

static int buffer_char ( char  c) [static]

Definition at line 39 of file tma_file.c.

References lexbufpos, lexbufsize, synt_err(), and yy_text.

Here is the call graph for this function:

static slurp_val* find_slurp ( const char *  statename) [static]

Definition at line 197 of file tma_file.c.

References slurp_vals, and slurp_val::state.

Referenced by read_a_cmd(), and read_tmafile().

Here is the caller graph for this function:

static void free_tmacmds ( tma_ifile spec) [static]

Definition at line 391 of file tma_file.c.

References assert, tma_state::cmd, command_st::cmd, and tma_ifile::cmds.

Referenced by read_tmafile(), and tma_read_file().

Here is the caller graph for this function:

static int read_a_cmd ( FILE *  fp,
command_t **  cmdl,
const char *  mycase 
) [static]

Definition at line 230 of file tma_file.c.

References ci_sendcmd(), CMDREP_SYNERR, slurp_val::cmdstr, find_slurp(), KW_AND, KW_ELSE, KW_HOLD, KW_OR, KW_RESUME, KW_VALIDATE, command_st::next, set_response(), synt_err(), TK_NAME, TK_NUMBER, TK_QSTR, TK_TMCCMD, tma_strdup(), yy_text, yy_val, and yylex().

Referenced by read_a_tcmd().

Here is the call graph for this function:

Here is the caller graph for this function:

static int read_a_tcmd ( FILE *  fp,
const char *  mycase,
long int *  dtp,
command_t **  cmdl 
) [static]

Definition at line 347 of file tma_file.c.

References last_time, read_a_cmd(), synt_err(), TK_EOF, TK_NUMBER, yy_val, yylex(), and yyunlex().

Referenced by read_tmafile().

Here is the call graph for this function:

Here is the caller graph for this function:

static int read_tmafile ( tma_ifile spec,
FILE *  fp 
) [static]

Definition at line 406 of file tma_file.c.

References command_st::cmd, tma_state::cmd, tma_ifile::cmds, slurp_val::cmdstr, tma_state::dt, tma_ifile::filename, find_slurp(), free_tmacmds(), last_time, command_st::next, nl_error, read_a_tcmd(), tma_ifile::statename, yy_filename, and yy_lineno.

Referenced by tma_read_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static void synt_err ( char *  txt) [static]

Definition at line 19 of file tma_file.c.

References nl_error, yy_filename, and yy_lineno.

Referenced by buffer_char(), read_a_cmd(), read_a_tcmd(), tma_strdup(), and yylex().

Here is the caller graph for this function:

void tma_read_file ( tma_ifile ifilespec)
static int tma_strdup ( command_t **  ptr,
const char *  str,
command_t next 
) [static]

Definition at line 175 of file tma_file.c.

References command_st::cmd, command_st::next, and synt_err().

Referenced by read_a_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

static int yylex ( FILE *  fp) [static]

Definition at line 78 of file tma_file.c.

References BEGIN_BUFFER, BUFFER_CHAR, END_BUFFER, KW_AND, KW_ELSE, KW_HOLD, KW_OR, KW_RESUME, KW_VALIDATE, synt_err(), TK_EOF, TK_ERR, TK_NAME, TK_NUMBER, TK_QSTR, TK_TMCCMD, yy_lineno, yy_text, yy_val, and yyunlexed.

Here is the call graph for this function:

static void yyunlex ( int  token) [static]

Definition at line 72 of file tma_file.c.

References nl_error, and yyunlexed.

Referenced by read_a_tcmd().

Here is the caller graph for this function:


Variable Documentation

long int last_time [static]

Definition at line 208 of file tma_file.c.

Referenced by read_a_tcmd(), and read_tmafile().

int lexbufpos [static]

Definition at line 37 of file tma_file.c.

Referenced by buffer_char().

int lexbufsize [static]

Definition at line 36 of file tma_file.c.

Referenced by buffer_char().

char rcsid_tma_file_c[] = "$Header: /cvsroot/arp-das/QNX6/tmlib/src/tma_file.c,v 1.2 2009/11/18 20:46:18 ntallen Exp $"

Definition at line 11 of file tma_file.c.

const char* yy_filename [static]

Definition at line 14 of file tma_file.c.

Referenced by read_tmafile(), and synt_err().

int yy_lineno [static]

Definition at line 15 of file tma_file.c.

Referenced by read_tmafile(), synt_err(), and yylex().

char* yy_text [static]

Definition at line 16 of file tma_file.c.

Referenced by buffer_char(), read_a_cmd(), and yylex().

long int yy_val [static]

Definition at line 17 of file tma_file.c.

Referenced by read_a_cmd(), read_a_tcmd(), and yylex().

int yyunlexed = 0 [static]

Definition at line 71 of file tma_file.c.

Referenced by yylex(), and yyunlex().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines