/usr/share/ada/adainclude/gnadesqlite3/gnu-db-sqlite3.ads is in libgnadesqlite3-2-dev 1.6.2-9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | -------------------------------------------------------------------------------
-- --
-- Filename : $Source: /cvsroot/gnade/gnade/dbi/sqlite3/gnu-db-sqlite3.ads,v $
-- Description : SQLite Base Package --
-- Author : Ching Bon Lam --
-- Created : 26.7.2003 --
-- Last Modified By: $Author: persan $ --
-- Last Modified On: $Date: 2007/09/07 21:09:51 $ --
-- Status : $State: Exp $ --
-- --
-- Copyright (C) 2003 Ching Bon Lam --
-- --
-- GNADE is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Functional Description --
-- ====================== --
-- Thick binding to sqlite (http://www.sqlite.org). --
-- --
-- Restrictions --
-- ============ --
-- None --
-- --
-- References --
-- ========== --
-- Sqlite homepage : http://www.sqlite.org --
-- --
-- Contact --
-- ======= --
-- Error reports shall be handled via http://gnade.sourceforge.net --
-- Features and ideas via: gnade-develop@lists.sourceforge.net --
-- --
-- Author contact: --
-- Ching Bon Lam <cblam@gmx.net> --
-- --
-------------------------------------------------------------------------------
with GNU.DB.Support.Wide_String_Tables;
with GNU.DB.Support.Wide_String_Vectors;
with GNU.DB.Support.String_Vectors;
with GNU.DB.Support.String_Tables;
package GNU.DB.SQLite3 is
use GNU.DB.Support;
type Object is tagged private;
type Handle is access all Object;
-- sqlite3.h:47
-- typedef struct sqlite3 sqlite3;
----------------------------------------------------------------------------
-- return values -----------------------------------------------------------
----------------------------------------------------------------------------
type Return_Value is (-- sqlite3.h:133-161
SQLITE_OK, -- Successful result
SQLITE_ERROR, -- SQL error or missing database
SQLITE_INTERNAL, -- An internal logic error in SQLite
SQLITE_PERM, -- Access permission denied
SQLITE_ABORT, -- Callback routine requested an abort
SQLITE_BUSY, -- The database file is locked
SQLITE_LOCKED, -- A table in the database is locked
SQLITE_NOMEM, -- A malloc() failed
SQLITE_READONLY, -- Attempt to write a readonly database
SQLITE_INTERRUPT, -- Operation terminated by sqlite3_interrupt()
SQLITE_IOERR, -- Some kind of disk I/O error occurred
SQLITE_CORRUPT, -- The database disk image is malformed
SQLITE_NOTFOUND, -- (Internal Only) Table or record not found
SQLITE_FULL, -- Insertion failed because database is full
SQLITE_CANTOPEN, -- Unable to open the database file
SQLITE_PROTOCOL, -- Database lock protocol error
SQLITE_EMPTY, -- Database is empty
SQLITE_SCHEMA, -- The database schema changed
SQLITE_TOOBIG, -- Too much data for one row of a table
SQLITE_CONSTRAINT, -- Abort due to contraint violation
SQLITE_MISMATCH, -- Data type mismatch
SQLITE_MISUSE, -- Library used incorrectly
SQLITE_NOLFS, -- Uses OS features not supported on host
SQLITE_AUTH, -- Authorization denied
SQLITE_FORMAT, -- Auxiliary database format error
SQLITE_RANGE, -- 2nd parameter to sqlite3_bind out of range
SQLITE_NOTADB, -- File opened that is not a database file
SQLITE_ROW, -- sqlite3_step() has another row ready
SQLITE_DONE, -- sqlite3_step() has finished executing
UNDEFINED_ERROR);
----------------------------------------------------------------------------
-- Other important types ---------------------------------------------------
----------------------------------------------------------------------------
type Statement is tagged private;
type Statement_Reference is access all Statement;
-- sqlite3.h:554
-- typedef struct sqlite3_stmt sqlite3_stmt;
type Uint64 is mod 2 ** 64;
type Int64 is
range -(2 ** (64 - 1)) ..
+(2 ** (64 - 1) - 1);
-- sqlite3.h:55
type Callback is access function
(Argc : Integer;
Argv : String_Vectors.Vector;
ColumnNames : String_Vectors.Vector)
return Return_Value;
type Callback16 is access function
(Argc : Integer;
Argv : Wide_String_Vectors.Vector;
ColumnNames : Wide_String_Vectors.Vector)
return Return_Value;
type Table_Reference is access all String_Tables.Vector;
type Table16_Reference is access all Wide_String_Tables.Vector;
----------------------------------------------------------------------------
-- Basic operations --------------------------------------------------------
----------------------------------------------------------------------------
function Close
(Self : access Object)
return Return_Value;
procedure Close (Self : access Object);
-- sqlite3.h:75
-- int sqlite3_close(sqlite3 *);
function Last_Insert_Rowid
(Self : access Object)
return Uint64;
-- sqlite3.h:172
-- sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
function Changes
(Self : access Object)
return Integer;
-- sqlite3.h:194
-- int sqlite3_changes(sqlite3*);
function Total_Changes
(Self : access Object)
return Integer;
-- sqlite3.h:212
-- int sqlite3_total_changes(sqlite3*);
procedure Interrupt
(Self : access Object);
-- sqlite3.h:220
-- void sqlite3_interrupt(sqlite3*);
function Complete
(Sql : String)
return Boolean;
-- sqlite3.h:233
-- int sqlite3_complete(const char *sql);
function Complete16
(Sql : Wide_String)
return Boolean;
-- sqlite3.h:234
-- int sqlite3_complete16(const void *sql);
function Open
(Self : access Object;
Filename : String)
return Return_Value;
procedure Open
(Self : access Object;
Filename : String);
-- sqlite3.h:504
-- int sqlite3_open(
-- const char *filename, /* Database filename (UTF-8) */
-- sqlite3 **ppDb /* OUT: SQLite db access Object */
-- );
function Open16
(Self : access Object;
Filename : Wide_String)
return Return_Value;
-- sqlite3.h:508
-- int sqlite3_open16(
-- const void *filename, /* Database filename (UTF-16) */
-- sqlite3 **ppDb /* OUT: SQLite db access Object */
-- );
----------------------------------------------------------------------------
-- Exec --------------------------------------------------------------------
----------------------------------------------------------------------------
generic
type Data_Type is private;
type Data_Handle is access all Data_Type;
package Generic_Exec is
type Callback is access function
(PArg : Data_Handle;
Argc : Integer;
Argv : String_Vectors.Vector;
ColumnNames : String_Vectors.Vector)
return Return_Value;
-- sqlite3.h:80
-- typedef int (*sqlite3_callback)(void*,int,char**, char**);
function Exec
(Self : access Object;
Sql : String;
Cb : Callback;
Arg : Data_Handle)
return Return_Value;
-- sqlite3.h:122
-- int sqlite3_exec(
-- sqlite3*, /* An open database */
-- const char *sql, /* SQL to be executed */
-- sqlite3_callback, /* Callback function */
-- void *, /* 1st argument to callback function */
-- char **errmsg /* Error msg written here */
-- );
end Generic_Exec;
generic
type Data_Type is private;
type Data_Handle is access all Data_Type;
package Generic_Exec16 is
type Callback16 is access function
(PArg : Data_Handle;
Argc : Integer;
Argv : Wide_String_Vectors.Vector;
ColumnNames : Wide_String_Vectors.Vector)
return Return_Value;
function Exec16
(Self : access Object;
Sql : Wide_String;
Cb : Callback16;
Arg : Data_Handle)
return Return_Value;
end Generic_Exec16;
function Exec
(Self : access Object;
Sql : String;
Cb : Callback)
return Return_Value;
procedure Exec
(Self : access Object;
Sql : String;
Cb : Callback);
function Exec16
(Self : access Object;
Sql : Wide_String;
Cb : Callback16)
return Return_Value;
function Exec
(Self : access Object;
Sql : String)
return Return_Value;
procedure Exec
(Self : access Object;
Sql : String);
function Exec16
(Self : access Object;
Sql : Wide_String)
return Return_Value;
----------------------------------------------------------------------------
-- Tables ------------------------------------------------------------------
----------------------------------------------------------------------------
function Get_Table
(Self : access Object;
Sql : String;
Table : Table_Reference)
return Return_Value;
function Get_Table16
(Self : access Object;
Sql : Wide_String;
Table : Table16_Reference)
return Return_Value;
function Row_Count
(Self : Table_Reference)
return Natural;
function Column_Count
(Self : Table_Reference;
Row : Natural)
return Natural;
function Element
(Self : Table_Reference;
Row : Natural;
Col : Natural)
return String;
function Element16
(Self : Table16_Reference;
Row : Natural;
Col : Natural)
return Wide_String;
----------------------------------------------------------------------------
-- Error stuff -------------------------------------------------------------
----------------------------------------------------------------------------
function Errcode
(Self : access Object)
return Integer;
-- sqlite3.h:528
-- int sqlite3_errcode(sqlite3 *db);
function Errmsg
(Self : access Object)
return String;
-- sqlite3.h:538
-- const char *sqlite3_errmsg(sqlite3*);
function Errmsg16
(Self : access Object)
return Wide_String;
-- sqlite3.h:548
-- const void *sqlite3_errmsg16(sqlite3*);
----------------------------------------------------------------------------
-- Stepping ----------------------------------------------------------------
----------------------------------------------------------------------------
SQLITE_INTEGER : constant Integer := 1;
SQLITE_FLOAT : constant Integer := 2;
SQLITE_TEXT : constant Integer := 3;
SQLITE_BLOB : constant Integer := 4;
SQLITE_NULL : constant Integer := 5;
function Prepare
(Self : access Object;
Sql : String;
Stmt : Statement_Reference)
return Return_Value;
procedure Prepare
(Self : access Object;
Sql : String;
Stmt : Statement_Reference);
-- sqlite3.h:581
-- int sqlite3_prepare(
-- sqlite3 *db, /* Database handle */
-- const char *zSql, /* SQL statement, UTF-8 encoded */
-- int nBytes, /* Length of zSql in bytes. */
-- sqlite3_stmt **ppStmt, /* OUT: Statement handle */
-- const char **pzTail /* OUT: Pointer to unused portion of zSql */
-- );
function Prepare16
(Self : access Object;
Sql : Wide_String;
Stmt : Statement_Reference)
return Return_Value;
-- sqlite3.h:588
-- int sqlite3_prepare16(
-- sqlite3 *db, /* Database handle */
-- const void *zSql, /* SQL statement, UTF-16 encoded */
-- int nBytes, /* Length of zSql in bytes. */
-- sqlite3_stmt **ppStmt, /* OUT: Statement handle */
-- const void **pzTail /* OUT: Pointer to unused portion of zSql */
-- );
-- generic
-- type Data_Type is private;
-- package Blob_Generic is
-- function Bind_Blob
-- (Stmt : Statement_Reference;
-- N : Integer;
-- B : Data_Type)
-- return Return_Value;
-- procedure Bind_Blob
-- (Stmt : Statement_Reference;
-- N : Integer;
-- B : Data_Type);
--
-- end Blob_Generic;
-- function bind_blob
-- (stmt : Statement_Reference;
-- N : integer;
-- B : something)
-- return Return_Value;
-- sqlite3.h:626
-- int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
function Bind_Double
(Stmt : access Statement;
N : Integer;
D : Long_Float)
return Return_Value;
-- sqlite3.h:627
-- int sqlite3_bind_double(sqlite3_stmt*, int, double);
function Bind_Int
(Stmt : access Statement;
N : Integer;
I : Integer)
return Return_Value;
-- sqlite3.h:628
-- int sqlite3_bind_int(sqlite3_stmt*, int, int);
function Bind_Int64
(Stmt : access Statement;
N : Integer;
I : Int64)
return Return_Value;
-- sqlite3.h:629
-- int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64);
function Bind_Null
(Stmt : access Statement;
N : Integer)
return Return_Value;
-- sqlite3.h:630
-- int sqlite3_bind_null(sqlite3_stmt*, int);
function Bind_Text
(Stmt : access Statement;
N : Integer;
T : String)
return Return_Value;
-- sqlite3.h:631
-- int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
function Bind_Text16
(Stmt : access Statement;
N : Integer;
T : Wide_String)
return Return_Value;
-- sqlite3.h:632
-- int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
-- function bind_value
-- (stmt : Statement_Reference;
-- N : integer;
-- V : Value)
-- return Return_Value;
-- sqlite3.h:633
-- int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
function Column_Count
(Stmt : access Statement)
return Integer;
-- sqlite3.h:661
-- int sqlite3_column_count(sqlite3_stmt *pStmt);
function Column_Name
(Stmt : access Statement;
ICol : Integer)
return String;
-- sqlite3.h:669
-- const char *sqlite3_column_name(sqlite3_stmt*,int);
function Column_Name16
(Stmt : access Statement;
ICol : Integer)
return Wide_String;
-- sqlite3.h:670
-- const void *sqlite3_column_name16(sqlite3_stmt*,int);
function Column_Decltype
(Stmt : access Statement;
ICol : Integer)
return String;
-- sqlite3.h:690
-- const char *sqlite3_column_decltype(sqlite3_stmt *, int i);
function Column_Decltype16
(Stmt : access Statement;
ICol : Integer)
return Wide_String;
-- sqlite3.h:710
-- const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
function Step
(Stmt : access Statement)
return Return_Value;
function Step
(Stmt : access Statement)
return Boolean;
procedure Step
(Stmt : access Statement);
-- sqlite3.h:744
-- int sqlite3_step(sqlite3_stmt*);
function Data_Count
(Stmt : access Statement)
return Integer;
-- sqlite3.h:755
-- int sqlite3_data_count(sqlite3_stmt *pStmt);
function Column_Int
(Stmt : access Statement;
ICol : Integer)
return Integer;
-- sqlite3.h:828
-- int sqlite3_column_int(sqlite3_stmt*, int iCol);
function Column_Text
(Stmt : access Statement;
ICol : Integer)
return String;
-- sqlite3.h:830
--const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
function Column_Text16
(Stmt : access Statement;
ICol : Integer)
return Wide_String;
-- sqlite3.h:831
--const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
function Column_Type
(Stmt : access Statement;
ICol : Integer)
return Integer;
-- sqlite3.h:832
-- int sqlite3_column_type(sqlite3_stmt*, int iCol);
function Finalize
(Stmt : access Statement)
return Return_Value;
procedure Finalize
(Stmt : access Statement);
-- sqlite3.h:848
-- int sqlite3_finalize(sqlite3_stmt *pStmt);
function Reset
(Stmt : access Statement)
return Return_Value;
-- sqlite3.h:857
-- int sqlite3_reset(sqlite3_stmt *pStmt);
----------------------------------------------------------------------------
-- PRIVATE -----------------------------------------------------------------
----------------------------------------------------------------------------
SQLITE_Exception : exception;
private
type DB_Type is limited null record;
type DB_Access is access all DB_Type;
for DB_Access'Storage_Size use 0;
pragma Convention (C, DB_Access);
type Object is tagged record
Db : aliased DB_Access;
end record;
-- sqlite3.h:47
-- typedef struct sqlite3 sqlite3;
type Stmt_Type is limited null record;
type Stmt_Access is access all Stmt_Type;
for Stmt_Access'Storage_Size use 0;
pragma Convention (C, Stmt_Access);
type Statement is tagged record
Stmt : aliased Stmt_Access := null;
end record;
pragma Linker_Options ("-lsqlite3");
end GNU.DB.SQLite3;
|