YAZ  5.34.0
Functions
cql2ccl.c File Reference

Implements CQL to CCL 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 int cql_to_ccl_r (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
 
static void pr_term (const char **cpp, int stop_at_space, void(*pr)(const char *buf, void *client_data), void *client_data)
 
static int node (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
 
static int bool (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
 
int cql_to_ccl (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
 converts CQL tree to CCL and writes to user-defined stream More...
 
void cql_to_ccl_stdio (struct cql_node *cn, FILE *f)
 converts CQL tree to CCL and writes to file More...
 
int cql_to_ccl_buf (struct cql_node *cn, char *out, int max)
 converts CQL tree to CCL and writes result to buffer More...
 

Detailed Description

Implements CQL to CCL conversion.

Definition in file cql2ccl.c.

Function Documentation

◆ bool()

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

◆ cql_to_ccl()

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

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

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

Definition at line 249 of file cql2ccl.c.

References cql_to_ccl_r().

Referenced by cql_to_ccl_buf(), and cql_to_ccl_stdio().

◆ cql_to_ccl_buf()

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

converts CQL tree to CCL and writes result to buffer

Parameters
cnCQL node (tree)
outbuffer
maxsize of buffer (max chars to write)
Return values
0OK
-1conversion error
-2buffer too small (truncated)

Definition at line 261 of file cql2ccl.c.

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

◆ cql_to_ccl_r()

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

Definition at line 230 of file cql2ccl.c.

References bool(), CQL_NODE_BOOL, CQL_NODE_SORT, CQL_NODE_ST, node(), cql_node::sort, cql_node::u, and cql_node::which.

Referenced by bool(), and cql_to_ccl().

◆ cql_to_ccl_stdio()

void cql_to_ccl_stdio ( struct cql_node cn,
FILE *  f 
)

converts CQL tree to CCL and writes to file

Parameters
cnCQL node (tree)
ffile handle

Definition at line 256 of file cql2ccl.c.

References cql_fputs(), and cql_to_ccl().

◆ node()

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

◆ pr_term()

static void pr_term ( const char **  cpp,
int  stop_at_space,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data 
)
static

Definition at line 23 of file cql2ccl.c.

Referenced by node().