~ubuntu-branches/ubuntu/intrepid/grass/intrepid

« back to all changes in this revision

Viewing changes to db/drivers/sqlite/index.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2008-04-06 17:08:21 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406170821-7l3d3ulh4g8crwcs
Tags: 6.2.3-2.1
* NMU during credativ BSP 2008
* using patch from Moritz Muehlenhoff <jmm@inutil.org> to fix
  FTBFS with GCC 4.3: missing #includes
  (closes: #461673)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***********************************************************
2
 
*
3
 
* MODULE:       SQLite driver 
4
 
*               
5
 
* AUTHOR(S):    Radim Blazek
6
 
*
7
 
* COPYRIGHT:    (C) 2005 by the GRASS Development Team
8
 
*
9
 
* This program is free software under the GNU General Public
10
 
* License (>=v2). Read the file COPYING that comes with GRASS
11
 
* for details.
12
 
*
13
 
**************************************************************/
 
1
/**
 
2
 * \file index.c
 
3
 *
 
4
 * \brief Low level SQLite database index functions.
 
5
 *
 
6
 * This program is free software under the GNU General Public License
 
7
 * (>=v2). Read the file COPYING that comes with GRASS for details.
 
8
 *
 
9
 * \author Radim Blazek
 
10
 *
 
11
 * \date 2005-2007
 
12
 */
 
13
 
14
14
#include <grass/dbmi.h>
15
15
#include "globals.h"
16
16
#include "proto.h"
17
17
 
 
18
 
 
19
/**
 
20
 * \fn int db__driver_create_index (dbIndex *index)
 
21
 *
 
22
 * \brief Create SQLite database index.
 
23
 *
 
24
 * \param[in] index index to be created
 
25
 * \return int DB_FAILED on error; DB_OK on success
 
26
 */
 
27
 
18
28
int
19
29
db__driver_create_index ( dbIndex *index )
20
30
{
21
31
    int i, ncols;
22
32
    sqlite3_stmt *statement;
23
33
    dbString sql;
24
 
    char  *rest;
 
34
    const char *rest;
25
35
    int   ret;
26
36
    
27
37
    G_debug (3, "db__create_index()");
61
71
        append_error( "Cannot create index:\n");
62
72
        append_error( db_get_string(&sql) );
63
73
        append_error( "\n" );
64
 
        append_error ( sqlite3_errmsg(sqlite) );
 
74
        append_error ((char *) sqlite3_errmsg (sqlite));
65
75
        report_error();
66
76
        sqlite3_finalize ( statement );
67
77
        db_free_string ( &sql);
73
83
    if ( ret != SQLITE_DONE )
74
84
    {
75
85
        append_error("Error in sqlite3_step():\n");
76
 
        append_error ( sqlite3_errmsg(sqlite) );
 
86
        append_error ((char *) sqlite3_errmsg (sqlite));
77
87
        report_error( );
78
88
        return DB_FAILED;
79
89
    }