Move 'captivemodid' library to libcaptive.
[captive.git] / src / install / acquire / moduriload.c
index 2e83141..4500716 100644 (file)
@@ -28,7 +28,6 @@
 #include "../libcaptive-install/proc_partitions.h"
 #include "main.h"
 #include <string.h>
-#include "captivemodid.h"
 #include "cabinet.h"
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-directory.h>
@@ -36,6 +35,7 @@
 #include <unistd.h>
 
 #include <captive/macros.h>
+#include <captive/captivemodid.h>
 
 
 /* Config: */
@@ -68,7 +68,7 @@ void (*acquire_module_available_notify)(struct module_available *module_availabl
 void (*acquire_module_all_modules_found_notify)(void);
 
 static void mod_uri_load_module_from_memory
-               (struct captivemodid_module *module,gconstpointer file_base,size_t file_length,GnomeVFSURI *uri)
+               (struct captive_captivemodid_module *module,gconstpointer file_base,size_t file_length,GnomeVFSURI *uri)
 {
 struct module_available *module_available;
 gint best_priority;
@@ -109,10 +109,10 @@ int dest_fd;
 
        all_modules_found=FALSE;
 
-       best_priority=captivemodid_module_type_best_priority_lookup(module->type);
+       best_priority=captive_captivemodid_module_type_best_priority_lookup(module->type);
        if (best_priority==G_MININT     /* no longer seeking for such module */
                        || module_available->module->priority==best_priority) {
-               if (captivemodid_module_type_best_priority_found(module->type)) {
+               if (captive_captivemodid_module_type_best_priority_found(module->type)) {
                        /* Postpone (*acquire_module_all_modules_found_notify)()
                         * after (*acquire_module_available_notify)().
                         */
@@ -130,7 +130,7 @@ int dest_fd;
 void mod_uri_load_file_from_memory(gconstpointer file_base,size_t file_length,GnomeVFSURI *uri)
 {
 gchar *file_md5;
-struct captivemodid_module *module;
+struct captive_captivemodid_module *module;
 
        g_return_if_fail(file_base!=NULL);
        g_return_if_fail(uri!=NULL);
@@ -138,8 +138,8 @@ struct captivemodid_module *module;
        if ((*ui_progress)(uri))
                return;
 
-       file_md5=calc_md5(file_base,file_length);
-       if (!(module=captivemodid_module_md5_lookup(file_md5)))
+       file_md5=captive_calc_md5(file_base,file_length);
+       if (!(module=captive_captivemodid_module_md5_lookup(file_md5)))
                goto fail_free_file_md5;
 
        if (strcmp("cabinet",(const char *)module->type))
@@ -239,14 +239,14 @@ GnomeVFSHandle *handle;
                errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
                goto fail_file_info_local_clear;
                }
-       if (!captivemodid_module_length_is_valid(file_info_local.size)) {
+       if (!captive_captivemodid_module_length_is_valid(file_info_local.size)) {
                errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
                goto fail_file_info_local_clear;
                }
        if (file_info_local.size<=MAX_FILE_LOAD_LENGTH)
                mod_uri_load_file_handle_to_memory(handle,&file_info_local,uri);
        else {
-gint cabinet_used=captivemodid_cabinet_length_to_used(file_info_local.size);
+gint cabinet_used=captive_captivemodid_cabinet_length_to_used(file_info_local.size);
 
                mod_uri_load_file_handle_remote_cabinet(&handle,&file_info_local,uri,cabinet_used);
                }