TRIPsystem Kernel API 8.3
|
Management of reports / output formats. More...
Functions | |
int | TdbCheckOutputFormat (void) |
Check the syntax of an output format. | |
int | TdbCopyOutputFormat (char *old_base, char *old_form, char *new_base, char *new_form, int *error) |
Create a copy of an output format. | |
int | TdbCurrentForm (char *base, char *form, int mode) |
Retrieve the name of the current defined default entry or output form. | |
int | TdbDeleteOutputFormat (char *base, char *format) |
Delete an output format. | |
int | TdbGetComment (char *comment) |
Load the description of a CONTROL record. | |
int | TdbGetFormLine (char *line, int *lineLength) |
Load a format line. | |
int | TdbGetOutputFormat (char *base, char *format) |
Load an output format. | |
int | TdbPutComment (char *comment) |
Store the description of a CONTROL record. | |
int | TdbPutFormLine (char *line, int lineLength) |
Load a format line into an internal format buffer. | |
int | TdbPutOutputFormat (void) |
Store an output format. | |
Management of reports / output formats.
The TRIP report management functions offer functionality for administration (creation, alteration and deletetion) of reports (a.k.a. output formats).
int TdbCheckOutputFormat | ( | void | ) |
Check the syntax of an output format.
The function TdbCheckOutputFormat() checks the syntax of an output format previously loaded by a call to either the TdbGetOutputFormat() or TdbCopyOutputFormat() functions.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
3394 | Format syntax error at or near line lineno. | |
5218 | No initial left delimiter in format spec. | Premature end of format specification. |
int TdbCopyOutputFormat | ( | char * | old_base, |
char * | old_form, | ||
char * | new_base, | ||
char * | new_form, | ||
int * | error | ||
) |
Create a copy of an output format.
old_base | Name of source database |
old_form | Name of source output format |
new_base | Name of target database |
new_form | Name of new output format |
error | Error position |
The function TdbCopyOutputFormat() starts the copying of an output format from one database to another or to a form with a different name within the same database. The calling process must subsequently call the functions TdbCheckOutputFormat() and TdbPutOutputFormat() to store the new format in the CONTROL file.
The old_base
parameter is passed a character string as the name of the source database from which the existing form will be copied.
The old_form
parameter is passed a haracter string as the name of the source output format to be copied.
The new_base
parameter is passed a character string as the name of the target database design to which the new form will be copied.
The new_form
parameter is passed a character string as the name of the new output format to be created by the copy operation.
The error
parameter is passed a pointer to an int
variable that will receive the positional number of the argument that caused the failure. Valid values are:
Error Value | Explanation |
---|---|
0 | No errors detected |
1 | The source database does not exist |
2 | The source output format does not exist. Alternatively the user calling this function is not owner of the format. |
3 | The target database does not exist. Alternatively, the user calling this function has no write access to the database |
4 | The new output format cannot be created. The TRIPkernel detected a parsing error. |
Code | Description | Explanation |
---|---|---|
34051 | Output format copied. | The function completed its operations without error. |
7970 | Output format {database.format} not found. | The specified output format did not exist in the source database. |
8066 | Already existing output format. | |
11554 | Database name is missing. | |
15010 | 1 is a database cluster. | The database name passed to the function refers to a database cluster and not a single database. |
int TdbCurrentForm | ( | char * | base, |
char * | form, | ||
int | mode | ||
) |
Retrieve the name of the current defined default entry or output form.
base | Name of database |
form | Name of form |
mode | Mode or type of form. |
The TdbCurrentForm() returns the name of the current defined default entry or output form, as defined by the calling process with the CCL commands DEfine Format= {x} and DEfine EFOrm= {x} .
The base
parameter is passed a character string as the name of the database for which form information is required.
The form
parameter is passed a character string to receive a string as the name of the form
The mode
parameter is passed an int
that defines the type of the current form to retrieve. Valid values are:
Symbolic Constant | Constant Value | Explanation |
---|---|---|
CURRENT_OUTPUT | 1 | Retrieve the current default output form |
CURRENT_ENTRY | 2 | Retrieve the current default entry form |
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
610 | Database {1} not found. | |
1730 | Default data entry form for {1} not specified. | |
2530 | No access to database {1}. | |
3042 | {1} is not a database. | |
15234 | Missing database name. | |
21666 | No default output format defined for {1}. |
int TdbDeleteOutputFormat | ( | char * | base, |
char * | format | ||
) |
Delete an output format.
base | Database name |
format | Format name |
The function TdbDeleteOutputFormat() deletes an output format. A format can only be deleted by the owner of the format or the owner of the database to which the format belongs.
The base
parameter is passed a character string as the database name.
The format
parameter is passed a character string as the name of the output format to be deleted.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
7522 | Database {2} is OS write protected. | |
11170 | Cannot find COMMAND file {1}{2}{3} | |
9090 | Database {2} is locked by another user, try again later. | |
11554 | Database name is missing. | |
11586 | Output format name is missing. | |
14722 | You are not the creator of {1}{3}{2} | |
15010 | {1} is a database cluster. | The database name passed to the function refers to a database cluster and not a single database. |
15618 | Only alphanumerics/underscores allowed in names. | |
17474 | A TRIP runtime version cannot create databases. |
int TdbGetComment | ( | char * | comment | ) |
Load the description of a CONTROL record.
comment | String buffer that receives the description of a CONTROL record. |
The function TdbGetComment() loads the description of a CONTROL record into the buffer provided. The call has to be preceded by a call to one of the TdbCopyOutputFormat(), TdbCopyProcedure(), TdbGetOutputFormat() or TdbGetProcedure() functions.
The comment
parameter is passed a character string as buffer for storing the description of a CONTROL record.
This function always succeeds.
int TdbGetFormLine | ( | char * | line, |
int * | lineLength | ||
) |
Load a format line.
line | Format line |
lineLength | Length of format line |
The function TdbGetFormLine() loads a single line from a format into the buffer provided. The format must have been previously loaded into the internal form buffer by using the TdbGetOutputFormat() function. Repeated calls to TdbGetFormLine() can be made until a status code of zero is returned this allows processing of the complete form.
The line
parameter is passed a character string to receive a line from the selected output format specification.
The lineLength
parameter is passed a pointer to an int
variable to receive the length of the line to be returned from the output format specification.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
0 | No more lines. |
int TdbGetOutputFormat | ( | char * | base, |
char * | format | ||
) |
Load an output format.
base | Database name |
format | Format name |
The function TdbGetOutputFormat() loads an output format for the specified database into the internal format buffer for further processing. The output format can only be loaded by the owner of the format or the owner of the database to which the format belongs.
This function is intended primarily for use within the TRIPclassic environment.
The base
parameter is passed a character string as the name of the database for which an output format is to be retrieved.
The format
parameter is passed a character string as the name of the format to be retrieved.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
7970 | Output format database.format not found. | The specified output format did not exist in the source database. |
11554 | Database name is missing. | |
11586 | Output format name is missing. | |
14722 | You are not the creator of {1}{3}{2} | |
15618 | Only alphanumerics/underscores allowed in names. |
int TdbPutComment | ( | char * | comment | ) |
Store the description of a CONTROL record.
comment | Description of CONTROL record |
The function TdbPutComment() stores a description of the CONTROL record previously loaded into the internal buffer. The call has to be preceded by a call to one of the TdbCopyOutputFormat(), TdbCopyProcedure(), TdbGetOutputFormat() or TdbGetProcedure() functions.
The comment
parameter is passed a character string as the description of a CONTROL record.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
int TdbPutFormLine | ( | char * | line, |
int | lineLength | ||
) |
Load a format line into an internal format buffer.
line | Line to load into format |
lineLength | Length of line |
The function TdbPutFormLine() loads a single line into the internal output format buffer, which must have been previously loaded with an output format by a call to either of the TdbGetOutputFormat() or TdbCopyOutputFormat() functions.
The first call to TdbPutFormLine() will empty the format buffer and make the supplied line the first line in the format, while subsequent calls append lines to the format. The proper way to modify an existing output format is therefore to first read all lines by repeatedly calling TdbGetFormLine() until it returns an error code, then put each line back (whether it was modified or not) by calling the TdbPutFormLine() function. It is for the application program to provide intermediate storage for the lines. Calls to TdbGetFormLine() and TdbPutFormLine() should not be intermingled.
The functions TdbCheckOutputFormat() and then TdbPutOutputFormat() must be called if the format is to be stored.
The line
parameter is passed a character string as the line to be loaded into the format.
The line
length parameter is passed an int
as the length of the format line held in the line
parameter.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
int TdbPutOutputFormat | ( | void | ) |
Store an output format.
The function TdbPutOutputFormat() writes the output format from an internal format buffer into the CONTROL file. The internal buffer must previously have been loaded by a call to either the TdbGetOutputFormat() or TdbCopyOutputFormat() . Furthermore, before the format is committed to CONTROL a syntax check must be performed by a call of the TdbCheckOutputFormat() .
Code | Description | Explanation |
---|---|---|
32643 | Format {1} altered for database {2}. | The function completed its operations without error. |
32675 | Format {1} created for database {2}. | The function completed its operations without error. |
11970 | Syntax check of {2}{3}{1} has not been performed | |
14722 | You are not the creator of {1}{3}{2} | |
17474 | A TRIP runtime version cannot create databases. |