Fix a couple errors in the README
This commit is contained in:
@@ -64,10 +64,10 @@ The library uses integer values to specify error codes inside of its context. Th
|
|||||||
|
|
||||||
You can define additional error types by defining additional `AKERR_xxxxx` values. Error values up to 255 are reserved by the library (`AKERR_xxxxx` begins where `errno` stops), so please begin your error values at 256. When you add additional error codes, you need to define `-DAKERR_MAX_ERR_VALUE=n` to the compiler, where `n` is the maximum error code you have defined. If you define custom error codes, `AKERR_MAX_ERR_VALUE` must be >= 256 or the compiler will throw an error.
|
You can define additional error types by defining additional `AKERR_xxxxx` values. Error values up to 255 are reserved by the library (`AKERR_xxxxx` begins where `errno` stops), so please begin your error values at 256. When you add additional error codes, you need to define `-DAKERR_MAX_ERR_VALUE=n` to the compiler, where `n` is the maximum error code you have defined. If you define custom error codes, `AKERR_MAX_ERR_VALUE` must be >= 256 or the compiler will throw an error.
|
||||||
|
|
||||||
Define a human-friendly name for the error with the `error_name_for_status` method somewhere in your code's initialization before the error may be used:
|
Define a human-friendly name for the error with the `akerr_name_for_status` method somewhere in your code's initialization before the error may be used:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
error_name_for_status(129, "Some Error Code Description")
|
akerr_name_for_status(129, "Some Error Code Description")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ void my_logger(const char *fmt, ...)
|
|||||||
|
|
||||||
|
|
||||||
/* set your custom error handler */
|
/* set your custom error handler */
|
||||||
error_log_method = &my_logger;
|
akerr_log_method = &my_logger;
|
||||||
|
|
||||||
/* proceed to use the library */
|
/* proceed to use the library */
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user