From: Lucas De Marchi Date: Wed, 23 Nov 2011 13:52:30 +0000 (-0200) Subject: Constify API X-Git-Tag: v1~204 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d177553dcaa9d707a498d072918407e8cd1b748;p=platform%2Fupstream%2Fkmod.git Constify API --- diff --git a/libkmod/libkmod-loaded.c b/libkmod/libkmod-loaded.c index b0bed74..7d0e963 100644 --- a/libkmod/libkmod-loaded.c +++ b/libkmod/libkmod-loaded.c @@ -200,7 +200,7 @@ KMOD_EXPORT int kmod_loaded_get_list(struct kmod_loaded *mod, return 0; } -KMOD_EXPORT int kmod_loaded_get_module_info(struct kmod_list *entry, +KMOD_EXPORT int kmod_loaded_get_module_info(const struct kmod_list *entry, const char **name, long *size, int *use_count, const char **deps, diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index efc2c58..4407272 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -80,7 +80,7 @@ static void log_stderr(struct kmod_ctx *ctx, * * Returns: stored userdata **/ -KMOD_EXPORT void *kmod_get_userdata(struct kmod_ctx *ctx) +KMOD_EXPORT void *kmod_get_userdata(const struct kmod_ctx *ctx) { if (ctx == NULL) return NULL; @@ -215,7 +215,7 @@ KMOD_EXPORT void kmod_set_log_fn(struct kmod_ctx *ctx, * * Returns: the current logging priority **/ -KMOD_EXPORT int kmod_get_log_priority(struct kmod_ctx *ctx) +KMOD_EXPORT int kmod_get_log_priority(const struct kmod_ctx *ctx) { return ctx->log_priority; } diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h index 93c5da1..24c4570 100644 --- a/libkmod/libkmod.h +++ b/libkmod/libkmod.h @@ -43,9 +43,9 @@ void kmod_set_log_fn(struct kmod_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *format, va_list args)); -int kmod_get_log_priority(struct kmod_ctx *ctx); +int kmod_get_log_priority(const struct kmod_ctx *ctx); void kmod_set_log_priority(struct kmod_ctx *ctx, int priority); -void *kmod_get_userdata(struct kmod_ctx *ctx); +void *kmod_get_userdata(const struct kmod_ctx *ctx); void kmod_set_userdata(struct kmod_ctx *ctx, void *userdata); /* @@ -70,8 +70,8 @@ int kmod_loaded_new(struct kmod_ctx *ctx, struct kmod_loaded **mod); struct kmod_loaded *kmod_loaded_ref(struct kmod_loaded *mod); struct kmod_loaded *kmod_loaded_unref(struct kmod_loaded *mod); int kmod_loaded_get_list(struct kmod_loaded *mod, struct kmod_list **list); -int kmod_loaded_get_module_info(struct kmod_list *entry, const char **name, - long *size, int *use_count, const char **deps, - uintptr_t *addr); +int kmod_loaded_get_module_info(const struct kmod_list *entry, + const char **name, long *size, int *use_count, + const char **deps, uintptr_t *addr); #endif