Source: sqlguipart/db_components.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          db_components.h  -  description
                             -------------------
    begin                : Sun Jun 23 2002
    copyright            : (C) 2002 by 
    email                : 
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef COMPONENTS_H
#define COMPONENTS_H

//
// Structs for database, tables and resultsets:
//


// Columnes:
typedef
struct column{
	const char * name;          // column-name
	char * type;                // string, describing the column-type (depends on database).
	char pri;                   // 'Y' if column is primary-key, ' ' otherwise.
	const char * extra_flags;   // for attributes like INDEX, NOT NULL, AUTO_INC etc.
	struct column * next;       // pointer to the next column in list. last pointer in list must be a NULL-pointer.
} column_t;


// Tables:
typedef
struct table{
	const char * name;          // table-name
	int type;                   // table-type (reserved. should be 0)
	const char * type_n;        // name of the table type (reserved. should be '')
	column_t * column_list;     // pointer to the columnes in this table
	struct table * next;        // pointer to the next table in this database. last pointer in list must be a NULL-pointer.
} table_t;


// Databases:
typedef
struct base{
	const char * name;          // database-name
	table_t * table_list;       // pointer to the tables of this database
	struct base * next;         // pointer to the next database. last pointer in list must be a NULL-pointer.
} base_t;


//
// Result-Sets:
//

// Field in a row:
typedef
struct field{
	int length;                 // Length of the field.
	char * value;               // String-representation of the field-value.
	struct field * next;        // pointer to the next field in this row. last pointer in list must be a NULL-pointer.
} field_t;

// Row:
typedef
struct row{
	field_t * feld;             // pointer to the first field in this row. Must not be NULL!
	struct row * next;          // pointer to the next row in the resultset. last pointer in result-set must be a NULL-pointer.
} row_t;


#endif // COMPONENTS_H

Generated by: marcus on voyager on Mon Sep 16 15:31:33 2002, using kdoc 2.0a53.