RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

LIST_OBJ_ENTRY_HANDLER Reference

Stores application-defined data.

An application can use this structure to store any kind of application-defined data in a LIST_OBJ, even though Cert-C does not know the type of data structure the application requires. The application must set up the AllocAndCopy and Destructor callback functions to handle the type of data structure that it is using. These callback functions must recognize the type of data structure in value without being informed by the Cert-C function that passes the value to the callback. An application can use the AllocAndCopy feature to insert application-defined values into a list object.

Samples:

saltname.c, and userextn.c.

#include <certlist.h>

typedef struct LIST_OBJ_ENTRY_HANDLER {

  int (*AllocAndCopy) (
    POINTER *newValue,
    POINTER  value);

  VALUE_DESTRUCTOR Destructor;
} LIST_OBJ_ENTRY_HANDLER;

Data Fields

int(* AllocAndCopy )(POINTER *newValue, POINTER value)
 Allocates and copies the information given in value, then sets the pointer to the duplication in newValue. More...

VALUE_DESTRUCTOR Destructor
 Deallocates the value that was allocated by the AllocAndCopy callback, freeing all memory associated with it. More...


Field Documentation

int(* AllocAndCopy)( POINTER *newValue, POINTER value)
 

Allocates and copies the information given in value, then sets the pointer to the duplication in newValue. A successful operation returns zero 0; a failed operation returns the E_ALLOC error. If data is not valid, then no memory is allocated and the E_DATA error should be returned. This function is used by C_AddListObjectEntry() and C_InsertListObjectEntry() to add list object values into an existing list.

  • newValue - an output field containing the new copy of value that is returned by the AllocAndCopy function.
  • value - an input field containing list-object entry information that is used by the AllocAndCopy function.

VALUE_DESTRUCTOR Destructor
 

Deallocates the value that was allocated by the AllocAndCopy callback, freeing all memory associated with it. If value is (POINTER)NULL_PTR, then Destructor performs no operation. Destructor is used with C_DestroyListObject() and C_DeleteListObjectEntry() when a list-object value is deleted from an extension.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 067-001001-2720-001-000 - 2.7.2