module_name -> name

This commit is contained in:
jacekpoz 2024-02-10 14:51:50 +01:00
parent dfa4ea2f44
commit ac6c61e10a
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C
5 changed files with 8 additions and 9 deletions

5
mod.h
View file

@ -5,10 +5,9 @@
#include <stdint.h>
semver version(void);
const char *module_name(void);
const char *get(void);
const char *name(void);
void init(char **config);
const char *get(void);
#endif // _MODFETCH_MOD_H

View file

@ -265,16 +265,16 @@ int main(int argc, char *argv[]) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
semver (*version)(void) = dlsym(handle, "version");
const char *(*module_name)(void) = dlsym(handle, "module_name");
const char *(*name)(void) = dlsym(handle, "name");
const char *(*get)(void) = dlsym(handle, "get");
void (*init)(char**) = dlsym(handle, "init");
#pragma GCC diagnostic pop
init(current_module.config);
(void)module_name;
(void)name;
(void)version;
// printf("%s: %s\n", module_name(), svtoa(version()));
// printf("%s: %s\n", name(), svtoa(version()));
printf("%s\n", get());
}

View file

@ -15,7 +15,7 @@ static const semver _version = {
};
semver version(void) { return _version; }
const char *module_name(void) { return "desktop"; }
const char *name(void) { return "desktop"; }
void init(char **config) {
(void)config;

View file

@ -17,7 +17,7 @@ static const semver _version = {
};
semver version(void) { return _version; }
const char *module_name(void) { return "os"; }
const char *name(void) { return "os"; }
void init(char **config) {
(void)config;

View file

@ -19,7 +19,7 @@ static const semver _version = {
};
semver version(void) { return _version; }
const char *module_name(void) { return "sep"; }
const char *name(void) { return "sep"; }
static size_t length = 8;
static char *sep_char = "-";