# Core functionality

## Functions

discover_error_t * | discover_error_new (void)
void * | _discover_create_message (discover_error_t **status, char *message)
void | discover_error_free (discover_error_t *status)
char * | discover_strerror (discover_error_t *err)
int | discover_major_version (void)
int | discover_minor_version (void)
int | discover_micro_version (void)

## Function Documentation

void* _discover_create_message | ( | discover_error_t ** | status,
|  | char * | message
| ) |

| Allocate memory for a char * variable. This routine was written for discover_error_t struct. Definition at line 82 of file core.c. Referenced by discover_error_new().

void discover_error_free | ( | discover_error_t * | status | ) |

| Free a discover_error_t structure. Definition at line 95 of file core.c. References discover_error::message.

discover_error_t* discover_error_new | ( | void |  | ) |

| Allocate and initialize a discover_error_t structure. Definition at line 68 of file core.c. References _discover_create_message(), discover_error::code, discover_error::create_message, and discover_error::message.

int discover_major_version | ( | void |  | ) |

| Get the major version number. Definition at line 124 of file core.c.

int discover_micro_version | ( | void |  | ) |

| Get the micro version number. Definition at line 142 of file core.c.

int discover_minor_version | ( | void |  | ) |

| Get the minor version number. Definition at line 133 of file core.c.

char* discover_strerror | ( | discover_error_t * | err | ) |

Convert an error code to a human-readable string localized according to the current locale (XXX: no i18n yet).

Parameters:

  | err | Error code to convert

Definition at line 111 of file core.c.

References discover_error::code.