SDK Include File

From Lianjapedia
Jump to: navigation, search

The include file "lianja_api.h" contains definitions of variable types, data structures and macro synonyms which are used by many of the API functions.

API Variable Types

TYPE NAME USED FOR DATATYPE
API_ATYPE Array variable int (512)
API_BOTTOM DBF_GOTO( API_BOTTOM ) int (-2)
API_CLASS User defined class (UDC) int (1)
API_CTYPE Character variable int (1)
API_DTYPE Date variable int (8)
API_FUNCTION User defined function (UDF) int (0)
API_LTYPE Logical variable int (4)
API_NTYPE Numeric variable int (2)
API_OTYPE Object variable int (256)
API_PRIVATE Private memory variable int (1)
API_PUBLIC Public memory variable int (1)
API_REFPAR Passed by reference with @ int (32)
API_TOP DBF_GOTO( API_TOP ) int (-1)
API_TTYPE DateTime variable int (64)
API_UTYPE Undefined variable int (0)
API_YTYPE Currency variable int (128)
CHARACTER Character string char
CURRENCY Currency Currency structure
DATE Date unsigned long
DATETIME Datetime DateTime structure
LOGICAL Logical data type int
MEMO Memo Operating system dependant
NUMERIC Numeric data type double
OBJARG Object argument Object argument format
OBJECT Object Pointer to an object

API Data Structures

The LIANJA_EXTENSION_TABLE data structure below is used to store information relating the C UDF or UDC to its name within Lianja. This structure is used when dynamically loading in the function or class.

struct	LIANJA_EXTENSION_TABLE {
	char			*name;				/* Pointer to Lianja function name		*/
	char			*apiname;			/* Pointer to C support function name	*/
	int			type;				/* Function type 0 function 1 class		*/
};

The API_EXPRESSION_RESULT data structure below is used to store the result which is returned from the api_expression() function.

struct	API_EXPRESSION {
	int			errno;				/* Error() number			*/
	char			type;				/* Data type of result				*/
	int			width;				/* Width of result					*/
	int			decimal;				/* Decimal places					*/
	char			character;			/* CHARACTER result				*/
	double 		number;				/* NUMERIC RESULT				*/
	char			logical;				/* LOGICAL result					*/
	unsigned long	date;				/* DATE result				*/
	DATETIME 	datetime;			/* DATETIME result					*/
	CURRENCY 	currency;			/* CURRENCY result					*/
};

The API_MEMVAR data structure below is used to describe the contents of a memory variable.

union	API_UNION {
	char			*info_character;		/* Char memory variable				*/
	char			info_logical;			/* Logical memory variable			*/
	double		info_number;			/* Numeric memory variable			*/
	unsigned long	info_date;			/* Date memory variable				*/
	DATETIME	info_datetime;	 	/* DateTime memory variable			*/
	CURRENCY	info_currency;		/* Currency memory variable			*/
};


struct	API_MEMVAR {
	char			type;				/* Data type of the memory			*/
	union		API_UNION value;	/* Value of the memory variable		*/
	int			width;				/* Display width					*/
	int			decimal;				/* Display # of decimal places			*/
};

The API_FIELD data structure is used to describe the structure of a field.

struct	API_FIELD {
    int			fieldno;				/* Field number					*/
    char		type;				/* Data type of field					*/
    int			size;				/* Storage size in the record			*/
    int			width;				/* Display width					*/
    int 			decimal;				/* # decimal places for numerics		*/
    char		*value;				/* Pointer to data in current record		*/
};