hfp
3
HAL Library

# hfp

## Synopsis

    #define     HFP_GNUC_PRINTF                 (format_idx, arg_idx)
    #define     HFP_N_ELEMENTS                  (arr)
    typedef     boolean;
    enum        HFPLogLevel;
    extern      LibHalContext *hfp_ctx;
    extern      char *hfp_udi;
    extern      DBusError hfp_error;
    boolean     hfp_init                        (int argc,
                                                 char **argv);
    void*       hfp_malloc                      (size_t size);
    void*       hfp_malloc0                     (size_t size);
    #define     hfp_new                         (type, number)
    #define     hfp_new0                        (type, number)
    char*       hfp_strdup                      (const char *str);
    char*       hfp_strndup                     (const char *str,
                                                 size_t size);
    char*       hfp_strdup_printf               (const char *format);
    void        hfp_free                        (void *mem);
    void        hfp_logv                        (HFPLogLevel log_level,
                                                 const char *format,
                                                 va_list args);
    void        hfp_info                        (const char *format);
    void        hfp_warning                     (const char *format);
    void        hfp_critical                    (const char *format);
    void        volume_id_log                   (const char *format);
    boolean     hfp_getenv_bool                 (const char *variable);
    void        hfp_gettimeofday                (struct timeval *t);
    void        hfp_timevaladd                  (struct timeval *t1,
                                                 const struct timeval *t2);
    void        hfp_timevalsub                  (struct timeval *t1,
                                                 const struct timeval *t2);
    #define     hfp_timevalcmp                  (t1, t2, cmp)

## Description

## Details

### HFP_GNUC_PRINTF()

    #define     HFP_GNUC_PRINTF(format_idx, arg_idx)

`format_idx` :

`arg_idx` :

### HFP_N_ELEMENTS()

    #define HFP_N_ELEMENTS(arr)		(sizeof(arr) / sizeof((arr)[0]))

`arr` :

### boolean

    typedef int boolean;

### enum HFPLogLevel

    typedef enum
    {
      HFP_LOG_LEVEL_DEBUG,
      HFP_LOG_LEVEL_INFO,
      HFP_LOG_LEVEL_WARNING,
      HFP_LOG_LEVEL_CRITICAL
    } HFPLogLevel;

### hfp_ctx

    extern LibHalContext *hfp_ctx;

### hfp_udi

    extern char *hfp_udi;

### hfp_error

    extern DBusError hfp_error;

### hfp_init ()

    boolean     hfp_init                        (int argc,
                                                 char **argv);

`argc` :

`argv` :

Returns :

### hfp_malloc ()

    void*       hfp_malloc                      (size_t size);

`size` :

Returns :

### hfp_malloc0 ()

    void*       hfp_malloc0                     (size_t size);

`size` :

Returns :

### hfp_new()

    #define hfp_new(type, number)	((type *) hfp_malloc(sizeof(type) * number))

`type` :

`number` :

### hfp_new0()

    #define hfp_new0(type, number)	((type *) hfp_malloc0(sizeof(type) * number))

`type` :

`number` :

### hfp_strdup ()

    char*       hfp_strdup                      (const char *str);

`str` :

Returns :

### hfp_strndup ()

    char*       hfp_strndup                     (const char *str,
                                                 size_t size);

`str` :

`size` :

Returns :

### hfp_strdup_printf ()

    char*       hfp_strdup_printf               (const char *format);

`format` :

Returns :

### hfp_free ()

    void        hfp_free                        (void *mem);

`mem` :

### hfp_logv ()

    void        hfp_logv                        (HFPLogLevel log_level,
                                                 const char *format,
                                                 va_list args);

`log_level` :

`format` :

`args` :

### hfp_info ()

    void        hfp_info                        (const char *format);

`format` :

### hfp_warning ()

    void        hfp_warning                     (const char *format);

`format` :

### hfp_critical ()

    void        hfp_critical                    (const char *format);

`format` :

### volume_id_log ()

    void        volume_id_log                   (const char *format);

`format` :

### hfp_getenv_bool ()

    boolean     hfp_getenv_bool                 (const char *variable);

`variable` :

Returns :

### hfp_gettimeofday ()

    void        hfp_gettimeofday                (struct timeval *t);

`t` :

### hfp_timevaladd ()

    void        hfp_timevaladd                  (struct timeval *t1,
                                                 const struct timeval *t2);

`t1` :

`t2` :

### hfp_timevalsub ()

    void        hfp_timevalsub                  (struct timeval *t1,
                                                 const struct timeval *t2);

`t1` :

`t2` :

### hfp_timevalcmp()

    #define     hfp_timevalcmp(t1, t2, cmp)

`t1` :

`t2` :

`cmp` :