~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/libjpeg_turbo/yasm/source/patched-yasm/tools/re2c/scanner.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _scanner_h
2
 
#define _scanner_h
3
 
 
4
 
#include <stdio.h>
5
 
#include "tools/re2c/token.h"
6
 
 
7
 
typedef struct Scanner {
8
 
    FILE                *in;
9
 
    unsigned char       *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
10
 
    unsigned int        tchar, tline, cline;
11
 
} Scanner;
12
 
 
13
 
void Scanner_init(Scanner*, FILE *);
14
 
static Scanner *Scanner_new(FILE *);
15
 
 
16
 
int Scanner_echo(Scanner*, FILE *);
17
 
int Scanner_scan(Scanner*);
18
 
void Scanner_fatal(Scanner*, const char*);
19
 
static SubStr Scanner_token(Scanner*);
20
 
static unsigned int Scanner_line(Scanner*);
21
 
 
22
 
static SubStr
23
 
Scanner_token(Scanner *s)
24
 
{
25
 
    SubStr r;
26
 
    SubStr_init_u(&r, s->tok, s->cur - s->tok);
27
 
    return r;
28
 
}
29
 
 
30
 
static unsigned int
31
 
Scanner_line(Scanner *s)
32
 
{
33
 
    return s->cline;
34
 
}
35
 
 
36
 
static Scanner *
37
 
Scanner_new(FILE *i)
38
 
{
39
 
    Scanner *r = malloc(sizeof(Scanner));
40
 
    Scanner_init(r, i);
41
 
    return r;
42
 
}
43
 
 
44
 
#endif