XML Security Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# errors.h

## Name

errors.h -- The errors reporting functions.

## Synopsis

    #define     XMLSEC_ERRORS_LIB
    #define     XMLSEC_ERRORS_FUNCTION
    #define     XMLSEC_ERRORS_R_MALLOC_FAILED
    #define     XMLSEC_ERRORS_R_XMLSEC_FAILED
    #define     XMLSEC_ERRORS_R_CRYPTO_FAILED
    #define     XMLSEC_ERRORS_R_XML_FAILED
    #define     XMLSEC_ERRORS_R_XSLT_FAILED
    #define     XMLSEC_ERRORS_R_IO_FAILED
    #define     XMLSEC_ERRORS_R_INVALID_TRANSFORM
    #define     XMLSEC_ERRORS_R_INVALID_TRANSFORM_DATA
    #define     XMLSEC_ERRORS_R_INVALID_TRANSFORM_OR_KEY
    #define     XMLSEC_ERRORS_R_INVALID_KEY
    #define     XMLSEC_ERRORS_R_INVALID_KEY_DATA
    #define     XMLSEC_ERRORS_R_INVALID_KEY_SIZE
    #define     XMLSEC_ERRORS_R_INVALID_KEY_ORIGIN
    #define     XMLSEC_ERRORS_R_KEY_NOT_FOUND
    #define     XMLSEC_ERRORS_R_INVALID_SIZE
    #define     XMLSEC_ERRORS_R_INVALID_DATA
    #define     XMLSEC_ERRORS_R_INVALID_TYPE
    #define     XMLSEC_ERRORS_R_INVALID_USAGE
    #define     XMLSEC_ERRORS_R_INVALID_NODE
    #define     XMLSEC_ERRORS_R_INVALID_NODESET
    #define     XMLSEC_ERRORS_R_INVALID_NODE_CONTENT
    #define     XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE
    #define     XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT
    #define     XMLSEC_ERRORS_R_SAME_DOCUMENT_REQUIRED
    #define     XMLSEC_ERRORS_R_NODE_NOT_FOUND
    #define     XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL
    #define     XMLSEC_ERRORS_R_CERT_VERIFY_FAILED
    #define     XMLSEC_ERRORS_R_CERT_NOT_FOUND
    #define     XMLSEC_ERRORS_R_CERT_REVOKED
    #define     XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE
    #define     XMLSEC_ERRORS_R_ASSERTION
    #define     XMLSEC_ERRORS_R_DISABLED
    void        (*xmlSecErrorsCallback)         (const char *file,
                                                 int line,
                                                 const char *func,
                                                 int reason,
                                                 const char *msg);
    void        xmlSecErrorsInit                (void);
    void        xmlSecErrorsShutdown            (void);
    void        xmlSecErrorsSetCallback         (xmlSecErrorsCallback callback);
    extern      int xmlSecPrintErrorMessages;
    #define     XMLSEC_ERRORS_HERE
    void        xmlSecError                     (const char *file,
                                                 int line,
                                                 const char *func,
                                                 int reason,
                                                 const char *msg,
                                                 ...);
    #define     xmlSecAssert                    ( p )
    #define     xmlSecAssert2                   ( p, ret )

## Description

All errors are reported to application provided callback function. The default callback function reports an error to OpenSSL using ERR_put_error() function and to LibXML using xmlGenericError() function.

## Details

### XMLSEC_ERRORS_LIB

    #define XMLSEC_ERRORS_LIB			(ERR_LIB_USER + 57)

Macro. The XMLSec library id for OpenSSL errors reporting functions.

### XMLSEC_ERRORS_FUNCTION

    #define XMLSEC_ERRORS_FUNCTION			0

Macro. The XMLSec library functions OpenSSL errors reporting functions.

### XMLSEC_ERRORS_R_MALLOC_FAILED

    #define XMLSEC_ERRORS_R_MALLOC_FAILED		 1

Failed to allocate memory error.

### XMLSEC_ERRORS_R_XMLSEC_FAILED

    #define XMLSEC_ERRORS_R_XMLSEC_FAILED		 2

An XMLSec function failed.

### XMLSEC_ERRORS_R_CRYPTO_FAILED

    #define XMLSEC_ERRORS_R_CRYPTO_FAILED		 3

Crypto (OpenSSL) function failed.

### XMLSEC_ERRORS_R_XML_FAILED

    #define XMLSEC_ERRORS_R_XML_FAILED		 4

LibXML function failed.

### XMLSEC_ERRORS_R_XSLT_FAILED

    #define XMLSEC_ERRORS_R_XSLT_FAILED		 5

LibXSLT function failed.

### XMLSEC_ERRORS_R_IO_FAILED

    #define XMLSEC_ERRORS_R_IO_FAILED		 6

IO operation failed.

### XMLSEC_ERRORS_R_INVALID_TRANSFORM

    #define XMLSEC_ERRORS_R_INVALID_TRANSFORM	 10

Invlaid transform.

### XMLSEC_ERRORS_R_INVALID_TRANSFORM_DATA

    #define XMLSEC_ERRORS_R_INVALID_TRANSFORM_DATA	 11

Invlaid transform data.

### XMLSEC_ERRORS_R_INVALID_TRANSFORM_OR_KEY

    #define XMLSEC_ERRORS_R_INVALID_TRANSFORM_OR_KEY 12

Invalid transform or key.

### XMLSEC_ERRORS_R_INVALID_KEY

    #define XMLSEC_ERRORS_R_INVALID_KEY		 13

Key is invalid.

### XMLSEC_ERRORS_R_INVALID_KEY_DATA

    #define XMLSEC_ERRORS_R_INVALID_KEY_DATA	 14

Key data is invalid.

### XMLSEC_ERRORS_R_INVALID_KEY_SIZE

    #define XMLSEC_ERRORS_R_INVALID_KEY_SIZE	 15

Invalid key size.

### XMLSEC_ERRORS_R_INVALID_KEY_ORIGIN

    #define XMLSEC_ERRORS_R_INVALID_KEY_ORIGIN	 16

Invalid key origin.

### XMLSEC_ERRORS_R_KEY_NOT_FOUND

    #define XMLSEC_ERRORS_R_KEY_NOT_FOUND		 17

Key not found.

### XMLSEC_ERRORS_R_INVALID_SIZE

    #define XMLSEC_ERRORS_R_INVALID_SIZE		 18

Invalid size.

### XMLSEC_ERRORS_R_INVALID_DATA

    #define XMLSEC_ERRORS_R_INVALID_DATA		 19

Invalid data.

### XMLSEC_ERRORS_R_INVALID_TYPE

    #define XMLSEC_ERRORS_R_INVALID_TYPE		 21

Invalid type.

### XMLSEC_ERRORS_R_INVALID_USAGE

    #define XMLSEC_ERRORS_R_INVALID_USAGE		 22

Invalid usage.

### XMLSEC_ERRORS_R_INVALID_NODE

    #define XMLSEC_ERRORS_R_INVALID_NODE	 	 23

Invalid node,

### XMLSEC_ERRORS_R_INVALID_NODESET

    #define XMLSEC_ERRORS_R_INVALID_NODESET	 	 24

Invalid nodes set,

### XMLSEC_ERRORS_R_INVALID_NODE_CONTENT

    #define XMLSEC_ERRORS_R_INVALID_NODE_CONTENT	 25

Invalid node content.

### XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE

    #define XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE	 26

Invalid node attribute.

### XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT

    #define XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT	 27

Node already present,

### XMLSEC_ERRORS_R_SAME_DOCUMENT_REQUIRED

    #define XMLSEC_ERRORS_R_SAME_DOCUMENT_REQUIRED	 28

The transform requires the same document.

### XMLSEC_ERRORS_R_NODE_NOT_FOUND

    #define XMLSEC_ERRORS_R_NODE_NOT_FOUND 	 	 29

Node not found.

### XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL

    #define XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL	 30

Max allowed retrievals level reached.

### XMLSEC_ERRORS_R_CERT_VERIFY_FAILED

    #define XMLSEC_ERRORS_R_CERT_VERIFY_FAILED	 41

Certificate verification failed.

### XMLSEC_ERRORS_R_CERT_NOT_FOUND

    #define XMLSEC_ERRORS_R_CERT_NOT_FOUND		 42

Requested certificate is not found.

### XMLSEC_ERRORS_R_CERT_REVOKED

    #define XMLSEC_ERRORS_R_CERT_REVOKED		 43

The certificate is revoked.

### XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE

    #define XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE 	 51

The <dsig:Reference> validation failed.

### XMLSEC_ERRORS_R_ASSERTION

    #define XMLSEC_ERRORS_R_ASSERTION		 100

Invalid assertion.

### XMLSEC_ERRORS_R_DISABLED

    #define XMLSEC_ERRORS_R_DISABLED		 101

The feature is disabled during compilation. Check './configure --help' for details on how to enable it.

### xmlSecErrorsCallback ()

    void        (*xmlSecErrorsCallback)         (const char *file,
                                                 int line,
                                                 const char *func,
                                                 int reason,
                                                 const char *msg);

The errors reporting callback function typedef.

`file` : | the error origin filename (__FILE__).
`line` : | the error origin line number (__LINE__).
`func` : | the error origin function (__FUNCTIION__).
`reason` : | the error code.
`msg` : | the error message.

### xmlSecErrorsInit ()

    void        xmlSecErrorsInit                (void);

Initializes the errors reporting. It is called from xmlSecInit() function. and applications must not call this function directly.

### xmlSecErrorsShutdown ()

    void        xmlSecErrorsShutdown            (void);

Cleanups the errors reporting. It is called from xmlSecShutdown() function. and applications must not call this function directly.

### xmlSecErrorsSetCallback ()

    void        xmlSecErrorsSetCallback         (xmlSecErrorsCallback callback);

Sets the errors callback function `callback` that will be called every time an error occurs.

`callback` : | the errors callback function.

### xmlSecPrintErrorMessages

    extern int xmlSecPrintErrorMessages;

The flag that determines whether the error message will be printed out immidiatelly. For default errors reporting callback, this flag determines whether the error is reported to LibXML library or not.

### XMLSEC_ERRORS_HERE

    #define XMLSEC_ERRORS_HERE			__FILE__,__LINE__,__FUNCTION__

The macro that specifies the location (file, line and function) for the xmlSecError() function.

### xmlSecError ()

    void        xmlSecError                     (const char *file,
                                                 int line,
                                                 const char *func,
                                                 int reason,
                                                 const char *msg,
                                                 ...);

Reports an error.

`file` : | the error origin filename (__FILE__).
`line` : | the error origin line number (__LINE__).
`func` : | the error origin function (__FUNCTIION__).
`reason` : | the error code.
`msg` : | the error message in printf format.
`...` : | the parameters for the `msg`.

### xmlSecAssert()

    #define     xmlSecAssert( p )

Macro. Verifies that `p` is true and calls return() otherwise.

`p` : | the expression.

### xmlSecAssert2()

    #define     xmlSecAssert2( p, ret )

Macro. Verifies that `p` is true and calls return(`ret`) otherwise.

`p` : | the expression.
`ret` : | the return value.

<<< Previous Page | Home | Up | Next Page >>>
xmlenc.h | debug.h