Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Resource Identification

Within a given data file, a Resource is identified by three elements:

  • Resource Type (unsigned long integer),
  • Resource Number (unsigned long integer),
  • Resource Name (null terminated string).

Within each file, you can identify a Resource by its unique combination of Type and Number, or by its Name.

Note: The Resource Name is not guaranteed to be unique.

Resource Type

Resource Type gathers Resources into related groups. Resource Types in the range of 1 to 127 are reserved for use by FairCom. These are special Resources used by the FairCom Server and d-tree. Resource Types in the range of 128 to 65536 are also reserved. These are assigned to third-party developers by FairCom. Resource Types from 65537 and above are available to the programmer to be assigned as desired.

Resource Number

There are no restrictions on assigning Resource Numbers. They separate various Resources within a given Resource Type. When adding a Resource to a file, c-tree can assign the next available value for this Resource Type in the referenced file.

Resource Name

You can use the Resource Name as a way to access Resources in a file instead of using the Type and Number. You may find it easier to understand your code if you use a symbolic name rather than a pair of numbers. If you are adding a number of Resources to a data file over a period of time you may not know what Resource Number is being used, particularly since you can have c-tree assign the next available Resource Number. Access via Resource Name can be simpler than trying to keep track of what Number your Resource has been assigned.

On the other hand, be careful in assigning Resource Names. c-tree cannot guarantee that each Resource Name is unique within a file. It is possible to add a Resource to a file that has a Name already used in this file.

Resource Names are optional. You do not have to assign one to a Resource. The Resource Name is a null terminated character string of any length, although we recommend that you do not make them too long. Names starting with FC! are reserved for use by FairCom. Names starting with RD! are reserved for Resources assigned to third-party developers by FairCom.

TOCIndex