21 #include <freerdp/config.h>
25 #include <freerdp/log.h>
29 #define ERRBASE_DEFINE(_code) \
31 ERRBASE_##_code, "ERRBASE_" #_code, ERRBASE_##_code##_STRING, "" \
37 #define ERRBASE_SUCCESS_STRING "Success."
38 #define ERRBASE_NONE_STRING ""
40 static const ERRINFO ERRBASE_CODES[] = { ERRBASE_DEFINE(SUCCESS),
42 ERRBASE_DEFINE(NONE) };
44 const char* freerdp_get_error_base_string(UINT32 code)
48 errInfo = &ERRBASE_CODES[0];
50 while (errInfo->code != ERRBASE_NONE)
52 if (code == errInfo->code)
60 return "ERRBASE_UNKNOWN";
63 const char* freerdp_get_error_base_category(UINT32 code)
67 errInfo = &ERRBASE_CODES[0];
69 while (errInfo->code != ERRBASE_NONE)
71 if (code == errInfo->code)
73 return errInfo->category;
79 return "ERRBASE_UNKNOWN";
82 const char* freerdp_get_error_base_name(UINT32 code)
86 errInfo = &ERRBASE_CODES[0];
88 while (errInfo->code != ERRBASE_NONE)
90 if (code == errInfo->code)
98 return "ERRBASE_UNKNOWN";