Main Page   Modules   Data Structures   File List   Data Fields   Globals  

dar_sup_exception Struct Reference
[Archive operations]

Container for exceptions that occur during operations. More...

#include <libdarc.h>


Data Fields

U_16 type
 An error code returned from an operation function.

char * message
 An exception message if an error occured; otherwise NULL.


Detailed Description

Container for exceptions that occur during operations.

Unless otherwise noted it is optional to pass an exception container to an operation function. If NULL is passed instead no exception type or message data will be extractable.

An error condition is often detectable in other ways. When a pointer is to be returned, a null value indicates error. In general, a boolean return indicates success or non-success. If a returned boolean is to indicate a test outcome it is generally not possible to determine if an exception has occured without passing an exception container. In such cases the data from the operation function, which returns whatever data it is able to collect, will have to be taken as is.

When passed to a function the type field will always be set be equal to an error status constant. Success is equal to LIBDAR_NOEXCEPT, which is equal to zero. The message will be set to NULL when no exception has occured. If an exception has occured a new string will be allocated for an error message (if there is no message or there is not enough memory, NULL will still be returned with an error condition). Of course, the string belongs to the function caller.

The function dar_sup_exception_destroy should be used to free any memory allocated objects in the structure. Using this function is guaranteed to free all memory allocated to any members added to the struct in later C binding releases.

Definition at line 1361 of file libdarc.h.


The documentation for this struct was generated from the following file: