query_parser.c File Reference
`#include <strings.h>`
`#include <stdio.h>`
`#include <assert.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <stdint.h>`
`#include "query_parser.h"`

## Macros

#define | FCGI_stdout stdout
#define | FCGI_stderr stderr
#define | logstream stderr
#define | MAX_LENOFFIELDNAME 10
| maximum length of field name
#define | MAX_LENOFFIELDVAL 128
| maximum length of field value

## Functions

query_param_t * | get_initquery (void)
| Get initialized query parameters.
char * | get_fieldparam (const char *stringptr, char *fieldname, char *fieldval)
void | parse_cclose (char *src, query_param_t *query_param)
void | parse_metareq (char *field, query_param_t *query_param)
void | parse_comps (char *field, query_param_t *query_param)
query_param_t * | parse_query (const char *query_string)
| parse query
void | print_queryparam (query_param_t query_param)
| print query parameters
void | parse_req_box_prop (char *req_box_prop, int idx, query_param_t *query_param)
void | delete_query (query_param_t **query)
| delete query

## Macro Definition Documentation

## FCGI_stderr

#define FCGI_stderr stderr

## FCGI_stdout

#define FCGI_stdout stdout

## logstream

#define logstream stderr

## MAX_LENOFFIELDNAME

#define MAX_LENOFFIELDNAME 10

maximum length of field name

Referenced by parse_query().

## MAX_LENOFFIELDVAL

#define MAX_LENOFFIELDVAL 128

maximum length of field value

Referenced by parse_query().

## Function Documentation

## delete_query()

void delete_query | ( | query_param_t ** | query | ) |

delete query

Parameters

  [in] | query | address of the deleting query pointer

References opj_free().

## get_fieldparam()

char * get_fieldparam | ( | const char * | stringptr,
|  | char * | fieldname,
|  | char * | fieldval )

Referenced by parse_query().

## get_initquery()

query_param_t * get_initquery | ( | void |  | ) |

Get initialized query parameters.

Returns
  initial query parameters

References query_param::a, query_param::box_type, query_param::cclose, query_param::cid, query_param::cnew, query_param::comps, query_param::fx, query_param::fy, query_param::g, query_param::lastcomp, query_param::layers, query_param::len, query_param::limit, query_param::max_depth, MAX_NUMOFBOX, query_param::metadata_only, non, query_param::numOfcclose, OPJ_FALSE, opj_malloc(), query_param::priority, query_param::return_type, query_param::rh, query_param::root_bin, query_param::rw, query_param::rx, query_param::ry, query_param::s, query_param::target, query_param::tid, UNKNOWN, and query_param::w.

Referenced by parse_query().

## parse_cclose()

void parse_cclose | ( | char * | src,
|  | query_param_t * | query_param )

References query_param::cclose, and query_param::numOfcclose.

Referenced by parse_query().

## parse_comps()

void parse_comps | ( | char * | field,
|  | query_param_t * | query_param )

References query_param::comps, query_param::lastcomp, opj_calloc(), and OPJ_TRUE.

Referenced by parse_query().

## parse_metareq()

void parse_metareq | ( | char * | field,
|  | query_param_t * | query_param )

References query_param::max_depth, query_param::metadata_only, OPJ_TRUE, parse_req_box_prop(), and query_param::root_bin.

Referenced by parse_query().

## parse_query()

query_param_t * parse_query | ( | const char * | query_string | ) |

parse query

Parameters

  [in] | query_string | request query string

Returns
  pointer to query parameters

References query_param::box_type, query_param::cid, query_param::cnew, query_param::fx, query_param::fy, get_fieldparam(), get_initquery(), http, JPPstream, JPTstream, query_param::layers, query_param::len, MAX_LENOFFIELDNAME, MAX_LENOFFIELDVAL, parse_cclose(), parse_comps(), parse_metareq(), query_param::return_type, query_param::rh, query_param::rw, query_param::rx, query_param::ry, query_param::target, tcp, and query_param::tid.

## parse_req_box_prop()

void parse_req_box_prop | ( | char * | req_box_prop,
|  | int | idx,
|  | query_param_t * | query_param )

References query_param::a, query_param::box_type, query_param::g, query_param::limit, OPJ_TRUE, query_param::priority, query_param::s, and query_param::w.

Referenced by parse_metareq().

## print_queryparam()

void print_queryparam | ( | query_param_t | query_param | ) |

print query parameters

Parameters

  [in] | query_param | query parameters

References query_param::a, query_param::box_type, query_param::cclose, query_param::cid, query_param::cnew, query_param::comps, query_param::fx, query_param::fy, query_param::g, query_param::lastcomp, query_param::layers, query_param::len, query_param::limit, logstream, query_param::max_depth, MAX_NUMOFBOX, query_param::metadata_only, query_param::numOfcclose, query_param::priority, query_param::return_type, query_param::rh, query_param::root_bin, query_param::rw, query_param::rx, query_param::ry, query_param::s, query_param::target, query_param::tid, and query_param::w.