YAZ  5.23.1
Functions
xcqlutil.c File Reference

Implements CQL to XCQL conversion. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <yaz/cql.h>

Go to the source code of this file.

Functions

static void pr_n (const char *buf, void(*pr)(const char *buf, void *client_data), void *client_data, int n)
 
static void pr_cdata (const char *buf, void(*pr)(const char *buf, void *client_data), void *client_data)
 
static void prefixes (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data, int level)
 
static void cql_to_xml_mod (struct cql_node *m, void(*pr)(const char *buf, void *client_data), void *client_data, int level)
 
static void cql_sort_to_xml (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data, int level)
 
static void cql_to_xml_r (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data, int level, struct cql_node *sort_node)
 
void cql_to_xml (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
 converts CQL tree to XCQL and writes to user-defined stream More...
 
void cql_to_xml_stdio (struct cql_node *cn, FILE *f)
 converts CQL tree to XCQL and writes to file More...
 
void cql_buf_write_handler (const char *b, void *client_data)
 Handler for cql_buf_write_info. More...
 
int cql_to_xml_buf (struct cql_node *cn, char *out, int max)
 converts CQL tree to XCQL and writes result to buffer More...
 

Detailed Description

Implements CQL to XCQL conversion.

Definition in file xcqlutil.c.

Function Documentation

void cql_buf_write_handler ( const char *  b,
void *  client_data 
)
static void cql_sort_to_xml ( struct cql_node cn,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
int  level 
)
static

Definition at line 121 of file xcqlutil.c.

References cql_to_xml_mod(), pr_cdata(), pr_n(), cql_node::sort, and cql_node::u.

Referenced by cql_to_xml_r().

void cql_to_xml ( struct cql_node cn,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data 
)

converts CQL tree to XCQL and writes to user-defined stream

Parameters
cnCQL node (tree)
prprint function
client_datadata to be passed to pr function

Definition at line 239 of file xcqlutil.c.

References cql_to_xml_r().

Referenced by cql_to_xml_buf(), and cql_to_xml_stdio().

int cql_to_xml_buf ( struct cql_node cn,
char *  out,
int  max 
)

converts CQL tree to XCQL and writes result to buffer

Parameters
cnCQL node (tree)
outbuffer
maxsize of buffer (max chars to write)
Returns
length of resulting buffer

Definition at line 264 of file xcqlutil.c.

References cql_buf_write_info::buf, cql_buf_write_handler(), cql_to_xml(), cql_buf_write_info::max, and cql_buf_write_info::off.

static void cql_to_xml_mod ( struct cql_node m,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
int  level 
)
static

Definition at line 90 of file xcqlutil.c.

References pr_cdata(), pr_n(), cql_node::st, and cql_node::u.

Referenced by cql_sort_to_xml(), and cql_to_xml_r().

static void cql_to_xml_r ( struct cql_node cn,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
int  level,
struct cql_node sort_node 
)
static
void cql_to_xml_stdio ( struct cql_node cn,
FILE *  f 
)

converts CQL tree to XCQL and writes to file

Parameters
cnCQL node (tree)
ffile handle

Definition at line 246 of file xcqlutil.c.

References cql_fputs(), and cql_to_xml().

static void pr_cdata ( const char *  buf,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data 
)
static

Definition at line 29 of file xcqlutil.c.

Referenced by cql_sort_to_xml(), cql_to_xml_mod(), cql_to_xml_r(), and prefixes().

static void pr_n ( const char *  buf,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
int  n 
)
static

Definition at line 19 of file xcqlutil.c.

Referenced by cql_sort_to_xml(), cql_to_xml_mod(), cql_to_xml_r(), and prefixes().

static void prefixes ( struct cql_node cn,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
int  level 
)
static

Definition at line 57 of file xcqlutil.c.

References pr_cdata(), pr_n(), cql_node::st, and cql_node::u.

Referenced by cql_to_xml_r().