X2c for Linux Installation and Release Notes

INSTALLing on Linux:

Load the UNIX / XENIX disk or tape using the tar command listed below. The current directory should be '/usr', and you must be logged on super-user with root permissions. This is necessary because parts of the system need to be loaded into system level directories. Once the tar load is finished, run ./install.

X2c is loaded in to a /usr/lib/x2c directory tree. The tutorial and sample files are loadedinto /usr/x2c. Loading X2c requires ###KB free.

Installing X2c:

login: root

password: ...

cd /tmp

tar xv2

('2' indicates the primary 1.2 meg Floppy drive.).

Load each disk. You must re-issue the tar command

if tar does not request additional disks.

mkdir /usr/x2c

(Or other location in which to place Ecstasy system)

./install

rm ztar install *.Z

Install The GCC C compiler by using the Xenix custom command, and selecting 'load supported product'

Installation Structure:

Initial X2c releases are archives into compressed tar files:

On Main disks:

x2c.bin.tar.Z - All executable programs

x2c.lib.tar.Z - All libraries

x2c.inc.tar.Z - All include files

x2c.tut.tar.Z - Tutorial

On Lib source disks:

x2c.lsrc.tar.Z - Library sources

The install script requires the major target directory to be created before it is run. (The listed file names may change based on production requirements.)

A typical sequence is to place create a user 'x2c' with home directory /usr/x2c and the installation will create the following sub-directories:

Main directory:

/usr/x2c

Sub-directories:

/usr/x2c/bin

/usr/x2c/lib

/usr/x2c/include

/usr/x2c/tutor

The bin archive contains all executable programs and library archives and will require a disk with 1.5 meg free.

The bin directory specified in TPGM must be defined in the PATH variable as '$TPGM/bin'. In addition, place the current directory in the PATH also, by placing . (dot) in the PATH definition.

Installation Testing:

The script 'x2c_tconfig' should be used to test the installed X2c. This is run by just the command:

x2c_tconfig

This is run from a user login in a directory intended to be used for Ecstasy programming.

Installation problems:

These situation will cause problems with installing or using X2c

Owners and groups of many auxiliary files and the tutorial have not been set properly.

The error from x2c_scan: unabletowritefile'usuallyindicates' that the current directory has not been given write permission the current user. In super-user mode, use the command:

chmod +wr . (note: the dot at the end of the command)

System notes:

Development system version:

The version of the Gcc compiler used to create this libraries is <<<'2.2.1e'>>. You can determine your revision by executing:

gcc -V

If you have link problems, such as undefined externals, this may be the cause. If so, you must re-create the libraries from the source set.

Special system installation:

The X2c run-time system has been created to use the Linux New Curses library using TERMINFO. Make sure you have New Curses installed or install the copy provided with X2c.

If you skipped the terminfo compilation at installation time, this is done with the commands:

cd /usr/lib/terminfo

tic terminfo.src

XENIX TERMINFO Definition errors

ansi-gt.src provided):

The standard Xenix console TERMINFO definition has problems when using the save and restore screen functions. A corrected console TERMINFO definition is provided.

The correct file is 'ansi-gt.src', which is in $TPGM/bin.

To use, place in /usr/lib/terminfo and run:

tic ansi-gt.src

Define the user terminal as ansi-gt by modifying the definition of TERM in .login or .profile from 'ansi' to 'ansi-gt'

Library Notes:

MEMORY() function:

There is no function in UNIX to determine available memory. This is because of the virtual memory environment within UNIX. The only indication that memory is low will be a significant speed degradation. Even a small UNIX system will allow at least 2-4 meg for an application.

Filename handling:

X2c automatic name processing:

X2c database and file functions use an internal function (SYfxfnam) to normalize DOS filenames to a UNIX format. This includes switching backslashes (\) to slashes (/), and forcing all names to lower case. In addition, a DOS disk specifier (a:,b: ...) are converted to a UNIX pathname. There is a table which defines the equivalent UNIX path, the default values are './'. The function SYdrvrlse(drive number, path) can be used to change the default settings.

Filenames are system specific:

Filenames are different between Unix and DOS, the programmer must normally handle the differences. This primarily occurs with switching DOS backward slashes to forward slashes. X2c handles the filename case sensitivity of UNIX by converting all filenames to lower case. (This is necessary because DOS is not case sensitive.)

UNIX filenames are case sensitive:

Xbase program is usually written with no attention to filename case: upper or lower. To make sure the program will operate properly, all X2c library functions force all names to lower case and return names in UPPER case, like equivalent Xbase functions.

Missing or Different functions and features:

The X2c system for Xenix/Unix has the following dos functions missing or significantly different:

ISPRINTER(): This is always set true. Set the printer controls section for details.

DIR: this command is not provided, use ADIR().

ADIR(): Not all parameters work the same as dos. Try samples to see the difference. For example, the attributes are clearly different. Names are always returned in UPPER CASE to be compatable with Clipper.

NETNAME(): This clipper function returns the string: PID####, where #### is the process ID.

PC characters:

BOX functions and other output functions are effected by the differences in Unix systems which do not have the pc special box drawing characters. Using CHR() to output special characters will have very peculiar results on many terminals, and the BOX statements are configured to use the star ('*') character for boxes.

If a system is using the Xenix main console for terminals like the Wyse 60 that has pc drawing characters, the scbox function in the dbxlib library can be recompiled to active the PC_CHAR compile-time selection.

RUN:

All shell variables act normally, including the temp name '$$'. Undefined shell variables are replaced by nothing, per normal shell rules.

Program and File contents:

This is a summary of files and programs provided with the Unix/Xenix release of X2c.

x2c header and startup files

x2c.dbd: Standard function definitions (replaces stdfun.dbd)

x2cmain.c: template for main()

Primary executable programs

x2c: X2c main compiler shell

gdbinit:Init file for gdb (becomes .gdbinit)

mk1:script for library builds, using regular C compiler

mk1-g:script for library builds, using Gnu C compiler

tx2c:script to run program with new DBXTERM and TERM=ansi-gt

x2c.xlt.472:x2c language processor

Libraries and object files

ansi-gt.src:Corrected Terminfo definition for ansi console

any-g.a:Any variable processing logic

dbfa-g.a:dbf/a database logic

dbx-g.a:screen handler, string and system functions

dbxmemo.o:memo support functions

dbxxtd.o:advanced macro database support functions

ev-g.a:expression evaluator

memo-g.a:memo sub-system

no_dnx.o:dummy index module

x2c utility programs

cre_undef:script to create undef.c from map file

dispdb:Display the structure of a DBF file

dkey:Dump the contents of an DNX index file

dtags:Creates tags file of prg PROCEDURE/FUNCTIONs

fbsl:find all backslashes in source files (utility)

findlk:Find active locks on a file

fixscn:Reset Screen after a core dump

fvar:fgrep-like search that understands xbase syntax

mt_undef:script to create eMpTy undef.c files

pr_undef:script to print undef.c (sorted)

psplit:split prg sources on clean boundaries (utility)

pull:Pull error lines from source files (utility)

*.pull'scripts:'

These shell scripts are helpful tools for debugging.

‹documents all .pull scripts

Run the script 'doc.pull' to get a detailed listing of what each does.

General purpose utilities

bpatch:Binary file edit utility

diff.with:script to merge source updates with master directory

do.big:script to list biggest files

fdmp:Hex file dump

get.from.dos:Xenix script to move files from a DOS disk

has.e:List files with matching .e files

ls.bins:List binary programs

mk.tar.rlse:Create a compressed tar file of release directory

patch:Apply patches to source files

rmv.prg.we:Remove C files where prgshave.efiles'

rmv.same:Remove files that are the same as another directory

rmv.var.we:Remove C files where prgsusevariablewith.e'

rmv.werr:Remove C files where prgshave.errfiles'

rmv.wprg:Remove C files with matching prgs'

rmv.wvar:Remove C files where prgsusevariable'

sayrc:Display exit (return) code from a program

texi2roff:Convert GNU doc to nroff format

 

X2c Release, Change and Anomaly Notes

Anomalies and exception report:

Installation problems:

Owners and groups of many auxiliary files and the tutorial have not been set properly.

The error from x2c_scan: 'unable to write file' usually indicates that the current directory has not been given write permission the current user. In super-user mode, use the command:

chmod +wr . (note: the dot at the end of the command)

Language differences, problems and errors:

This covers known problems or areas that require special handling.

The full Clipper (Summer 87) and Foxbase 2.1 languages are supported, except listed:

alias->field

If a number (1-9) is used, this does not work correctly. Use either letter (A-P) or alias name.

Comma's in replace statements required:

loop-hole in dBASE, Clipper, and Fox allows a multi-line replace to have only semi-colons between WITH clauses and no commas. X2c requires commas.

Date math with numeric constants:

The form (date+constant) must be re-written to use the function dayadj(date,constant).

This is because the numeric optimizer would be totally defeated if all math could be on dates or numerics. This form is fairly uncommon and we expect an option to be added to allow it if required.

Macro operators: Certain DB_A* and MEMA* routines have not been provided, report all undefined functions found. These are additional entries in anymacro.c

Reserved words:

X2c does not test for C reserved words used as a variable or function name:

void/char -> this is keyword

getchar() -> This is an stdio.h macro

free() -> this is a standard C function

SET KEY # TO function:

Clipper allows a function to be specified, X2c only allows a procedure to be specified.

STORE &macro to variable

Use:

variable = &macro

This works correctly.

REPLACE fieldname WITH &macro

REPLACE fieldname WITH function(paramlist)

These forms may not generate proper code. Use an intermediate variable:

x = &macro (or function(paramlist)

REPLACE fieldname WITH x

This problem is indicated by an C compiler warning. Only REPLACE statements with a warning are suspect.

False Macro internal error:

'INTERNAL error (untyped temporary)' error can be generated on the following statement, when there is no error. So long as there is no C compiler warning and the C statement is fully type ANY logic, the C code will function properly:

&variable = variable

Status of features, function and statements:

REPORT:

module in dbfa library: xtdrpt.c

This has all Xbase report writer functions, certain functions are suspect: Page breaks, line width

Macro expressions:

When using the expression evaluator, make sure all functions have all parameters. The evaluator can not handle options parameters.

For example, use SUBSTR(str,5,255) not SUBSTR(str,5).

Disabling the disk Cache:

The disk cache can be disabled by placing the following statements in x2cmain.c source file:

Before line 34:

extern int useCache, BLKmaxbufs;

Before line 68 which contains the DBinit():

useCache = FALSE;

BLKmacbufs = 10;

This will set up a cache of 10 (2k each). IF you are using less than 10 select areas, you can set the 10 to the number of select areas you are using.

Setting maximum Select areas and Indexes:

The default number of select areas is set to 10 and maximum indexes to 16 (this is the total number of indexes opened at any one time.) The number of indexes per select area is fixed at 16 (by the compile of the dbfa library.)

The number of select areas can be set by the variable:

WShighest, which is set in the x2cmain.c source.

The maximum of open indexes can be set by the variable:

IXhighest, which is set in the x2cmain.c source.

Compiler messages:

Due to the way X2c generates trace and module logic, the following message will be generated by the C compiler and should be ignored. The C compiler will optimize the statements flagged and will not produce not process the code flagged.

Code has no effect

Unreachable code

How to define Clipper file error handling using NETERR()

Add the following to the start of your first PRG to execute program:

*#C { extern int SFclipper ; SFclipper = 1; }

Note the braces and that case is significant, since this is embedded C code.

Color support for Linux:

X2c will now support color on terminals with color monitors. These are usually the UNIX console, PC's used as terminals or X-terminals. The color support uses the curses color pair function and provides three color pairs on any screen, this correspond to the Xbase SET COLOR settings: normal, enhanced and unselected.

To enable color, the terminal TERMINFO description must include color setting information and a special DBXTERM capability must be added. The current DBXTERM special values are:

P1 = Pc characters on screen

PE = Line drawing chars must use the alternate character set

PC = Color support on the terminal

More details about DBXTERM can be found in the X2c user manual..

Change Log:

Release Aug 30, 1994:

Direct execute version without user created DBD.

Linux Release

Release Jan 10, 1992:

@ SAY <field> uses field precision for default display picture

Automatic filename normalization from DOS to UNIX names.

DOS version release with initial MS-Windows support.

FOX menus and 2-d Arrays

Label writer per .LBL file format

Many minor improvements and function cleanups

UNIX release has Debug (glib) and Optimized Libraries (lib)

Release September 3, 1991:

All UNIX binaries moved to $TPGM/bin

Debugging routines to display ANY/memo added

Major improvement in field search logic for speed improvement

Many minor changes in ANY functions

Release July 20, 1991:

New functions:

STR(field) gives STR(field, field width, field precision)

as in Clipper (summer 87)

Numeric indexes: as in Clipper, actually stored as STR(field)

New install structure:

¨'install' places each tar.Z in a separate directory:

binaries in $TPGM, includes in $TPGM/include

libraries in $TPGM/lib, tutorial in $TPGM/tutor