GRU - Generic Reusable Utilities
|
#include "gru_status.h"
Functions | |
gru_export gru_status_t | gru_status_new () |
Copyright 2016 Otavio Rodolfo Piske. More... | |
void | gru_status_set (gru_status_t *status, gru_status_code_t code, const char *message,...) |
Sets the status. More... | |
void | gru_status_reset (gru_status_t *status) |
Resets the status. More... | |
void | gru_status_set_success (gru_status_t *status) |
Sets the status to success. More... | |
void | gru_status_strerror (gru_status_t *status, gru_status_code_t code, int errnum) |
Sets the status from the errno. More... | |
bool | gru_status_error (const gru_status_t *status) |
Checks for error status. More... | |
bool | gru_status_success (const gru_status_t *status) |
Checks for success status. More... | |
|
inline |
Checks for error status.
status | the status object to check |
|
inline |
Copyright 2016 Otavio Rodolfo Piske.
Create a new status object.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
void gru_status_reset | ( | gru_status_t * | status | ) |
Resets the status.
status | an instance of the status object to set |
void gru_status_set | ( | gru_status_t * | status, |
gru_status_code_t | code, | ||
const char * | message, | ||
... | |||
) |
Sets the status.
status | an instance of the status object to set |
code | the code to set the object to |
message | the status message followed by any other parameter as accepted by vasprintf |
void gru_status_set_success | ( | gru_status_t * | status | ) |
Sets the status to success.
status | an instance of the status object to set |
void gru_status_strerror | ( | gru_status_t * | status, |
gru_status_code_t | code, | ||
int | errnum | ||
) |
Sets the status from the errno.
status | an instance of the status object to set |
code | the code to set the object to |
errnum | the error number (as in errno) |
|
inline |
Checks for success status.
status | the status object to check |