SpatiaLite 4.3.0a

src/headers/spatialite/gaiaaux.h

Go to the documentation of this file.
00001 /* 
00002  gaiaaux.h -- Gaia common utility functions
00003   
00004  version 4.3, 2015 June 29
00005 
00006  Author: Sandro Furieri a.furieri@lqt.it
00007 
00008  ------------------------------------------------------------------------------
00009  
00010  Version: MPL 1.1/GPL 2.0/LGPL 2.1
00011  
00012  The contents of this file are subject to the Mozilla Public License Version
00013  1.1 (the "License"); you may not use this file except in compliance with
00014  the License. You may obtain a copy of the License at
00015  http://www.mozilla.org/MPL/
00016  
00017 Software distributed under the License is distributed on an "AS IS" basis,
00018 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00019 for the specific language governing rights and limitations under the
00020 License.
00021 
00022 The Original Code is the SpatiaLite library
00023 
00024 The Initial Developer of the Original Code is Alessandro Furieri
00025  
00026 Portions created by the Initial Developer are Copyright (C) 2008-2015
00027 the Initial Developer. All Rights Reserved.
00028 
00029 Contributor(s):
00030 
00031 Alternatively, the contents of this file may be used under the terms of
00032 either the GNU General Public License Version 2 or later (the "GPL"), or
00033 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00034 in which case the provisions of the GPL or the LGPL are applicable instead
00035 of those above. If you wish to allow use of your version of this file only
00036 under the terms of either the GPL or the LGPL, and not to allow others to
00037 use your version of this file under the terms of the MPL, indicate your
00038 decision by deleting the provisions above and replace them with the notice
00039 and other provisions required by the GPL or the LGPL. If you do not delete
00040 the provisions above, a recipient may use your version of this file under
00041 the terms of any one of the MPL, the GPL or the LGPL.
00042  
00043 */
00044 
00050 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00051 #ifdef DLL_EXPORT
00052 #define GAIAAUX_DECLARE __declspec(dllexport)
00053 #else
00054 #define GAIAAUX_DECLARE extern
00055 #endif
00056 #endif
00057 
00058 #ifndef _GAIAAUX_H
00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00060 #define _GAIAAUX_H
00061 #endif
00062 
00063 #ifdef __cplusplus
00064 extern "C"
00065 {
00066 #endif
00067 
00068 /* constants */
00070 #define GAIA_SQL_SINGLE_QUOTE   1001
00071 
00072 #define GAIA_SQL_DOUBLE_QUOTE   1002
00073 
00074 /* function prototypes */
00075 
00081     GAIAAUX_DECLARE const char *gaiaGetLocaleCharset (void);
00082 
00095     GAIAAUX_DECLARE int gaiaConvertCharset (char **buf, const char *fromCs,
00096                                             const char *toCs);
00097 
00110     GAIAAUX_DECLARE void *gaiaCreateUTF8Converter (const char *fromCS);
00111 
00120     GAIAAUX_DECLARE void gaiaFreeUTF8Converter (void *cvtCS);
00121 
00140     GAIAAUX_DECLARE char *gaiaConvertToUTF8 (void *cvtCS, const char *buf,
00141                                              int len, int *err);
00142 
00152     GAIAAUX_DECLARE int gaiaIsReservedSqliteName (const char *name);
00153 
00163     GAIAAUX_DECLARE int gaiaIsReservedSqlName (const char *name);
00164 
00174     GAIAAUX_DECLARE int gaiaIllegalSqlName (const char *name);
00175 
00190     GAIAAUX_DECLARE char *gaiaSingleQuotedSql (const char *value);
00191 
00206     GAIAAUX_DECLARE char *gaiaDoubleQuotedSql (const char *value);
00207 
00223     GAIAAUX_DECLARE char *gaiaQuotedSql (const char *value, int quote);
00224 
00239     GAIAAUX_DECLARE char *gaiaDequotedSql (const char *value);
00240 
00241 /*
00242 / DEPRECATED FUNCTION: gaiaCleanSqlString()
00243 / this function must not be used for any new project
00244 / it's still maintained for backward compatibility,
00245 / but will be probably removed in future versions
00246 */
00247 
00260     GAIAAUX_DECLARE void gaiaCleanSqlString (char *value);
00261 
00277     GAIAAUX_DECLARE void gaiaInsertIntoSqlLog (sqlite3 * sqlite,
00278                                                const char *user_agent,
00279                                                const char *utf8Sql,
00280                                                sqlite3_int64 * sqllog_pk);
00281 
00297     GAIAAUX_DECLARE void gaiaUpdateSqlLog (sqlite3 * sqlite,
00298                                            sqlite3_int64 sqllog_pk, int success,
00299                                            const char *errMsg);
00300 
00311     GAIAAUX_DECLARE void *gaiaCreateMD5Checksum (void);
00312 
00321     GAIAAUX_DECLARE void gaiaFreeMD5Checksum (void *md5);
00322 
00339     GAIAAUX_DECLARE void gaiaUpdateMD5Checksum (void *md5,
00340                                                 const unsigned char *blob,
00341                                                 int blob_len);
00342 
00361     GAIAAUX_DECLARE char *gaiaFinalizeMD5Checksum (void *md5);
00362 
00381     GAIAAUX_DECLARE int gaiaParseDMS (const char *dms, double *longitude,
00382                                       double *latitude);
00383 
00399     GAIAAUX_DECLARE char *gaiaConvertToDMS (double longitude, double latitude);
00400 
00415     GAIAAUX_DECLARE char *gaiaEncodeURL (const char *url);
00416 
00431     GAIAAUX_DECLARE char *gaiaDecodeURL (const char *encoded);
00432 
00447     GAIAAUX_DECLARE char *gaiaDirNameFromPath (const char *path);
00448 
00463     GAIAAUX_DECLARE char *gaiaFullFileNameFromPath (const char *path);
00464 
00479     GAIAAUX_DECLARE char *gaiaFileNameFromPath (const char *path);
00480 
00494     GAIAAUX_DECLARE char *gaiaFileExtFromPath (const char *path);
00495 
00496 #ifdef __cplusplus
00497 }
00498 #endif
00499 
00500 #endif                          /* _GAIAAUX_H */
 All Data Structures Files Functions Variables Typedefs Defines