This chapter provides the manual pages for the utilities and the mx routines. The utility manual pages can also be found in the $EMPRESSPATH/man directory and can be printed using the command:
For UNIX, using nroff -man filename.
For Windows, using type or more command.
The following is the list of manual pages for the utilities:
| Category | Sub-Category | Command |
| C/C++ API | empc++ | |
| empcc (UNIX) | ||
The following is the list of manual pages for the mx routines in alphabetical order:
| DESCRIPTION |
Place a named procedure on the stack to be called by msexit and executed immediately before the program is terminated. The procedure passed to msclean is the last but one called by msexit. | ||
| SYNOPSIS |
void msclean (void (* proc) (void)) | ||
| USAGE |
msclean (proc ());
| ||
| RETURNS |
None. | ||
| WARNINGS |
Please note that this routine will become obsolete and be replaced in the near future with the mutli-threading capability. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION |
This routine call the cleanup procedures without terminating the program. |
| SYNOPSIS |
void msend (void) |
| USAGE |
msend (); |
| RETURNS |
None. |
| WARNINGS |
This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION |
This routine calls msexitcleanup before terminating the program. It passes a value to the shell. | ||
| SYNOPSIS |
void msexit (int value) | ||
| USAGE |
msexit (value);
| ||
| RETURNS |
None. | ||
| WARNINGS |
The last procedure called by msexit checks to see if all user procedure space is freed; if not, a warning message about space allocated is printed. |
| DESCRIPTION | This routine executes all the clenup procedures without terminating the program. |
| SYNOPSIS |
void msexitcleanup (void) |
| USAGE | msexitcleanup (); |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION |
Initialize for mscall, mx and mr routines. |
| SYNOPSIS |
msbool msinit (void) |
| USAGE |
flag = msinit (); |
| RETURNS |
Return false if msinit has been called; true otherwise. |
| WARNINGS |
None. |
| DESCRIPTION |
Close all tables and de-allocate all existing mx-related variables. This procedure should be used before terminating a program due to an error condition or a trapped interrupt. |
| SYNOPSIS |
void mxaclose (void) |
| USAGE |
mxaclose (); |
| RETURNS |
None. |
| WARNINGS |
Indiscriminate use of this procedure defeats all the built-in error checking mechanisms of the mx routines. |
| DESCRIPTION |
Insert a record into a given table. The record should have been constructed using mxputv. | ||||
| SYNOPSIS |
msbool mxadd (char* table) | ||||
| USAGE |
flag = mxadd (table);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||
| WARNINGS | The table must be opened in update mode or the insert will fail. |
| DESCRIPTION | Check whether a particular attribute is in an opened table. | ||||
| SYNOPSIS |
msbool mxchkattr (char* attribute) | ||||
| USAGE |
flag = mxchkattr (attribute);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||
| WARNINGS | If the same attribute name appears in more than one opened table, the attribute name must be qualified with the table name (and database name if necessary) to ensure that the correct attribute is checked for. |
| DESCRIPTION | Close a table after all operations have been performed on it. | ||
| SYNOPSIS |
msbool mxclose (char* table) | ||
| USAGE | mxclose (table);
| ||
| RETURNS | True if table is currently opened and false otherwise. | ||
| WARNINGS | None. |
| DESCRIPTION | Find whether a constant is equal to, less than, or greater than an attribute value. | ||||||
| SYNOPSIS |
int mxcompare (char* attribute, char* value) | ||||||
| USAGE | result = mxcompare (attribute, value);
| ||||||
| RETURNS | Zero if the constant is equal to the attribute value, 1 if the attribute value is greater than the constant, and -1 if the attribute value is less than the constant. If an error occurs (due to incompatible data types) an error message is printed and the calling program terminated. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Copy the internal representation of an attribute value to a variable. | ||||||
| SYNOPSIS |
msbool mxcopyi (char* attribute, addr var_ptr) | ||||||
| USAGE |
flag = mxcopyi (attribute, &var);
| ||||||
| RETURNS | Returns true (1) if the value is not NULL, false (0) if it is. | ||||||
| WARNINGS | Using this routine results in non-portable code. |
| DESCRIPTION | Delete a record from a table. | ||||
| SYNOPSIS |
msbool mxdel (char* table) | ||||
| USAGE | flag = mxdel (table);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||
| WARNINGS | The record to be deleted must first have been specified in a call to mxgetbegin and then retrieved by a successful call to mxget. |
| DESCRIPTION | Retrieve a record from a table; successive calls retrieve different records. | ||
| SYNOPSIS |
int mxget (void) | ||
| USAGE | flag = mxget ();
| ||
| RETURNS | True (1) if successful; false (0) if all records have been retrieved. If the record is locked and mxerret is set, it returns -1; if the record is locked and mxerret is not set, it prints an error message and terminates the calling program. | ||
| WARNINGS | mxgetbegin must be called once before any calls to mxget are made. mxgetend must be called after one or more calls to mxget to do cleaning up. |
| DESCRIPTION | Associate a given qualification with one or more records. | ||||||||
| SYNOPSIS |
msbool mxgetbegin (char* table_1, [ ..., char* table_n,] (char*)0) | ||||||||
| USAGE |
flag = mxgetbegin (table_1, table_2, ... , CHARNIL);
| ||||||||
| RETURNS |
True (1) if successful; false (0) if it is unable to access all appropriate records and mxerret is set. If it cannot access all appropriate records and mxerret is not set, it prints an error message and terminates the calling program. | ||||||||
| WARNINGS |
Nested calls to mxgetbegin must be set up carefully. |
| DESCRIPTION |
Clean up after retrieving records from a table. |
| SYNOPSIS |
void mxgetend (void) |
| USAGE |
mxgetend (); |
| RETURNS |
None. |
| WARNINGS | Failure to call mxgetend after retrieving records may affect future record retrievals. |
| DESCRIPTION | Retrieve an attribute value as an integer; terminate the calling program on failure. | ||||
| SYNOPSIS |
int mxgetvi (char* attribute) | ||||
| USAGE |
value = mxgetvi (attribute);
| ||||
| RETURNS | The attribute value as an integer. If the value cannot be converted to an integer, an error message is printed and the calling program terminated. | ||||
| WARNINGS |
None. |
| DESCRIPTION |
Retrieve an external format attribute value. | ||||
| SYNOPSIS | char* mxgetvs (char* attribute) | ||||
| USAGE |
value = mxgetvs (attribute);
| ||||
| RETURNS | A pointer (char *) to an attribute value; a pointer to a null string if the value is NULL. | ||||
| WARNINGS | The value found by mxgetvs should be used immediately, since the next call to mxgetvs, mxputvs or mxputvi for the same attribute re-uses the buffer it is placed in. |
| DESCRIPTION |
Find the name of an attribute given its number in a table. | ||||||
| SYNOPSIS | char* mxigeta (char* table, int number) | ||||||
| USAGE |
name = mxigeta (table, number);
| ||||||
| RETURNS | The name of the attribute; CHARNIL if unsuccessful. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Open and lock a table for use with the mx routines. | ||||||||
| SYNOPSIS | msbool mxopen (char* database, char* table, char* mode) | ||||||||
| USAGE |
flag = mxopen (database, table, mode);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||
| WARNINGS | It is generally unwise to specify the current directory when calling mxopen (i.e., you should not run applications in the database directory), because of the danger of damaging files in the database when new files are created. If read mode is specified and the person executing the program has no read permission on the table, or if update mode is specified and the person executing the program does not have read and write permission on the table, mxopen will fail. |
| DESCRIPTION |
Retrieve the previous record from a table; successive calls retrieve different records. | ||
| SYNOPSIS | int mxprev (void) | ||
| USAGE |
flag = mxprev ();
| ||
| RETURNS | True (1) if successful; false (0) if all records have been retrieved. If the record is locked and mxerret is set, it returns -1; if the record is locked and mxerret is not set, it prints an error message and terminates the calling program. | ||
| WARNINGS | mxgetbegin must be called once before any calls to mxprev are made. mxgetend must be called after one or more calls to mxprev to do cleaning up. |
| DESCRIPTION | Update a record. | ||||
| SYNOPSIS | msbool mxput (char* table) | ||||
| USAGE |
flag = mxput (table);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||
| WARNINGS | The record to be replaced must be first obtained by calls to mxgetbegin and mxget, otherwise mxput will fail. |
| DESCRIPTION | Assign an internal format value to an attribute. | ||||||
| SYNOPSIS | msbool mxputi (char* attribute, addr var_ptr) | ||||||
| USAGE |
flag = mxputi (attribute, &var_ptr);
| ||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||
| WARNINGS | Use of this routine results in non-portable code. The pointer must point to a variable compatible with the Empress internal representation of the attribute in question or a conversion error will result. |
| DESCRIPTION | Assign an integer value to an attribute. | ||||||
| SYNOPSIS | msbool mxputvi (char* attribute, int value) | ||||||
| USAGE |
flag = mxputvi (attribute, value);
| ||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Assign an external format value to an attribute. | ||||||
| SYNOPSIS | msbool mxputvs (char* attribute, char* value) | ||||||
| USAGE |
flag = mxputvs (attribute, value);
| ||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Perform an AND operation on the top two values of the stack holding qualifications created by calls to the mxq routines. |
| SYNOPSIS | void mxqand (void) |
| USAGE | mxqand (); |
| RETURNS | None. |
| WARNINGS | There must be at least two qualifications on the stack or mxqand will fail, print an error message, and terminate the calling program. |
| DESCRIPTION | Compare an attribute value to another attribute value and store the result on a stack. | ||||||||
| SYNOPSIS | msbool mxqatr (char* operator, char* attr_1, char* attr_2) | ||||||||
| USAGE |
flag = mxqatr (operator, attr_1, attr_2);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||
| WARNINGS | The two attributes compared must be compatible, otherwise mxqatr will fail. |
| DESCRIPTION | Compare an attribute value to an external format constant and store the result on a stack. | ||||||||
| SYNOPSIS | msbool mxqcon (char* operator, char* attribute, char* string) | ||||||||
| USAGE |
flag = mxqcon (operator, attribute, string);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||
| WARNINGS | The routine will fail and print a "Conversion Error'' message if the attribute and value are not compatible. |
| DESCRIPTION | Compare an attribute value to an internal format constant and store the result on a stack. | ||||||||
| SYNOPSIS | msbool mxqconi (char* operator, char* attribute, addr var_ptr) | ||||||||
| USAGE |
flag = mxqconi (operator, attribute, &var);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||
| WARNINGS | Using this routine results in non-portable code. The routine will fail and print "Conversion Error'' message if the attribute and value are not compatible. |
| DESCRIPTION | Compare an integer to an attribute value and store the result on a stack. | ||||
| SYNOPSIS | void mxqieq (char* attribute, int integer) | ||||
| USAGE |
mxqieq (attribute, integer);
| ||||
| RETURNS | None. | ||||
| WARNINGS | If the attribute and the integer cannot be compared, the routine will fail and terminate the calling program. |
| DESCRIPTION | Compare an attribute value to a pattern, and store the result on a stack. | ||||||||
| SYNOPSIS | msbool mxqmch (char* operator, char* attribute, char* pattern) | ||||||||
| USAGE |
flag = mxqmch (operator, attribute, pattern);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||
| WARNINGS | If the arguments are incompatible the routine will fail. |
| DESCRIPTION | Reverse the sense of the qualification on the top of the stack. |
| SYNOPSIS |
void mxqnot (void); |
| USAGE |
mxqnot (); |
| RETURNS | None. |
| WARNINGS | There must be at least one qualification on the stack or the routine will fail, print an error message, and terminate the calling program. |
| DESCRIPTION | Compare an attribute value to NULL, and store the result on a stack. | ||||||
| SYNOPSIS | msbool mxqnul (char* operator, char* attribute) | ||||||
| USAGE |
flag = mxqnul (operator, attribute);
| ||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||
| WARNINGS | Routine will fail if the arguments are inappropriate. |
| DESCRIPTION |
Perform an OR operation on the top two elements of the stack holding qualifications created by the mxq routines. |
| SYNOPSIS | void mxqor (void) |
| USAGE |
mxqor (); |
| RETURNS | None. |
| WARNINGS | There must be at least two qualifications on the stack or mxqor will fail, print an error message, and terminate the calling program. |
| DESCRIPTION | Compare an attribute value to a given range of values in external format. | ||||||||||||
| SYNOPSIS |
msbool mxqrng (char* attribute, char* lower_limit, char* limit_type_1,
char* upper_limit, char* limit_type_2)
| ||||||||||||
| USAGE |
flag = mxqrng (attribute, lower_limit, limit_type_1,
upper_limit, limit_type_2);
| ||||||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||||||
| WARNINGS | The program will fail if the arguments are incompatible. |
| DESCRIPTION | Compare an attribute value to a given range of values in internal format. | ||||||||||||
| SYNOPSIS |
msbool mxqrngi (char* attribute, addr lower_ptr, char* limit_type_1,
addr upper_ptr, char* limit_type_2)
| ||||||||||||
| USAGE |
flag = mxqrngi (attribute, &lower, limit_type_1,
&upper, limit_type_2);
| ||||||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||||||
| WARNINGS | The routine will fail if the arguments are incompatible. Using this routine results in non-portable code. |
| DESCRIPTION | Compare an attribute with a string. | ||||
| SYNOPSIS | void mxqseq (char* attribute, char* string) | ||||
| USAGE |
mxqseq (attribute, string);
| ||||
| RETURNS | None. | ||||
| WARNINGS | If the attribute and the string are not compatible (e.g., the attribute is a numeric data type and the string contains letters), the routine will fail, print an error message, and terminate the calling program. |
| DESCRIPTION | Retrieve a record from a table when a prior call with mxget failed; successive calls to mxreget all attempt to retrieve the same record. | ||
| SYNOPSIS | int mxreget (void) | ||
| USAGE |
flag = mxreget ();
| ||
| RETURNS | True (1) if successful; false (0) if all records have been retrieved. If the record is locked and mxerret is set, it returns -1; if the record is locked and mxerret is not set, it prints an error message and terminates the calling program. | ||
| WARNINGS | mxgetbegin must be called once before any calls to mxreget are made. mxgetend must be called after one or more calls to mxreget to do cleaning up. |
| DESCRIPTION | Retrieve the previous record from a table when a prior call with mxprev failed; successive calls to mxreprev all attempt to retrieve the same record. | ||
| SYNOPSIS | int mxreprev (void) | ||
| USAGE |
flag = mxreprev ();
| ||
| RETURNS | True (1) if successful; false (0) if all records have been retrieved. If the record is locked and mxerret is set, it returns -1; if the record is locked and mxerret is not set, it prints an error message and terminates the calling program. | ||
| WARNINGS | mxgetbegin must be called once before any calls to mxreprev are made. mxgetend must be called after one or more calls to mxreprev to do cleaning up. |
| DESCRIPTION | Assign a NULL value to all attributes in a record. | ||
| SYNOPSIS | void mxsetnull (char* table) | ||
| USAGE |
mxsetnull (table);
| ||
| RETURNS | None. | ||
| WARNINGS | None. |
| DESCRIPTION | Associate a given qualification with one or more records, and indicate how retrieved values should be sorted. | ||||||||||||||||
| SYNOPSIS |
msbool mxsrtbegin (char* indicator,
char* table_1, [ ... char* table_n,] (char*)0,
char* attr_1, char* type,
[char* attr_2, char* type, ...] (char*)0)
| ||||||||||||||||
| USAGE |
flag = mxsrtbegin (indicator, table_1, table_2, ... , CHARNIL,
attr_1, type, attr_2, type, ... , CHARNIL);
| ||||||||||||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful and mxerret is set; if unsuccessful and mxerret is not set, an error message is printed and the calling program terminated. | ||||||||||||||||
| WARNINGS | Nested calls to mxsrtbegin must be set up carefully. |
| DESCRIPTION | Cancel a transaction; return database to pre-transaction state. | ||
| SYNOPSIS | msbool mxtrcancel (void) | ||
| USAGE |
flag = mxtrcancel ();
| ||
| RETURNS | True (1) if successful; false (0) if not. | ||
| WARNINGS | Do not cancel a transaction in the middle of a retrieval loop (i.e., between calls to mxgetbegin and mxgetend) unpredictable results will ensue. |
| DESCRIPTION | Commit a transaction making all changes permanent. | ||
| SYNOPSIS | msbool mxtrcommit (void) | ||
| USAGE |
flag = mxtrcommit ();
| ||
| RETURNS | True (1) if successful; false (0) if not. | ||
| WARNINGS | Do not commit a transaction in the middle of a retrieval loop (i.e., between calls to mxgetbegin and mxgetend) unpredictable results will ensue. |
| DESCRIPTION | Roll back the transaction to the save point. | ||||
| SYNOPSIS | msbool mxtrrollback (char* savepoint) | ||||
| USAGE |
flag = mxtrrollback (savepoint);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||||
| WARNINGS | A transaction must be in progress and the save point must be set. |
| DESCRIPTION | Set a save point in the transaction. | ||||
| SYNOPSIS | msbool mxtrsave (char* savepoint) | ||||
| USAGE |
flag = mxtrsave (savepoint);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||||
| WARNINGS | A transaction must be in progress. |
| DESCRIPTION | Start a transaction. | ||
| SYNOPSIS | msbool mxtrstart (void) | ||
| USAGE |
flag = mxtrstart ();
| ||
| RETURNS | True (1) if successful; false (0) if not. Failure usually means a transaction is already in progress. | ||
| WARNINGS | Do not start a transaction in the middle of a retrieval loop (i.e., between calls to mxgetbegin and mxgetend) - unpredictable effects will ensue. |