Auxiliary/helper functions. More...
Go to the source code of this file.
Macros | |
| #define | GAIA_SQL_SINGLE_QUOTE 1001 |
| SQL single quoted string (text constant) | |
| #define | GAIA_SQL_DOUBLE_QUOTE 1002 |
| SQL double quoted string (SQL name) | |
Functions | |
| GAIAAUX_DECLARE const char * | gaiaGetLocaleCharset (void) |
| Retrieves the Locale Charset. | |
| GAIAAUX_DECLARE int | gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs) |
| Converts a text string from one charset to another. | |
| GAIAAUX_DECLARE void * | gaiaCreateUTF8Converter (const char *fromCS) |
| Creates a persistent UTF8 converter object. | |
| GAIAAUX_DECLARE void | gaiaFreeUTF8Converter (void *cvtCS) |
| Destroys an UTF8 converter object. | |
| GAIAAUX_DECLARE char * | gaiaConvertToUTF8 (void *cvtCS, const char *buf, int len, int *err) |
| Converts a text string to UTF8. | |
| GAIAAUX_DECLARE int | gaiaIsReservedSqliteName (const char *name) |
| Checks if a name is a reserved SQLite name. | |
| GAIAAUX_DECLARE int | gaiaIsReservedSqlName (const char *name) |
| Checks if a name is a reserved SQL name. | |
| GAIAAUX_DECLARE int | gaiaIllegalSqlName (const char *name) |
| Checks if a name is an illegal SQL name. | |
| GAIAAUX_DECLARE char * | gaiaSingleQuotedSql (const char *value) |
| Properly formats an SQL text constant. | |
| GAIAAUX_DECLARE char * | gaiaDoubleQuotedSql (const char *value) |
| Properly formats an SQL name. | |
| GAIAAUX_DECLARE char * | gaiaQuotedSql (const char *value, int quote) |
| Properly formats an SQL generic string. | |
| GAIAAUX_DECLARE char * | gaiaDequotedSql (const char *value) |
| Properly formats an SQL generic string (dequoting) | |
| GAIAAUX_DECLARE void | gaiaCleanSqlString (char *value) |
| deprecated function | |
| GAIAAUX_DECLARE void | gaiaInsertIntoSqlLog (sqlite3 *sqlite, const char *user_agent, const char *utf8Sql, sqlite3_int64 *sqllog_pk) |
| SQL log: statement start. | |
| GAIAAUX_DECLARE void | gaiaUpdateSqlLog (sqlite3 *sqlite, sqlite3_int64 sqllog_pk, int success, const char *errMsg) |
| SQL log: statement start. | |
Auxiliary/helper functions.
| GAIAAUX_DECLARE void gaiaCleanSqlString | ( | char * | value | ) |
deprecated function
| value | the string to be formatted |
| GAIAAUX_DECLARE int gaiaConvertCharset | ( | char ** | buf, |
| const char * | fromCs, | ||
| const char * | toCs | ||
| ) |
Converts a text string from one charset to another.
| buf | the text string to be converted |
| fromCs | the GNU ICONV name identifying the input charset |
| toCs | the GNU ICONV name identifying the output charset |
| GAIAAUX_DECLARE char* gaiaConvertToUTF8 | ( | void * | cvtCS, |
| const char * | buf, | ||
| int | len, | ||
| int * | err | ||
| ) |
Converts a text string to UTF8.
| cvtCS | the handle identifying the UTF8 convert object (returned by a previous call to gaiaCreateUTF8Converter). |
| buf | the input text string |
| len | length (in bytes) of input string |
| err | on completion will contain 0 on success, any other value on failure |
| GAIAAUX_DECLARE void* gaiaCreateUTF8Converter | ( | const char * | fromCS | ) |
Creates a persistent UTF8 converter object.
| fromCS | the GNU ICONV name identifying the input charset |
| GAIAAUX_DECLARE char* gaiaDequotedSql | ( | const char * | value | ) |
Properly formats an SQL generic string (dequoting)
| value | the string to be dequoted |
| GAIAAUX_DECLARE char* gaiaDoubleQuotedSql | ( | const char * | value | ) |
Properly formats an SQL name.
| value | the SQL name to be formatted |
| GAIAAUX_DECLARE void gaiaFreeUTF8Converter | ( | void * | cvtCS | ) |
Destroys an UTF8 converter object.
| cvtCS | the handle identifying the UTF8 convert object (returned by a previous call to gaiaCreateUTF8Converter). |
| GAIAAUX_DECLARE const char* gaiaGetLocaleCharset | ( | void | ) |
Retrieves the Locale Charset.
| GAIAAUX_DECLARE int gaiaIllegalSqlName | ( | const char * | name | ) |
Checks if a name is an illegal SQL name.
| name | the name to be checked |
| GAIAAUX_DECLARE void gaiaInsertIntoSqlLog | ( | sqlite3 * | sqlite, |
| const char * | user_agent, | ||
| const char * | utf8Sql, | ||
| sqlite3_int64 * | sqllog_pk | ||
| ) |
SQL log: statement start.
| sqlite | handle of the current DB connection |
| user_agent | name of the invoking application, e.g. "spatialite_gui" or "spatialite CLI" |
| utf8Sql | the SQL statement bein executed |
| sqllog_pk | after completion this variable will contain the value of the Primary Key identifying the corresponding Log event |
| GAIAAUX_DECLARE int gaiaIsReservedSqliteName | ( | const char * | name | ) |
Checks if a name is a reserved SQLite name.
| name | the name to be checked |
| GAIAAUX_DECLARE int gaiaIsReservedSqlName | ( | const char * | name | ) |
Checks if a name is a reserved SQL name.
| name | the name to be checked |
| GAIAAUX_DECLARE char* gaiaQuotedSql | ( | const char * | value, |
| int | quote | ||
| ) |
Properly formats an SQL generic string.
| value | the string to be formatted |
| quote | GAIA_SQL_SINGLE_QUOTE or GAIA_SQL_DOUBLE_QUOTE |
| GAIAAUX_DECLARE char* gaiaSingleQuotedSql | ( | const char * | value | ) |
Properly formats an SQL text constant.
| value | the text string to be formatted |
| GAIAAUX_DECLARE void gaiaUpdateSqlLog | ( | sqlite3 * | sqlite, |
| sqlite3_int64 | sqllog_pk, | ||
| int | success, | ||
| const char * | errMsg | ||
| ) |
SQL log: statement start.
| sqlite | handle of the current DB connection |
| sqllog_pk | the Primary Key identifying the corresponding Log event. expected to be exactely the same returned by the most recent call to gaiaInsertIntoSqlLog() |
| success | expected to be TRUE if the SQL statement was succesfully executed. |
| errMsg | expected to be the error message returned by SQLite on failure, NULL on success. |
1.8.1.1