Main Page | Class List | File List | Class Members | File Members | Related Pages

# /home/src/PHP-JAVA-BRIDGE/PHP5/php-java-bridge/parser.c File Reference

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
`#include <errno.h>`
`#include "php_java.h"`
`#include "parser.h"`

## Defines
#define | APPEND(c)
#define | PUSH(t)
#define | RESET()
#define | CALL_BEGIN()
#define | CALL_END()
## Functions
short | parse (proxyenv *env, parser_cb_t *cb)
short | parse_header (proxyenv *env, parser_cb_t *cb)

## Define Documentation

#define APPEND | ( | c |  | ) |

| Value:
    { \
      if(i>=(*env)->len-1) { \
        unsigned char* s1=realloc(s, (*env)->len*=2); \
        if(!s1) exit(9); else s=(*env)->s=s1; \
      } \
      s[i++]=c; \
    }

#define CALL_BEGIN | (
|  | ) |

| Value:
    { \
      if(cb->begin) (*cb->begin)(tag, cb); \
    }

#define CALL_END | (
|  | ) |

| Value:
    { \
      if(cb->end) (*cb->end)(tag[0].strings, cb); \
    }

#define PUSH | ( | t |  | ) |

| Value:
    { \
      parser_string_t *str = tag[t].strings; \
      short n = tag[t].n; \
      assert((t!=0) || (t==0 && !tag[0].n)); \
      s[i]=0; \
      str[n].string=&((*env)->s); \
      str[n].off=i0; \
      str[n].length=i-i0; \
      ++tag[t].n; \
      APPEND(0); \
      i0=i; \
    }

#define RESET | (
|  | ) |

| Value:
    { \
      type=VOJD;\
      level=0; \
      eor=0; \
      blen=0; \
      in_dquote=0; \
      i=0; \
      i0=0; \
      (*env)->c=0; (*env)->pos=0; \
    }

## Function Documentation

short parse | ( | proxyenv * | env,
|  | parser_cb_t * | cb
| ) |

short parse_header | ( | proxyenv * | env,
|  | parser_cb_t * | cb
| ) |