GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-f63024f571
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

◆ sqpAssignment()

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

Definition at line 161 of file sql.c.

◆ sqpColumn()

void sqpColumn ( char *  col)

Definition at line 101 of file sql.c.

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

◆ sqpColumnDef()

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

Definition at line 113 of file sql.c.

◆ sqpCommand()

void sqpCommand ( int  command)

Definition at line 89 of file sql.c.

References SQLPSTMT::command, and sqlpStmt.

◆ sqpCopyValue()

void sqpCopyValue ( SQLPVALUE from,
SQLPVALUE to 
)

Definition at line 60 of file sql.c.

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

◆ sqpFreeNode()

void sqpFreeNode ( SQLPNODE np)

◆ sqpInitParser()

◆ sqpInitValue()

void sqpInitValue ( SQLPVALUE val)

Definition at line 52 of file sql.c.

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

◆ sqpNewColumnNode()

SQLPNODE* sqpNewColumnNode ( char *  name)

Definition at line 230 of file sql.c.

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

◆ sqpNewExpressionNode()

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

◆ sqpNewNode()

SQLPNODE* sqpNewNode ( void  )

Definition at line 208 of file sql.c.

Referenced by sqpNewColumnNode(), and sqpNewExpressionNode().

◆ sqpNewValueNode()

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

Definition at line 242 of file sql.c.

◆ sqpOperatorCode()

int sqpOperatorCode ( char *  oper)

Definition at line 279 of file sql.c.

◆ sqpOperatorName()

char* sqpOperatorName ( int  oper)

◆ sqpOrderColumn()

void sqpOrderColumn ( char *  col,
int  dir 
)

Definition at line 199 of file sql.c.

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

◆ sqpSaveStr()

int sqpSaveStr ( SQLPVALUE val,
char *  c 
)

Definition at line 40 of file sql.c.

Referenced by sqpColumn().

◆ sqpTable()

void sqpTable ( char *  tbl)

Definition at line 95 of file sql.c.

References SQLP_MAX_TABLE, sqlpStmt, and SQLPSTMT::table.

◆ sqpValue()

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

Definition at line 128 of file sql.c.

Variable Documentation

◆ sqlpStmt

SQLPSTMT* sqlpStmt

Definition at line 37 of file sql.c.

Referenced by sqpColumn(), sqpCommand(), sqpInitParser(), sqpOrderColumn(), sqpPrintStmt(), and sqpTable().