FairCom Corporation


F.89 DeleteCtResource


Delete Resource from file.

Short Name

DELRES

TYPE

Low-level file function

DECLARATION

COUNT DeleteCtResource(COUNT filno, pVOID resptr)

DESCRIPTION

DeleteCtResource is used to delete a Resource from data file filno. filno must be opened in ctEXCLUSIVE mode. If there is a record lock on this Resource, the lock is automatically freed. Obtain a lock with GetCtResource using RES_LOCK mode.

resptr points to a Resource Data Block as shown below. This is the same structure as used in the other Resource functions.

Byte Offset
Data Type
Field Name
0 - 3
unsigned long integer
Resource Type
4 - 7
unsigned long integer
Resource Number
8 - m
null terminated character string
Resource Name

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful Resource deletion.
57
DADV_ERR
Proper lock not found by the c-tree Server.
401
RNON_ERR
Resources have not been enabled for this file.
408
RNOT_ERR
Resource not found.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

structure { /* Resource Data Block */
ULONG resource_type;
ULONG resource_number;
TEXT resource_name[80];
} my_resource;
my_resource.resource_type = 0x10001L; /* 65537 */
my_resource.resource_number = 100;
if ("DeleteCtResource(datno,&my_resource,) == 0 )
printf("\nThe resource has been deleted");
else
printf("\nCould not delete resource. Error #%d", uerr_cod);

Limitation

The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSetHgh() and ctGetHgh() functions to set or get the high order 4 bytes of the file offset.

SEE ALSO

AddCtResource, UpdateCtResource, and GetCtResource.


FairCom Corporation
www.faircom.com