summaryrefslogtreecommitdiffhomepage
path: root/src/core/lt_core.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-06-20 08:39:30 +0000
committermidipix <writeonce@midipix.org>2025-06-20 08:50:00 +0000
commit1784780e14974a6833e24c312f2962fa79cc12e2 (patch)
treec57d75f2cd664d11d713807b7e47661dcb76b70b /src/core/lt_core.c
parent1accaeff874ee8676a13ba54b0381065bc33eac3 (diff)
downloadsltdl-1784780e14974a6833e24c312f2962fa79cc12e2.tar.bz2
sltdl-1784780e14974a6833e24c312f2962fa79cc12e2.tar.xz
api: move enum sltdl_error from an internal header to the public sltdl.h.
Diffstat (limited to 'src/core/lt_core.c')
-rw-r--r--src/core/lt_core.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/core/lt_core.c b/src/core/lt_core.c
index 52c06d5..7091981 100644
--- a/src/core/lt_core.c
+++ b/src/core/lt_core.c
@@ -15,18 +15,18 @@
#include "sltdl_core.h"
static const char * lt_dlerror_desc[] = {
- [SLTDL_OK] = 0,
- [SLTDL_SYSTEM_ERROR] = 0,
- [SLTDL_DLFCN_ERROR] = 0,
- [SLTDL_SLTDL_ERROR] = "sltdl internal error",
- [SLTDL_DLEXIT_REF_COUNT] = "lt_dlexit() reference count already zero",
- [SLTDL_MODULE_REF_COUNT] = "module reference count already zero",
- [SLTDL_MODULE_PTR_INVALID] = "module handle invalid",
- [SLTDL_PATH_INVALID_FIRST_CHAR] = "invalid path (does not begin with a forward slash)",
- [SLTDL_PATH_INVALID_SEPARATTOR_CHAR] = "invalid path (separator character is not a colon)",
- [SLTDL_PATH_INVALID_MARK] = "invalid path (mark not within range)",
- [SLTDL_PATH_INVALID_LEN] = "invalid path (string too long)",
- [SLTDL_PATH_NO_ENTRY] = "invalid path (not found)",
+ [SLTDL_ERR_OK] = 0,
+ [SLTDL_ERR_SYSTEM_ERROR] = 0,
+ [SLTDL_ERR_DLFCN_ERROR] = 0,
+ [SLTDL_ERR_SLTDL_ERROR] = "sltdl internal error",
+ [SLTDL_ERR_DLEXIT_REF_COUNT] = "lt_dlexit() reference count already zero",
+ [SLTDL_ERR_MODULE_REF_COUNT] = "module reference count already zero",
+ [SLTDL_ERR_MODULE_PTR_INVALID] = "module handle invalid",
+ [SLTDL_ERR_PATH_INVALID_FIRST_CHAR] = "invalid path (does not begin with a forward slash)",
+ [SLTDL_ERR_PATH_INVALID_SEPARATTOR_CHAR] = "invalid path (separator character is not a colon)",
+ [SLTDL_ERR_PATH_INVALID_MARK] = "invalid path (mark not within range)",
+ [SLTDL_ERR_PATH_INVALID_LEN] = "invalid path (string too long)",
+ [SLTDL_ERR_PATH_NO_ENTRY] = "invalid path (not found)",
};
static int lt_refs = 0;
@@ -52,7 +52,7 @@ int lt_dlexit(void)
return 1;
if (!lt_refs) {
- lt_error = SLTDL_DLEXIT_REF_COUNT;
+ lt_error = SLTDL_ERR_DLEXIT_REF_COUNT;
pthread_mutex_unlock(&lt_lock);
return 1;
}
@@ -80,13 +80,13 @@ int lt_sunlock(int ret, int error)
return 0;
}
- if ((error < 0) || (error >= SLTDL_ERROR_CAP)) {
- error = SLTDL_SLTDL_ERROR;
+ if ((error < 0) || (error >= SLTDL_ERR_CAP)) {
+ error = SLTDL_ERR_SLTDL_ERROR;
- } else if (error == SLTDL_SYSTEM_ERROR) {
+ } else if (error == SLTDL_ERR_SYSTEM_ERROR) {
lt_errno = errno;
- } else if (error == SLTDL_DLFCN_ERROR) {
+ } else if (error == SLTDL_ERR_DLFCN_ERROR) {
if (lt_dlerr)
free(lt_dlerr);
@@ -105,15 +105,15 @@ const char * lt_dlerror(void)
lt_slock();
switch (lt_error) {
- case SLTDL_OK:
+ case SLTDL_ERR_OK:
errdesc = 0;
break;
- case SLTDL_SYSTEM_ERROR:
+ case SLTDL_ERR_SYSTEM_ERROR:
errdesc = strerror(lt_errno);
break;
- case SLTDL_DLFCN_ERROR:
+ case SLTDL_ERR_DLFCN_ERROR:
errdesc = lt_dlerr;
break;