Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

sal.h File Reference


Detailed Description

Public header for the SQL abstraction layer.

>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <hiker/types.h>
#include <hiker/sysclass.h>

Go to the source code of this file.

Defines

#define ALP_SAL_H_   1
#define ALP_STATUS_SAL_BUSY   (ALP_CLASS_SAL | 0x00010000)
#define ALP_STATUS_SAL_LOCKED   (ALP_CLASS_SAL | 0x00020000)
#define ALP_STATUS_SAL_NOMEM   (ALP_CLASS_SAL | 0x00030000)
#define ALP_STATUS_SAL_READONLY   (ALP_CLASS_SAL | 0x00040000)
#define ALP_STATUS_SAL_INTERRUPT   (ALP_CLASS_SAL | 0x00050000)
#define ALP_STATUS_SAL_IOERR   (ALP_CLASS_SAL | 0x00060000)
#define ALP_STATUS_SAL_CORRUPT   (ALP_CLASS_SAL | 0x00070000)
#define ALP_STATUS_SAL_FULL   (ALP_CLASS_SAL | 0x00080000)
#define ALP_STATUS_SAL_CANTOPEN   (ALP_CLASS_SAL | 0x00090000)
#define ALP_STATUS_SAL_TOOBIG   (ALP_CLASS_SAL | 0x000A0000)
#define ALP_STATUS_SAL_CONSTRAINT   (ALP_CLASS_SAL | 0x000B0000)
#define ALP_STATUS_SAL_MISMATCH   (ALP_CLASS_SAL | 0x000C0000)
#define ALP_STATUS_SAL_AUTH   (ALP_CLASS_SAL | 0x000D0000)
#define ALP_STATUS_SAL_ERROR   (ALP_CLASS_SAL | 0x000E0000)
#define ALP_STATUS_SAL_MISUSE   (ALP_CLASS_SAL | 0x000F0000)
#define ALP_STATUS_SAL_NOLFS   (ALP_CLASS_SAL | 0x00100000)
#define ALP_STATUS_SAL_PROTOCOL   (ALP_CLASS_SAL | 0x00110000)
#define ALP_STATUS_SAL_EMPTY   (ALP_CLASS_SAL | 0x00120000)
#define ALP_STATUS_SAL_SCHEMA   (ALP_CLASS_SAL | 0x00130000)
#define ALP_STATUS_SAL_NOTFOUND   (ALP_CLASS_SAL | 0x00140000)
#define ALP_STATUS_SAL_INTERNAL   (ALP_CLASS_SAL | 0x00150000)
#define ALP_STATUS_SAL_PERM   (ALP_CLASS_SAL | 0x00160000)
#define ALP_STATUS_SAL_ABORT   (ALP_CLASS_SAL | 0x00170000)
#define ALP_STATUS_SAL_UNKNOWN   (ALP_CLASS_SAL | 0x00180000)
#define ALP_STATUS_SAL_BADPARAM   (ALP_CLASS_SAL | 0x00190000)
#define ALP_STATUS_SAL_NORECORDS   (ALP_CLASS_SAL | 0x001A0000)
#define ALP_STATUS_SAL_DMLEXISTS   (ALP_CLASS_SAL | 0x001B0000)

Typedefs

typedef void * AlpSALHandle
typedef void * AlpSALStatement

Functions

alp_status_t alp_sal_database_open (AlpSALHandle *sal, const char *dbName)
alp_status_t alp_sal_database_close (AlpSALHandle sal)
alp_status_t alp_sal_database_create (const char *dbFileName, const char *schemaFileName)
alp_status_t alp_sal_transaction_commit (AlpSALHandle sal)
alp_status_t alp_sal_transaction_begin (AlpSALHandle sal, char exclusive)
alp_status_t alp_sal_transaction_rollback (AlpSALHandle sal)
alp_status_t alp_sal_sql_execute (AlpSALHandle sal, const char *sql,...)
alp_status_t alp_sal_last_insert_rowid (AlpSALHandle sal, uint32_t *rowID)
alp_status_t alp_sal_execute_sql_script (AlpSALHandle sal, FILE *fd)
alp_status_t alp_sal_sql_get_value (AlpSALHandle sal, int32_t *value, const char *sql,...)
const char * alp_sal_get_error_message (AlpSALHandle sal)
alp_status_t alp_sal_string_build (char **combined, const char *sql,...)
void alp_sal_string_destroy (char *s)
alp_status_t alp_sal_statement_initialize (AlpSALHandle sal, AlpSALStatement **stmt, const char *sql)
AlpSALHandle alp_sal_statement_get_handle (AlpSALStatement *stmt)
alp_status_t alp_sal_statement_set_text (AlpSALStatement *stmt, int16_t pos, const char *s, bool copy)
alp_status_t alp_sal_statement_set_int (AlpSALStatement *stmt, int16_t pos, int32_t n)
alp_status_t alp_sal_statement_set_int64 (AlpSALStatement *stmt, int16_t pos, int64_t n)
alp_status_t alp_sal_statement_set_blob (AlpSALStatement *stmt, int16_t pos, void *blob, int32_t size, bool copy)
alp_status_t alp_sal_statement_set_float (AlpSALStatement *stmt, int16_t pos, float f)
int32_t alp_sal_statement_get_int (AlpSALStatement *stmt, int pos)
int64_t alp_sal_statement_get_int64 (AlpSALStatement *stmt, int pos)
float alp_sal_statement_get_float (AlpSALStatement *stmt, int pos)
char * alp_sal_statement_get_text (AlpSALStatement *stmt, int pos, bool copy)
void * alp_sal_statement_get_blob (AlpSALStatement *stmt, int pos, int32_t *size, bool copy)
bool alp_sal_statement_is_null (AlpSALStatement *stmt, int pos)
alp_status_t alp_sal_statement_execute (AlpSALStatement *stmt)
alp_status_t alp_sal_statement_destroy (AlpSALStatement *stmt)
alp_status_t alp_sal_statement_next_result (AlpSALStatement *stmt)
alp_status_t alp_sal_statement_reset (AlpSALStatement *stmt)


Typedef Documentation

typedef void* AlpSALHandle
 

The AlpSALHandle must be passed around as a reference to the database


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4