chiark / gitweb /
volume_id: define exported symbols
authorKay Sievers <kay.sievers@suse.de>
Tue, 28 Mar 2006 00:52:58 +0000 (02:52 +0200)
committerKay Sievers <kay.sievers@suse.de>
Tue, 28 Mar 2006 00:52:58 +0000 (02:52 +0200)
extras/volume_id/lib/Makefile
extras/volume_id/lib/exported_symbols [new file with mode: 0644]
extras/volume_id/lib/libvolume_id.h
extras/volume_id/lib/util.h
extras/volume_id/lib/volume_id.c
extras/volume_id/vol_id.c

index 6a12f0e67a7ffa655a87be453eb79cea84cc412f..f69df5f5ca43f19f690353c24344dea3926441e9 100644 (file)
@@ -81,7 +81,9 @@ libvolume_id.a: $(HEADERS) $(OBJS)
 
 $(SHLIB): $(HEADERS) .shlib $(addprefix .shlib/,$(OBJS))
        $(E) "  CC      " $@
 
 $(SHLIB): $(HEADERS) .shlib $(addprefix .shlib/,$(OBJS))
        $(E) "  CC      " $@
-       $(Q) $(CC) -shared $(CFLAGS) -o $@ -Wl,-soname,libvolume_id.so.$(SHLIB_CUR) $(addprefix .shlib/,$(OBJS))
+       $(Q) $(CC) -shared $(CFLAGS) -o $@ \
+               -Wl,-soname,libvolume_id.so.$(SHLIB_CUR),--version-script,exported_symbols \
+               $(addprefix .shlib/,$(OBJS))
        $(Q) ln -sf $@ libvolume_id.so.$(SHLIB_CUR)
        $(Q) ln -sf $@ libvolume_id.so
 
        $(Q) ln -sf $@ libvolume_id.so.$(SHLIB_CUR)
        $(Q) ln -sf $@ libvolume_id.so
 
diff --git a/extras/volume_id/lib/exported_symbols b/extras/volume_id/lib/exported_symbols
new file mode 100644 (file)
index 0000000..b1ff3cc
--- /dev/null
@@ -0,0 +1,43 @@
+{ global:
+       volume_id_log_fn;
+       volume_id_open_fd;
+       volume_id_open_node;
+       volume_id_probe_all;
+       volume_id_probe_filesystem;
+       volume_id_probe_raid;
+       volume_id_close;
+
+       volume_id_probe_cramfs;
+       volume_id_probe_ext;
+       volume_id_probe_vfat;
+       volume_id_probe_hfs_hfsplus;
+       volume_id_probe_hpfs;
+       volume_id_probe_iso9660;
+       volume_id_probe_jfs;
+       volume_id_probe_minix;
+       volume_id_probe_ntfs;
+       volume_id_probe_ocfs1;
+       volume_id_probe_ocfs2;
+       volume_id_probe_reiserfs;
+       volume_id_probe_romfs;
+       volume_id_probe_sysv;
+       volume_id_probe_udf;
+       volume_id_probe_ufs;
+       volume_id_probe_vxfs;
+       volume_id_probe_xfs;
+       volume_id_probe_squashfs;
+
+       volume_id_probe_linux_raid;
+       volume_id_probe_lvm1;
+       volume_id_probe_lvm2;
+       volume_id_probe_intel_software_raid;
+       volume_id_probe_highpoint_37x_raid;
+       volume_id_probe_highpoint_45x_raid;
+       volume_id_probe_lsi_mega_raid;
+       volume_id_probe_nvidia_raid;
+       volume_id_probe_promise_fasttrack_raid;
+       volume_id_probe_silicon_medley_raid;
+       volume_id_probe_via_raid;
+local:
+       *;
+};
index 7faf8d8af3d20e05140ea2e987fecc7188c6178e..06b1baa9d00d5de0e40acfaf8a4445360a8a3616 100644 (file)
 #endif
 
 
 #endif
 
 
-typedef void (*volume_id_log_fn)(int priority, const char *file, int line, const char *format, ...)
+typedef void (*volume_id_log_fn_t)(int priority, const char *file, int line, const char *format, ...)
             __attribute__ ((format(printf, 4, 5)));
 
             __attribute__ ((format(printf, 4, 5)));
 
-extern volume_id_log_fn volume_id_log;
+extern volume_id_log_fn_t volume_id_log_fn;
 
 #define VOLUME_ID_LABEL_SIZE           64
 #define VOLUME_ID_UUID_SIZE            36
 
 #define VOLUME_ID_LABEL_SIZE           64
 #define VOLUME_ID_UUID_SIZE            36
index 1d1b53bb5753043800f49bcf19e3400cae6521d7..dc60a09123eb6c94fa237b7057a76b56c3e00667 100644 (file)
 #include <byteswap.h>
 #include <syslog.h>
 
 #include <byteswap.h>
 #include <syslog.h>
 
-#define err(format, arg...)    volume_id_log(LOG_ERR, __FILE__, __LINE__, format, ##arg)
-#define info(format, arg...)   volume_id_log(LOG_INFO, __FILE__, __LINE__, format, ##arg)
+#define err(format, arg...)    volume_id_log_fn(LOG_ERR, __FILE__, __LINE__, format, ##arg)
+#define info(format, arg...)   volume_id_log_fn(LOG_INFO, __FILE__, __LINE__, format, ##arg)
 #ifdef DEBUG
 #ifdef DEBUG
-#define dbg(format, arg...)    volume_id_log(LOG_DEBUG, __FILE__, __LINE__, format, ##arg)
+#define dbg(format, arg...)    volume_id_log_fn(LOG_DEBUG, __FILE__, __LINE__, format, ##arg)
 #else
 #define dbg(format, arg...)    do { } while (0)
 #endif
 #else
 #define dbg(format, arg...)    do { } while (0)
 #endif
index 4662b210dc37b789ea5afbc7bc35248747d73284..9f8e39b51814f28928b2db02ac110b07c0b4c51a 100644 (file)
@@ -35,7 +35,7 @@ static void default_log(int priority, const char *file, int line, const char *fo
        return;
 }
 
        return;
 }
 
-volume_id_log_fn volume_id_log = default_log;
+volume_id_log_fn_t volume_id_log_fn = default_log;
 
 int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
 {
 
 int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
 {
index 3a7361a6ac6f032d64073ed9b0d5b41b0e51b414..2274550c197305e9d15d573a87ba65b4f7426bf2 100644 (file)
@@ -1,7 +1,7 @@
 /*
 /*
- * vol_id - udev callout to read filesystem label and uuid
+ * vol_id - read filesystem label and uuid
  *
  *
- * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2005-2006 Kay Sievers <kay.sievers@vrfy.org>
  *
  *     This program is free software; you can redistribute it and/or modify it
  *     under the terms of the GNU General Public License as published by the
  *
  *     This program is free software; you can redistribute it and/or modify it
  *     under the terms of the GNU General Public License as published by the
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
        logging_init("vol_id");
 
        /* hook in our debug into libvolume_id */
        logging_init("vol_id");
 
        /* hook in our debug into libvolume_id */
-       volume_id_log = vid_log;
+       volume_id_log_fn = vid_log;
 
        for (i = 1 ; i < argc; i++) {
                char *arg = argv[i];
 
        for (i = 1 ; i < argc; i++) {
                char *arg = argv[i];