- Home
- Download
- News
- Documentation

- FAQ
- Tutorial
- API reference
- Examples

- XML Digital Signature

- Online Verifier

- XML Encryption
- XML Canonicalization
- Reporting Bugs
- Mailing list
- Related
- Authors

# xmlsec

## Name

xmlsec -- Utility functions.

## Synopsis

    #define             ATTRIBUTE_UNUSED
    #define             XMLSEC_FUNC_TO_PTR                  (func_type,
                                                             func)
    #define             XMLSEC_PTR_TO_FUNC                  (func_type,
                                                             ptr)
    #define             XMLSEC_PTR_TO_FUNC_IMPL             (func_type)
    #define             XMLSEC_SIZE_BAD_CAST                (val)
    #define             xmlSecByte
    #define             xmlSecCheckVersion
    #define             xmlSecCheckVersionExact
    intxmlSecCheckVersionExt               (int major,
                                                             int minor,
                                                             int subminor,
                                                             xmlSecCheckVersionMode mode);
    enum                xmlSecCheckVersionMode;
    intxmlSecInit                          (void);
    typedef             xmlSecPtr;
    intxmlSecShutdown                      (void);
    #define             xmlSecSize

## Description

Utility functions.

## Details

### ATTRIBUTE_UNUSED

    #define ATTRIBUTE_UNUSED

Macro used to signal to GCC unused function parameters

### XMLSEC_FUNC_TO_PTR()

    #define             XMLSEC_FUNC_TO_PTR(func_type, func)

Macro converts from "func_type" function pointer to "void*" pointer.

`func_type` : | the function type.
`func` : | the "func_type" function pointer to be converted.

### XMLSEC_PTR_TO_FUNC()

    #define             XMLSEC_PTR_TO_FUNC(func_type, ptr)

Macro converts from "void*" pointer to "func_type" function pointer.

`func_type` : | the function type.
`ptr` : | the "void*" pointer to be converted.

### XMLSEC_PTR_TO_FUNC_IMPL()

    #define             XMLSEC_PTR_TO_FUNC_IMPL(func_type)

Macro declares helper functions to convert between "void *" pointer and function pointer.

`func_type` : | the function type.

### XMLSEC_SIZE_BAD_CAST()

    #define XMLSEC_SIZE_BAD_CAST(val)               ((xmlSecSize)(val))

Bad cast to xmlSecSize

`val` : | the value to cast

### xmlSecByte

    #define xmlSecByte                              unsigned char

One byte. Should be typedef instead of define but it will break ABI (todo).

### xmlSecCheckVersion

    #define             xmlSecCheckVersion()

Macro. Returns 1 if the loaded xmlsec library version ABI compatible with the one used to compile the caller, 0 if it does not or a negative value if an error occurs.

### xmlSecCheckVersionExact

    #define             xmlSecCheckVersionExact()

Macro. Returns 1 if the loaded xmlsec library version exactly matches the one used to compile the caller, 0 if it does not or a negative value if an error occurs.

### xmlSecCheckVersionExt ()

    int                 xmlSecCheckVersionExt               (int major,
                                                             int minor,
                                                             int subminor,
                                                             xmlSecCheckVersionMode mode);

Checks if the loaded version of xmlsec library could be used.

`major` : | the major version number.
`minor` : | the minor version number.
`subminor` : | the subminor version number.
`mode` : | the version check mode.
Returns : | 1 if the loaded xmlsec library version is OK to use 0 if it is not or a negative value if an error occurs.

### enum xmlSecCheckVersionMode

    typedef enum {
        xmlSecCheckVersionExactMatch = 0,
        xmlSecCheckVersionABICompatible
    } xmlSecCheckVersionMode;

The xmlsec library version mode.

`xmlSecCheckVersionExactMatch` | the version should match exactly.
`xmlSecCheckVersionABICompatible` | the version should be ABI compatible.

### xmlSecInit ()

    int                 xmlSecInit                          (void);

Initializes XML Security Library. The depended libraries (LibXML and LibXSLT) must be initialized before.

Returns : | 0 on success or a negative value otherwise.

### xmlSecPtr

    typedef void*                                   xmlSecPtr;

Void pointer.

### xmlSecShutdown ()

    int                 xmlSecShutdown                      (void);

Clean ups the XML Security Library.

Returns : | 0 on success or a negative value otherwise.

### xmlSecSize

    #define xmlSecSize                              unsigned int

Size of something. Should be typedef instead of define but it will break ABI (todo).