#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common/gru_portable.h"
Go to the source code of this file.
#define GRU_MAX_ERROR_MESSAGE 1024 |
Copyright 2016 Otavio Rodolfo Piske.
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.
Enumerator |
---|
GRU_SUCCESS |
|
GRU_FAILURE |
|
Checks for error status.
- Parameters
-
status | the status object to check |
- Returns
- true if an error or false otherwise
Create a new status object.
- Returns
- a new status object
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.
Resets the status.
- Parameters
-
status | an instance of the status object to set |
Sets the status.
- Parameters
-
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 |
Sets the status to success.
- Parameters
-
status | an instance of the status object to set |
Sets the status from the errno.
- Parameters
-
status | an instance of the status object to set |
code | the code to set the object to |
errnum | the error number (as in errno) |
Checks for success status.
- Parameters
-
status | the status object to check |
- Returns
- true if success or false otherwise