/*

This source file is part of Scol
For the latest info, see http://www.scolring.org

Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>

This source is under the terms of the Scol License. See the COPYING included file
for more informations.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

For others informations, please contact us from http://www.scolring.org/

*/

#ifndef __MAIN_H__
#define __MAIN_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if ((defined __WIN32__) || (defined WIN32))
#include <windows.h>
#include "scol_plugin_win.h"
#else
#include "scol_plugin_lin.h"
#endif
#include "macros.h"
#include "rsc/sqlite3.h"


#define SQLITE_PKG_NB 33
#define SQLITE_RFL_NB 2
int ObjSqliteType;

#define SCOL_SQLITE_CB  0

#define SCOL_SQLITE_CBPROGRESS  1



#define SCOL_SQLITE_VERSION     "0.1a6"

#ifndef    __bool_true_false_are_defined
#   define   bool   int
#   define   true    1
#   define   false   0
#   define __bool_true_false_are_defined
#endif


#define SizeHeader 3
#define SizeWord 4

#define OBJDD_BUFFER    0   /* widget C pointer etc*/
#define OBJDD_HANDLE    1   /* system handler*/
#define OBJDD_CHANNEL   2   /* channel*/
#define OBJDD_FLAGS     0   /* object flags*/
#define OBJDD_SIZE      4   /* size for MMmalloc*/

/*#define OBJSQLITE_SIZE            3
#define OBJSQLITE_HANDLE          0
#define OBJSQLITE_NAME            1
#define OBJSQLITE_KILLED          2*/
#define OBJSQLITE_SIZE            3
#define OBJSQLITE_HANDLE          4
#define OBJSQLITE_NAME            1
#define OBJSQLITE_KILLED          2

/* Api Scol flags*/
#define SCOL_SQLITE_ONLYREAD             1
#define SCOL_SQLITE_READWRITE            2
#define SCOL_SQLITE_OPEN_NOMUTEX         4
#define SCOL_SQLITE_OPEN_FULLMUTEX       8
#define SCOL_SQLITE_OPEN_SHAREDCACHE     16
#define SCOL_SQLITE_OPEN_PRIVATE_CACHE   32

#define SCOL_SQLITE_LENGTH_LIMIT                    1
#define SCOL_SQLITE_SQL_LENGTH_LIMIT                2
#define SCOL_SQLITE_COLUMN_LIMIT                    3
#define SCOL_SQLITE_EXPR_DEPTH_LIMIT                4
#define SCOL_SQLITE_COMPOUND_SELECT_LIMIT           5
#define SCOL_SQLITE_VDBE_OP_LIMIT                   6
#define SCOL_SQLITE_FUNCTION_ARG_LIMIT              7
#define SCOL_SQLITE_ATTACHED_LIMIT                  8
#define SCOL_SQLITE_LIKE_PATTERN_LENGTH_LIMIT       9
#define SCOL_SQLITE_VARIABLE_NUMBER_LIMIT           10
#define SCOL_SQLITE_TRIGGER_DEPTH_LIMIT             11


#if ((defined _WIN32) || (defined __WIN32__))
#define SCOL_SQLITE_PLUGIN_EXPORT __declspec (dllexport)
#define SCOL_SQLITE_PLUGIN_ARG mmachine m, cbmachine w
#define SCOL_SQLITE_PLUGIN_INIT ww = w;
#elif ((defined linux) || (defined __linux))
#define SCOL_SQLITE_PLUGIN_EXPORT
#define SCOL_SQLITE_PLUGIN_ARG mmachine m
#define SCOL_SQLITE_PLUGIN_INIT
#endif






/* int callobjsqlitecallbackProgress (int *mm);*/
int callobjsqlitecallbackProgress (mmachine m);

#endif /* __MAIN_H__ */
