27b7e930fa
Signed-off-by: Chloe M <chloe@mensia.org>
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
/*
|
|
* Copyright (c) 2026, Chloe M., et al.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: Program status codes
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#ifndef _PTAPI_STATUS_H_
|
|
#define _PTAPI_STATUS_H_ 1
|
|
|
|
#include <ptdef.h>
|
|
|
|
/*
|
|
* All functions and routines that are to return a status code
|
|
* should be of this return type.
|
|
*/
|
|
typedef ULONG PT_STATUS;
|
|
|
|
/* Valid status codes */
|
|
#define STATUS_SUCCESS 0 /* Operation completed sucessfully */
|
|
#define STATUS_FAILURE 1 /* Unspecified / generic failure */
|
|
#define STATUS_NO_MEMORY 2 /* Out of memory */
|
|
#define STATUS_NOT_DIRECTORY 3 /* Not a directory */
|
|
#define STATUS_IO_ERROR 4 /* I/O error */
|
|
#define STATUS_INVALID_PARAM 5 /* Invalid parameter */
|
|
#define STATUS_ACCESS_DENIED 6 /* Access to resource is denied */
|
|
#define STATUS_NOT_FOUND 7 /* Resource not found */
|
|
#define STATUS_NAME_TOO_LONG 8 /* Name is too long */
|
|
#define STATUS_NOT_SUPPORTED 9 /* Operation is not supported */
|
|
|
|
/*
|
|
* Developers are encouraged to use this macro rather than directly
|
|
* handling the conditional.
|
|
*/
|
|
#define PT_ERROR(STATUS) \
|
|
((STATUS) != STATUS_SUCCESS)
|
|
|
|
#endif /* !_PTAPI_STATUS_H_ */
|