Previous Topic

Next Topic

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. 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 c-tree Plus Error Codes 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);

Limitations

The resource_name field of the Resource Data Block is ignored.

See also

AddCtResource(), UpdateCtResource(), GetCtResource()