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_to_xml_r (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data, int level)
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
void cql_to_xml_stdio (struct cql_node *cn, FILE *f)
 converts CQL tree to XCQL and writes to file
void cql_buf_write_handler (const char *b, void *client_data)
 Handler for cql_buf_write_info.
int cql_to_xml_buf (struct cql_node *cn, char *out, int max)
 converts CQL tree to XCQL and writes result to buffer

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 
)
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:
cn CQL node (tree)
pr print function
client_data data to be passed to pr function

Definition at line 205 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:
cn CQL node (tree)
out buffer
max size of buffer (max chars to write)
Returns:
length of resulting buffer

Definition at line 230 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 88 of file xcqlutil.c.

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

Referenced by 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 
) [static]
void cql_to_xml_stdio ( struct cql_node cn,
FILE *  f 
)

converts CQL tree to XCQL and writes to file

Parameters:
cn CQL node (tree)
f file handle

Definition at line 212 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 27 of file xcqlutil.c.

Referenced by 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 17 of file xcqlutil.c.

Referenced by 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 55 of file xcqlutil.c.

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

Referenced by cql_to_xml_r().

Generated on Tue Aug 17 13:13:20 2010 for YAZ by  doxygen 1.6.3