Changeset 420 for trunk/Jgraph/token.c


Ignore:
Timestamp:
02/27/08 07:13:31 (16 years ago)
Author:
Nicholas Riley
Message:

Jgraph: my changes - ANSIfication, few minor bug fixes; works on OS X 10.5 now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jgraph/token.c

    r418 r420  
    88#include <math.h>
    99#include <stdio.h>
     10#include <string.h>
    1011
    1112#ifdef LCC
     
    3637static int getnew = 1;
    3738static char oldchar = '\0';
    38 static oldcharvalid = 0;
     39static int oldcharvalid = 0;
    3940static char pipe = 0;
    4041static int eof = 0;
     
    6162#endif /*VMS*/
    6263
    63 set_input_file(s)
    64 char *s;
    65 {
    66   FILE *f;
     64void set_input_file(char *s)
     65{
    6766  Iostack n;
    6867
     
    9493}
    9594
    96 error_header()
     95void error_header()
    9796{
    9897  fprintf(stderr, "%s,%d: ", FILENAME, line);
     
    107106}
    108107
    109 ungettokenchar()
     108void ungettokenchar()
    110109{
    111110  oldcharvalid = 1;
     
    132131}
    133132
    134 get_comment()
     133void get_comment()
    135134{
    136135  if (eof) return;
     
    149148}
    150149
    151 static push_iostack(p)
    152 int p;
     150static void push_iostack(int p)
    153151{
    154152  Iostack n;
     
    178176}
    179177
    180 static pop_iostack()
     178static void pop_iostack()
    181179{
    182180  Iostack n;
     
    196194    n->stream = fopen(n->filename, "r");
    197195    if (n->stream == NULL) {
    198       fprintf(stderr, "Error: cannot open file \"%s\"\n", n->stream);
     196      fprintf(stderr, "Error: cannot open file \"%s\"\n", n->filename);
    199197      exit(1);
    200198    }
     
    211209}
    212210
    213 static nexttoken()
     211int getsystemstring(void);
     212
     213static void nexttoken()
    214214{
    215215  if (eof) return;
     
    256256  }
    257257  getnew = 1;
    258   return;
    259 }
    260 
    261 int getstring(s)
    262 char *s;
     258}
     259
     260int getstring(char *s)
    263261{
    264262  nexttoken();
     
    268266}
    269267
    270 int getint(i)
    271 int *i;
     268int getint(int *i)
    272269{
    273270  int j;
     
    283280}
    284281
    285 int getfloat(f)
    286 float *f;
     282int getfloat(float *f)
    287283{
    288284  int j;
     
    335331{
    336332  char c;
    337   int i, j, done, len, started;
     333  int i, done, len, started;
    338334  char *out_str;
    339335
     
    375371char *getlabel()
    376372{
    377   char c;
    378373  char *txt, *new;
    379   int i;
    380374
    381375  txt = getmultiline();
     
    416410}
    417411
    418 rejecttoken()
     412void rejecttoken(void)
    419413{
    420414  getnew = 0;
Note: See TracChangeset for help on using the changeset viewer.