diff options
author | Sam Lawrance <lawrance@FreeBSD.org> | 2005-04-14 12:17:36 +0000 |
---|---|---|
committer | Sam Lawrance <lawrance@FreeBSD.org> | 2005-04-14 12:17:36 +0000 |
commit | 092db998604a13e6b5cd177f1b8f23bc80099439 (patch) | |
tree | ca22bc435156232362f0f43245f1d2f0aeb889f6 /databases/dbview | |
parent | 0ad6db7f9ee444d83a450a9e45ae0c860e2d4457 (diff) | |
download | ports-092db998604a13e6b5cd177f1b8f23bc80099439.tar.gz ports-092db998604a13e6b5cd177f1b8f23bc80099439.zip |
Notes
Diffstat (limited to 'databases/dbview')
-rw-r--r-- | databases/dbview/Makefile | 2 | ||||
-rw-r--r-- | databases/dbview/files/patch-db_dump.c | 112 | ||||
-rw-r--r-- | databases/dbview/files/patch-db_dump.h | 54 | ||||
-rw-r--r-- | databases/dbview/files/patch-dbview.c | 53 | ||||
-rw-r--r-- | databases/dbview/files/patch-version.c | 11 |
5 files changed, 231 insertions, 1 deletions
diff --git a/databases/dbview/Makefile b/databases/dbview/Makefile index 6f63ab365d53..4a95db574c65 100644 --- a/databases/dbview/Makefile +++ b/databases/dbview/Makefile @@ -7,7 +7,7 @@ PORTNAME= dbview PORTVERSION= 1.0.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SUNSITE} MASTER_SITE_SUBDIR= apps/database/proprietary diff --git a/databases/dbview/files/patch-db_dump.c b/databases/dbview/files/patch-db_dump.c new file mode 100644 index 000000000000..254dffaada8e --- /dev/null +++ b/databases/dbview/files/patch-db_dump.c @@ -0,0 +1,112 @@ +--- db_dump.c.orig Thu May 30 14:15:30 2002 ++++ db_dump.c Wed Apr 17 15:56:46 2002 +@@ -164,6 +164,9 @@ + int flags; + { + int fields; ++ char *info; ++ char *lang; ++ char *cdx; + DBASE_FIELD *fld; + + if(dbfile==-1) { +@@ -171,26 +174,71 @@ + return; + } + read(dbfile,&dbhead,sizeof(DBASE_HEAD)); +- if( !(dbhead.version==3 || dbhead.version==0x83) ) { ++ if ( ! ( dbhead.version==0x03 || dbhead.version==0x83 || dbhead.version==0x04 || dbhead.version==0x05 || dbhead.version==0x8b || dbhead.version==0xf5 ) ) { + printf ("Version %d not supported\n",dbhead.version); +- if(dbhead.version==0x8b ) { +- printf ("dBase IV - partially known...\n"); ++ if (dbhead.version==0x8e ) { ++ printf ("dBase IV or dBase V with SQL table - partially known...\n"); + } ++ if (dbhead.version==0x43 || dbhead.version==0xb3){ ++ printf ("FlagShip - partially known...\n"); ++ } + return; + } ++ if (dbhead.version==0x03){ ++ info="Plain dbf, dBaseIII+"; ++ } ++ if (dbhead.version==0x04){ ++ info="Plain dbf, dBaseIV+"; ++ } ++ if (dbhead.version==0x05){ ++ info="Plain dbf, dBaseV or FoxPro"; ++ } ++ if (dbhead.version==0x83){ ++ info="dBaseIII+ w/memo"; ++ } ++ if (dbhead.version==0x8b){ ++ info="dBaseIV+ w/memo"; ++ } ++ if (dbhead.version==0xf5){ ++ info="FoxPro w/memo"; ++ } ++ ++ fields=(dbhead.header-1)/32-1; + ++ if (dbhead.excdx){ ++ cdx="Yes"; ++ } ++ else{ ++ cdx="No"; ++ } ++ if (dbhead.language==101){ ++ lang="DOS 866"; ++ } ++ else if (dbhead.language==2){ ++ lang="WIN 1251"; ++ } ++ else if (dbhead.language==2){ ++ lang="DOS 850 Multi ling"; ++ } ++ else if (dbhead.language==1){ ++ lang="DOS 437 USA"; ++ } ++ else{ ++ lang="Unknown"; ++ } + if (flags & DB_FL_INFO) { +- printf("File version : %d\n",dbhead.version); +- printf("Last update : %02d/%02d/%2d\n", dbhead.l_update[1],dbhead.l_update[2],dbhead.l_update[0]); +- printf("Number of recs: %ld\n",dbhead.count); +- printf("Header length : %d\n",dbhead.header); +- printf("Record length : %d\n",dbhead.lrecl); ++ printf("File version : %d, %s\n",dbhead.version,info); ++ printf("Last update : %02d/%02d/%2d\n", dbhead.l_update[1],dbhead.l_update[2],dbhead.l_update[0]+1900); ++ printf("Number of recs : %ld\n",dbhead.count); ++ printf("Header length : %d\n",dbhead.header); ++ printf("Record length : %d\n",dbhead.lrecl); ++ printf("Exist index cdx : %s\n",cdx); ++ printf("Language ID : %s\n",lang); ++ printf("Count fields : %d\n\n",fields); + } + + Buffer=malloc(dbhead.lrecl); +- +- fields=(dbhead.header-1)/32-1; +- ++ + if (flags & DB_FL_DESCR) { + printf("Field Name\tType\tLength\tDecimal Pos\n"); + } +@@ -227,7 +275,7 @@ + char delim; + { + int bytes; +- ++ lseek(dbfile,dbhead.header,SEEK_SET); + while(cnt) { + bytes=read(dbfile,Buffer,dbhead.lrecl); + if(bytes!=dbhead.lrecl) +@@ -253,7 +301,6 @@ + char delim; + { + FLD_LIST *temp; +- + temp=db_fld_root; + while (temp) { + memcpy(buf_work,temp->data,temp->fld->length); diff --git a/databases/dbview/files/patch-db_dump.h b/databases/dbview/files/patch-db_dump.h new file mode 100644 index 000000000000..47a86d37d48c --- /dev/null +++ b/databases/dbview/files/patch-db_dump.h @@ -0,0 +1,54 @@ +--- db_dump.h.orig Tue Oct 8 17:18:40 1996 ++++ db_dump.h Thu Apr 14 20:10:55 2005 +@@ -48,7 +48,10 @@ + #define DB_FL_TRIM 0x20 + + typedef struct dbase_head { +- unsigned char version; /* 03 for dbIII and 83 for dbIII w/memo file */ ++ unsigned char version; /* 0x03,0x04,0x05-DBIII+/DBIV */ ++ /* 0x83 - DBIII+ w/memo;*/ ++ /* 0xF5-FoxPro w/memo;*/ ++ /* 0x8B-DBIV w/memo file */ + unsigned char l_update[3]; /* yymmdd for last update*/ + unsigned long count; /* number of records in file*/ + unsigned short header; /* length of the header +@@ -58,21 +61,32 @@ + * includes the delete + * byte + */ +- unsigned char reserv[20]; ++ unsigned char reserv1[16]; ++ unsigned char excdx; /* 1-exist cdx file, 0 - nonexist*/ ++ unsigned char language; /* language driver:0x01 - 437 DOS;0x02 - 850 DOS; 0x03 - 1251; 0x00 - ignored*/ ++ unsigned char reserv2[2]; + } DBASE_HEAD; + +-#define DB_FLD_CHAR 'C' +-#define DB_FLD_NUM 'N' +-#define DB_FLD_LOGIC 'L' +-#define DB_FLD_MEMO 'M' +-#define DB_FLD_DATE 'D' ++#define DB_FLD_CHAR 'C' ++#define DB_FLD_NUM 'N' ++#define DB_FLD_LOGIC 'L' ++#define DB_FLD_VARIABLE 'V' ++#define DB_FLD_MEMO 'M' ++#define DB_FLD_FLOAT 'F' ++#define DB_FLD_PICTURE 'P' ++#define DB_FLD_BINARY 'B' ++#define DB_FLD_GENERAL 'G' ++#define DB_FLD_SHINT '2' ++#define DB_FLD_LINT '4' ++#define DB_FLD_DOUBLE '8' ++#define DB_FLD_DATE 'D' + + typedef struct dbase_fld { + char name[11]; /*field name*/ + char type; /*field type*/ + /* A-T uses large data model but drop it for now */ + char *data_ptr; /*pointer into buffer*/ +- char length; /*field length*/ ++ unsigned char length; /*field length*/ + char dec_point; /*field decimal point*/ + char fill[14]; + } DBASE_FIELD; diff --git a/databases/dbview/files/patch-dbview.c b/databases/dbview/files/patch-dbview.c new file mode 100644 index 000000000000..c24fa0023446 --- /dev/null +++ b/databases/dbview/files/patch-dbview.c @@ -0,0 +1,53 @@ +--- dbview.c.orig Tue Oct 8 11:04:23 1996 ++++ dbview.c Wed Apr 17 16:16:53 2002 +@@ -34,19 +34,19 @@ + + void help_short() + { +- printf ("%s %s - %s, (c) 1996 by Martin Schulze\n", progname, version, longname); ++ printf ("%s %s - %s, (c) 1996 by Martin Schulze, Patched Alexander Trapeznikov, 2001 \n", progname, version, longname); + printf ("\n"); +- printf ("%s [-b [-t]] [-d delim] [-e] [-h] [-i] [-o] [-o] [-v] dbfile\n", progname); ++ printf ("%s [-b [-t]] [-d delim] [-e] [-h|-H] [-i] [-o] [-o] [-v] dbfile\n", progname); + } + + void help_long() + { +- printf ("%s %s - %s, (c) 1996 by Martin Schulze\n", progname, version, longname); ++ printf ("%s %s - %s, (c) 1996 by Martin Schulze, Patched Alexander Trapeznikov, 2001 \n", progname, version, longname); + printf ("\n"); + printf (" --browse, -b browse the database\n"); + printf (" --delimiter, -d set the delimiter for browse output\n"); + printf (" --description, -e display field description\n"); +- printf (" --help, -h display help\n"); ++ printf (" --help, -H, -h display help\n"); + printf (" --info, -i display db information\n"); + printf (" --omit, -o omit db records\n"); + printf (" --reserve, -r reserve fieldnames from beeing translated\n"); +@@ -54,7 +54,7 @@ + printf (" --version, -v display version\n"); + } + +-void main (int argc, char **argv) ++int main (int argc, char **argv) + { + int opt_index; + char c; +@@ -80,6 +80,8 @@ + switch (c) { + case 'H': /* --help */ + help_long (); exit (0); ++ case 'h': /* --help */ ++ help_long (); exit (0); + case 'b': + flags |= DB_FL_BROWSE; + break; +@@ -93,8 +95,6 @@ + case 'e': + flags |= DB_FL_DESCR; + break; +- case 'h': +- help_short (); exit (0); + case 'i': + flags |= DB_FL_INFO; + break; diff --git a/databases/dbview/files/patch-version.c b/databases/dbview/files/patch-version.c new file mode 100644 index 000000000000..7112deb132d3 --- /dev/null +++ b/databases/dbview/files/patch-version.c @@ -0,0 +1,11 @@ +--- version.c.orig Fri Sep 27 00:03:57 1996 ++++ version.c Tue Jul 17 03:50:48 2001 +@@ -21,6 +21,6 @@ + + + char progname[] = "dbview"; +-char longname[] = "View dBase III files"; ++char longname[] = "View dbf files"; + +-char version[] = "1.0.2"; ++char version[] = "1.0.3.1"; |