Meaning of the First Long in a Cluster

From InterBase
Jump to: navigation, search

Go Up to Parsing the Status Vector


The first long in any cluster is a numeric descriptor. By examining the numeric descriptor for any cluster, you can always determine the:

  • Total number of longs in the cluster.
  • Kind of information reported in the remainder of the cluster.
  • Starting location of the next cluster in the status vector.
Interpretation of the First Long in Status Vector Clusters
Value Longs in cluster Meaning

0

End of error information in the status vector.

1

2

Second long is an InterBase error code.

2

2

Second long is the address of string used as a replaceable parameter in a generic InterBase error message.

3

3

Second long is the length, in bytes, of a variable-length string provided by the operating system (most often this string is a file name); third long is the address of the string.

4

2

Second long is a number used as a replaceable parameter in a generic InterBase error message.

5

2

Second long is the address of an error message string requiring no further processing before display.

6

2

Second long is a VAX/VMS error code.

7

2

Second long is a UNIX error code.

8

2

Second long is an Apollo Domain error code.

9

2

Second long is an MS-DOS or OS/2 error code.

10

2

Second long is an HP MPE/XL error code.

11

2

Second long is an HP MPE/XL IPC error code.

12

2

Second long is a NeXT/Mach error code.

Note: As InterBase is adapted to run on other hardware and software platforms, additional numeric descriptors for specific platform and operating system error codes will be added to the end of this list.

By including ibase.h at the start of your source code, you can use a series of #defines to substitute for hard-coded numeric descriptors in the status vector parsing routines you write. The advantages of using these #defines over hard-coding the descriptors are:

  • Your code will be easier to read.
  • Code maintenance will be easier should the numbering scheme for numeric descriptors change in a future release of InterBase.

The following table lists the #define equivalents of each numeric descriptor:

#defines for Status Vector Numeric Descriptors
Value

#define

Value

#define

0

isc_arg_end

8

isc_arg_domain

1

isc_arg_gds

9

isc_arg_dos

2

isc_arg_string

10

isc_arg_mpexl

3

isc_arg_cstring

11

isc_arg_mpexl_ipc

4

isc_arg_number

15

isc_arg_next_mach

5

isc_arg_interpreted

16

isc_arg_netware

6

isc_arg_vms

17

isc_arg_win32

7

isc_arg_unix

For an example of code that uses these defines, see Status Vector Parsing Example.