status: Move status_t type and functions to separate files

This commit is contained in:
Martin Willi
2015-04-16 14:50:05 +02:00
parent 001a22e2c1
commit 1e02eddb72
6 changed files with 125 additions and 116 deletions
+1 -82
View File
@@ -81,6 +81,7 @@
#include "utils/string.h"
#include "utils/memory.h"
#include "utils/strerror.h"
#include "utils/status.h"
#include "utils/path.h"
#include "utils/tty.h"
#ifdef __APPLE__
@@ -276,78 +277,6 @@ void utils_deinit();
*/
#define TIME_32_BIT_SIGNED_MAX 0x7fffffff
typedef enum status_t status_t;
/**
* Return values of function calls.
*/
enum status_t {
/**
* Call succeeded.
*/
SUCCESS,
/**
* Call failed.
*/
FAILED,
/**
* Out of resources.
*/
OUT_OF_RES,
/**
* The suggested operation is already done
*/
ALREADY_DONE,
/**
* Not supported.
*/
NOT_SUPPORTED,
/**
* One of the arguments is invalid.
*/
INVALID_ARG,
/**
* Something could not be found.
*/
NOT_FOUND,
/**
* Error while parsing.
*/
PARSE_ERROR,
/**
* Error while verifying.
*/
VERIFY_ERROR,
/**
* Object in invalid state.
*/
INVALID_STATE,
/**
* Destroy object which called method belongs to.
*/
DESTROY_ME,
/**
* Another call to the method is required.
*/
NEED_MORE,
};
/**
* enum_names for type status_t.
*/
extern enum_name_t *status_names;
/**
* Handle struct timeval like an own type.
*/
@@ -438,16 +367,6 @@ bool return_true();
*/
bool return_false();
/**
* returns FAILED
*/
status_t return_failed();
/**
* returns SUCCESS
*/
status_t return_success();
/**
* Get the padding required to make size a multiple of alignment
*/