GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71785
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sql.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <grass/sqlp.h>
Include dependency graph for sql.c:

Go to the source code of this file.

Functions

int sqpSaveStr (SQLPVALUE *val, char *c)
 
void sqpInitValue (SQLPVALUE *val)
 
void sqpCopyValue (SQLPVALUE *from, SQLPVALUE *to)
 
int sqpInitParser (SQLPSTMT *st)
 
void sqpCommand (int command)
 
void sqpTable (char *tbl)
 
void sqpColumn (char *col)
 
void sqpColumnDef (char *col, int type, int width, int decimals)
 
void sqpValue (char *strval, int intval, double dblval, int type)
 
void sqpAssignment (char *col, char *strval, int intval, double dblval, SQLPNODE *expval, int type)
 
void sqpOrderColumn (char *col, int dir)
 
SQLPNODEsqpNewNode (void)
 
SQLPNODEsqpNewExpressionNode (int oper, SQLPNODE *left, SQLPNODE *right)
 
SQLPNODEsqpNewColumnNode (char *name)
 
SQLPNODEsqpNewValueNode (char *strval, int intval, double dblval, int type)
 
void sqpFreeNode (SQLPNODE *np)
 
int sqpOperatorCode (char *oper)
 
char * sqpOperatorName (int oper)
 

Variables

SQLPSTMTsqlpStmt
 

Function Documentation

void sqpAssignment ( char *  col,
char *  strval,
int  intval,
double  dblval,
SQLPNODE expval,
int  type 
)
void sqpColumn ( char *  col)

Definition at line 102 of file sql.c.

References SQLPSTMT::Col, SQLPSTMT::nCol, sqpAllocCol(), and sqpSaveStr().

Referenced by yyparse().

void sqpColumnDef ( char *  col,
int  type,
int  width,
int  decimals 
)
void sqpCommand ( int  command)

Definition at line 90 of file sql.c.

References SQLPSTMT::command.

Referenced by yyparse().

void sqpCopyValue ( SQLPVALUE from,
SQLPVALUE to 
)

Definition at line 61 of file sql.c.

References SQLPVALUE::d, free(), SQLPVALUE::i, SQLPVALUE::s, and SQLPVALUE::type.

void sqpFreeNode ( SQLPNODE np)

Definition at line 260 of file sql.c.

References sqlpnode::column_name, free(), sqlpnode::left, sqlpnode::right, SQLPVALUE::s, and sqlpnode::value.

Referenced by sqpFreeStmt().

void sqpInitValue ( SQLPVALUE val)

Definition at line 53 of file sql.c.

References SQLPVALUE::d, SQLPVALUE::i, NULL, SQLPVALUE::s, SQLP_NULL, and SQLPVALUE::type.

SQLPNODE* sqpNewColumnNode ( char *  name)

Definition at line 231 of file sql.c.

References sqlpnode::column_name, sqlpnode::node_type, SQLP_NODE_COLUMN, and sqpNewNode().

Referenced by yyparse().

SQLPNODE* sqpNewExpressionNode ( int  oper,
SQLPNODE left,
SQLPNODE right 
)

Definition at line 217 of file sql.c.

References sqlpnode::left, sqlpnode::node_type, sqlpnode::oper, sqlpnode::right, SQLP_NODE_EXPRESSION, and sqpNewNode().

Referenced by yyparse().

SQLPNODE* sqpNewNode ( void  )

Definition at line 209 of file sql.c.

Referenced by sqpNewColumnNode(), sqpNewExpressionNode(), and sqpNewValueNode().

SQLPNODE* sqpNewValueNode ( char *  strval,
int  intval,
double  dblval,
int  type 
)
int sqpOperatorCode ( char *  oper)

Definition at line 280 of file sql.c.

References free(), SQLP_ADD, SQLP_AND, SQLP_DIV, SQLP_EQ, SQLP_GE, SQLP_GT, SQLP_LE, SQLP_LT, SQLP_MLTP, SQLP_MTCH, SQLP_NE, SQLP_NOT, SQLP_OR, and SQLP_SUBTR.

Referenced by yyparse().

char* sqpOperatorName ( int  oper)
void sqpOrderColumn ( char *  col,
int  dir 
)

Definition at line 200 of file sql.c.

References SQLPSTMT::orderCol, and SQLPSTMT::orderDir.

Referenced by yyparse().

int sqpSaveStr ( SQLPVALUE val,
char *  c 
)

Definition at line 41 of file sql.c.

References SQLPVALUE::s.

Referenced by sqpAssignment(), sqpColumn(), sqpColumnDef(), and sqpValue().

void sqpTable ( char *  tbl)

Definition at line 96 of file sql.c.

References SQLP_MAX_TABLE, and SQLPSTMT::table.

Referenced by yyparse().

void sqpValue ( char *  strval,
int  intval,
double  dblval,
int  type 
)

Variable Documentation

SQLPSTMT* sqlpStmt

Definition at line 38 of file sql.c.

Referenced by sqpPrintStmt(), and yyparse().