2007-11-24 01:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/msql/Makefile
   * contrib/msql/make_b32.bat
   * contrib/msql/make_vc.bat
   * contrib/msql/msql.h
   * contrib/msql/tmsql.prg
     ! Fixed to compile with non-GNU BC/VC makefiles.
       (short-term fixes, there may be better / more generic 
       ways to fix it)
     ! C warnings fixed.
     ! Harbour warnings fixed.
     ! Makefile changed to Harbour standard GNU format.

   * contrib/make_b32_all.bat
   * contrib/make_vc_all.bat
     + msql enabled.

   - contrib/msql/dbf2msql.prg
   - contrib/msql/test.prg
   + contrib/msql/tests
   + contrib/msql/tests/dbf2msql.prg
   + contrib/msql/tests/test.prg
     * Tests moved to tests dir.
This commit is contained in:
Viktor Szakats
2007-11-24 01:05:46 +00:00
parent 2c0d6edff2
commit a6e010dccb
10 changed files with 54 additions and 51 deletions

View File

@@ -8,6 +8,30 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-24 01:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/msql/Makefile
* contrib/msql/make_b32.bat
* contrib/msql/make_vc.bat
* contrib/msql/msql.h
* contrib/msql/tmsql.prg
! Fixed to compile with non-GNU BC/VC makefiles.
(short-term fixes, there may be better / more generic
ways to fix it)
! C warnings fixed.
! Harbour warnings fixed.
! Makefile changed to Harbour standard GNU format.
* contrib/make_b32_all.bat
* contrib/make_vc_all.bat
+ msql enabled.
- contrib/msql/dbf2msql.prg
- contrib/msql/test.prg
+ contrib/msql/tests
+ contrib/msql/tests/dbf2msql.prg
+ contrib/msql/tests/test.prg
* Tests moved to tests dir.
2007-11-23 21:18 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/mtpl_vc.mak
! Some minor fixes for VC.

View File

@@ -8,12 +8,12 @@ rem IT or you will break Win9x command.com line length limit !!!
set HB_SHOW_ERRORS=no
set DO_NOT_COMPILE=examples hbclip hgf msql
set DO_NOT_COMPILE=examples hbclip hgf
set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf ole
set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf msql
for %%n in ( %DIRS% ) do %COMSPEC% /c make_b32.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
set DIRS=hbzlib htmllib odbc telepath tip win32 xhb
set DIRS=ole hbzlib htmllib odbc telepath tip win32 xhb
for %%n in ( %DIRS% ) do %COMSPEC% /c make_b32.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
set DIRS=samples directx

View File

@@ -8,12 +8,12 @@ rem IT or you will break Win9x command.com line length limit !!!
set HB_SHOW_ERRORS=no
set DO_NOT_COMPILE=examples hbclip hgf msql
set DO_NOT_COMPILE=examples hbclip hgf
set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf ole
set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf msql
for %%n in ( %DIRS% ) do %COMSPEC% /c make_vc.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
set DIRS=hbzlib htmllib odbc telepath tip win32 xhb
set DIRS=ole hbzlib htmllib odbc telepath tip win32 xhb
for %%n in ( %DIRS% ) do %COMSPEC% /c make_vc.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
set DIRS=samples directx

View File

@@ -2,41 +2,17 @@
# $Id$
#
CompOptions = -m -n -I../include
ROOT = ../../
C_SOURCES=\
msql.c \
msqlobjects = msql.o tmsql.o
msqlprecomp = msql.c tmsql.c
msqlsource = tmsql.prg
PRG_SOURCES=\
tmsql.prg \
tobjects = test.o
tprecomp = test.c
tsource = test.prg
PRG_HEADERS=\
msql.ch \
dobjects = dbf2msql.o
dprecomp = dbf2msql.c
dsource = dbf2msql.prg
$(msqlobjects): $(msqlprecomp)
gcc -O2 -c $(msqlprecomp) -I..\include
$(msqlprecomp): $(msqlsource)
..\bin\harbour $(CompOptions) $(msqlsource)
test: $(tobjects) $(msqlobjects)
gcc -O2 -o test.exe $(tobjects) $(msqlobjects) -I..\include -L..\lib -lrtl -lvm -lgtos2 -lrdd -llang -lmacro -lpp -ldbfntx -lcommon -lrtl -lvm -llibmsql -lsocket
$(tobjects): $(tprecomp)
gcc -O2 -c $(tprecomp) -I..\include
$(tprecomp): $(tsource)
..\bin\harbour $(CompOptions) $(tsource)
dbf2msql: $(dobjects) $(msqlobjects)
gcc -O2 -o dbf2msql.exe $(dobjects) $(msqlobjects) -I..\include -L..\lib -lrtl -lvm -lgtos2 -lrdd -llang -lmacro -lpp -ldbfntx -lcommon -lrtl -lvm -llibmsql -lsocket
$(dobjects): $(dprecomp)
gcc -O2 -c $(dprecomp) -I..\include
$(dprecomp): $(dsource)
..\bin\harbour $(CompOptions) $(dsource)
LIBNAME=msql
include $(TOP)$(ROOT)config/lib.cf

View File

@@ -3,4 +3,6 @@ rem
rem $Id$
rem
set CFLAGS=-D_OS_WIN32
call ..\mtpl_b32.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -3,4 +3,6 @@ rem
rem $Id$
rem
set CFLAGS=-D_OS_WIN32
call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -24,7 +24,11 @@
#define MSQL_H
#include <sys/types.h>
#if defined(__BORLANDC__) || defined(_MSC_VER)
#include <sys/types.h> /* needed for time_t prototypes */
#else
#include <sys/time.h> /* needed for time_t prototypes */
#endif
#ifndef APIENTRY
@@ -50,7 +54,7 @@
#endif
#if defined(__STDC__) || defined(__cplusplus)
#if (defined(__STDC__) || defined(__cplusplus) || defined(__BORLANDC__) || defined(_MSC_VER))
# define __ANSI_PROTO(x) x
#else
# define __ANSI_PROTO(x) ()
@@ -124,10 +128,11 @@ typedef struct result_s {
#define IS_UNIQUE(n) (n & UNIQUE_FLAG)
#define IS_NOT_NULL(n) (n & NOT_NULL_FLAG)
/*
static char msqlTypeNames[][12] =
{"???", "int", "char","real","ident","null","text","date","uint",
"money","time","???"};
*/
/*
** Pre-declarations for the API library functions

View File

@@ -111,11 +111,9 @@ METHOD FieldGet(nNum) CLASS TmSQLRow
if nNum > 0 .AND. nNum <= Len(::aRow)
return ::aRow[nNum]
else
return nil
endif
return
return nil
METHOD FieldPut(nNum, Value) CLASS TmSQLRow
@@ -162,11 +160,9 @@ METHOD FieldName(nPosition) CLASS TmSQLRow
if nPosition >=1 .AND. nPosition <= Len(::aFieldStruct)
return ::aFieldStruct[nPosition][MSQL_FS_NAME]
else
return ""
endif
return
return ""
/* ----------------------------------------------------------------------------------------*/
@@ -270,7 +266,7 @@ static function NMonth(cMonthValue)
static cMonths := {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dec" }
nMonth := AScan(cMonths, cMonthValue)
local nMonth := AScan(cMonths, cMonthValue)
return PadL(nMonth, 2, "0")
@@ -585,9 +581,7 @@ METHOD GetBlankRow() CLASS TmSQLTable
endcase
next
return TmSQLRow():New(aRow, ::aFieldStruct, ::cTable, .F.)
return nil
return TmSQLRow():New(aRow, ::aFieldStruct, ::cTable, .F.)
/* ----------------------------------------------------------------------------------------*/