NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions | Variables
attributes.c File Reference
#include "common.h"
#include <ctype.h>
#include <freetds/test_assert.h>
+ Include dependency graph for attributes.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  lookup_int
 
struct  attribute
 

Macros

#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define TYPE(s)   { #s, s }
 
#define ATTR(s, t)   { #s, s, type_##t, NULL }
 
#define ATTR2(s, t, l)   { #s, s, type_##t, l }
 
#define SEP   " \t\n"
 
#define ATTR_PARAMS   const struct attribute *attr, int expected
 
#define TEST_FILE   "attributes.in"
 

Typedefs

typedef int(* get_attr_t) (const struct attribute *attr, int expected)
 

Enumerations

enum  test_type_t {
  type_INTEGER , type_UINTEGER , type_SMALLINT , type_LEN ,
  type_CHARP , type_DESC , type_VOIDP , type_INTEGER ,
  type_SMALLINT , type_LEN , type_CHARP , type_INTEGER ,
  type_UINTEGER , type_SMALLINT , type_LEN , type_CHARP ,
  type_DESC , type_VOIDP , type_INTEGER , type_SMALLINT ,
  type_LEN , type_CHARP
}
 

Functions

static void fatal (const char *msg,...)
 
static int get_int (const char *s)
 
static int lookup (const char *name, const struct lookup_int *table)
 
static const char * unlookup (int value, const struct lookup_int *table)
 
static const struct attributelookup_attr (const char *name)
 
static int get_attr_stmt (const struct attribute *attr, int expected)
 
int main (int argc, char *argv[])
 

Variables

static int g_result = 0
 
static unsigned int line_num
 
static struct lookup_int concurrency []
 
static struct lookup_int scrollable []
 
static struct lookup_int sensitivity []
 
static struct lookup_int cursor_type []
 
static struct lookup_int noscan []
 
static struct lookup_int retrieve_data []
 
static struct lookup_int simulate_cursor []
 
static struct lookup_int use_bookmarks []
 
static const struct attribute attributes []
 

Macro Definition Documentation

◆ ATTR

#define ATTR (   s,
  t 
)    { #s, s, type_##t, NULL }

◆ ATTR2

#define ATTR2 (   s,
  t,
 
)    { #s, s, type_##t, l }

◆ ATTR_PARAMS

#define ATTR_PARAMS   const struct attribute *attr, int expected

Definition at line 222 of file attributes.c.

◆ SEP

#define SEP   " \t\n"

Definition at line 220 of file attributes.c.

◆ TEST_FILE

#define TEST_FILE   "attributes.in"

◆ TYPE [1/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [2/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [3/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [4/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [5/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [6/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [7/8]

#define TYPE (   s)    { #s, s }

◆ TYPE [8/8]

#define TYPE (   s)    { #s, s }

Typedef Documentation

◆ get_attr_t

typedef int(* get_attr_t) (const struct attribute *attr, int expected)

Definition at line 223 of file attributes.c.

Enumeration Type Documentation

◆ test_type_t

Enumerator
type_INTEGER 
type_UINTEGER 
type_SMALLINT 
type_LEN 
type_CHARP 
type_DESC 
type_VOIDP 
type_INTEGER 
type_SMALLINT 
type_LEN 
type_CHARP 
type_INTEGER 
type_UINTEGER 
type_SMALLINT 
type_LEN 
type_CHARP 
type_DESC 
type_VOIDP 
type_INTEGER 
type_SMALLINT 
type_LEN 
type_CHARP 

Definition at line 146 of file attributes.c.

Function Documentation

◆ fatal()

static void fatal ( const char *  msg,
  ... 
)
static

Definition at line 18 of file attributes.c.

References exit().

Referenced by get_attr_stmt(), get_int(), lookup_attr(), and main().

◆ get_attr_stmt()

static int get_attr_stmt ( const struct attribute attr,
int  expected 
)
static

◆ get_int()

static int get_int ( const char *  s)
static

Definition at line 30 of file attributes.c.

References fatal(), and line_num.

Referenced by lookup(), and main().

◆ lookup()

static int lookup ( const char *  name,
const struct lookup_int table 
)
static

Definition at line 50 of file attributes.c.

References get_int(), util::strcmp(), and table.

Referenced by main().

◆ lookup_attr()

static const struct attribute* lookup_attr ( const char *  name)
static

Definition at line 207 of file attributes.c.

References attributes, fatal(), i, line_num, attribute::name, NULL, util::strcmp(), and TDS_VECTOR_SIZE.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ unlookup()

static const char* unlookup ( int  value,
const struct lookup_int table 
)
static

Definition at line 63 of file attributes.c.

Referenced by main().

Variable Documentation

◆ attributes

const struct attribute attributes[]
static

Definition at line 63 of file attributes.c.

Referenced by lookup_attr().

◆ concurrency

struct lookup_int concurrency[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY },
{ "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK },
{ "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER },
{ "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES },
{ NULL, 0 }
}
#define NULL
Definition: ncbistd.hpp:225
#define SQL_CONCUR_VALUES
Definition: sqlext.h:345
#define SQL_CONCUR_READ_ONLY
Definition: sqlext.h:342
#define SQL_CONCUR_LOCK
Definition: sqlext.h:343
#define SQL_CONCUR_ROWVER
Definition: sqlext.h:344

Definition at line 63 of file attributes.c.

◆ cursor_type

struct lookup_int cursor_type[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY },
{ "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC },
{ "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN },
{ "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC },
{ NULL, 0 }
}
#define SQL_CURSOR_FORWARD_ONLY
Definition: sqlext.h:349
#define SQL_CURSOR_KEYSET_DRIVEN
Definition: sqlext.h:350
#define SQL_CURSOR_DYNAMIC
Definition: sqlext.h:351
#define SQL_CURSOR_STATIC
Definition: sqlext.h:352

Definition at line 63 of file attributes.c.

◆ g_result

int g_result = 0
static

Definition at line 10 of file attributes.c.

Referenced by main().

◆ line_num

unsigned int line_num
static

Definition at line 11 of file attributes.c.

Referenced by get_attr_stmt(), get_int(), lookup_attr(), and main().

◆ noscan

struct lookup_int noscan[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF },
{ "SQL_NOSCAN_ON", SQL_NOSCAN_ON },
{ NULL, 0 }
}
#define SQL_NOSCAN_OFF
Definition: sqlext.h:325
#define SQL_NOSCAN_ON
Definition: sqlext.h:326

Definition at line 63 of file attributes.c.

◆ retrieve_data

struct lookup_int retrieve_data[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_RD_ON", SQL_RD_ON },
{ "SQL_RD_OFF", SQL_RD_OFF },
{ NULL, 0 }
}
#define SQL_RD_ON
Definition: sqlext.h:368
#define SQL_RD_OFF
Definition: sqlext.h:367

Definition at line 63 of file attributes.c.

◆ scrollable

struct lookup_int scrollable[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_NONSCROLLABLE", SQL_NONSCROLLABLE },
{ "SQL_SCROLLABLE", SQL_SCROLLABLE },
{ NULL, 0 }
}
#define SQL_SCROLLABLE
Definition: sql.h:94
#define SQL_NONSCROLLABLE
Definition: sql.h:93

Definition at line 63 of file attributes.c.

◆ sensitivity

struct lookup_int sensitivity[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_UNSPECIFIED", SQL_UNSPECIFIED },
{ "SQL_INSENSITIVE", SQL_INSENSITIVE },
{ "SQL_SENSITIVE", SQL_SENSITIVE },
{ NULL, 0 }
}
#define SQL_UNSPECIFIED
Definition: sql.h:189
#define SQL_INSENSITIVE
Definition: sql.h:190
#define SQL_SENSITIVE
Definition: sql.h:191

Definition at line 63 of file attributes.c.

◆ simulate_cursor

struct lookup_int simulate_cursor[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE },
{ "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE },
{ "SQL_SC_UNIQUE", SQL_SC_UNIQUE },
{ NULL, 0 }
}
#define SQL_SC_UNIQUE
Definition: sqlext.h:364
#define SQL_SC_TRY_UNIQUE
Definition: sqlext.h:363
#define SQL_SC_NON_UNIQUE
Definition: sqlext.h:362

Definition at line 63 of file attributes.c.

◆ use_bookmarks

struct lookup_int use_bookmarks[]
static
Initial value:
= {
#define TYPE(s)
{ "SQL_UB_OFF", SQL_UB_OFF },
{ "SQL_UB_VARIABLE", SQL_UB_VARIABLE },
{ "SQL_UB_FIXED", SQL_UB_FIXED },
{ NULL, 0 }
}
#define SQL_UB_OFF
Definition: sqlext.h:372
#define SQL_UB_FIXED
Definition: sqlext.h:378
#define SQL_UB_VARIABLE
Definition: sqlext.h:379

Definition at line 63 of file attributes.c.

Modified on Tue May 21 10:55:06 2024 by modify_doxy.py rev. 669887