summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-10-11 02:30:13 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-10-11 02:37:13 +0000
commit64ddd21f218c2d1a80f3ce5f57e1fde266c19a8f (patch)
tree7692b86928439da78d5b8cba1707ef99ee3321e4
parent3f8f16d04873c0fd4e149ddbaf5323461e51304b (diff)
Moved the miscellaneous dumping code into it's own file.
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Makefile.in9
-rw-r--r--src/revenge_dump.c90
-rw-r--r--src/revenge_dump.h7
-rw-r--r--src/revenge_dump_misc.c117
-rw-r--r--src/revenge_dump_misc.h34
-rw-r--r--src/revenge_test.c1
7 files changed, 160 insertions, 100 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 20f1751..4a8c78c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -55,6 +55,8 @@ revenge_SOURCES = \
revenge_detect.h \
revenge_dump.c \
revenge_dump.h \
+ revenge_dump_misc.c \
+ revenge_dump_misc.h \
revenge_main.c \
revenge_main.h \
revenge_memory.c \
diff --git a/src/Makefile.in b/src/Makefile.in
index 4b1f84a..0cfd8d2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -56,9 +56,9 @@ am_revenge_OBJECTS = gl_alpha_test.$(OBJEXT) gl_blend.$(OBJEXT) \
gl_texture_mag_filter.$(OBJEXT) \
gl_texture_min_filter.$(OBJEXT) gl_texture_wrap_s.$(OBJEXT) \
gl_texture_wrap_t.$(OBJEXT) revenge_detect.$(OBJEXT) \
- revenge_dump.$(OBJEXT) revenge_main.$(OBJEXT) \
- revenge_memory.$(OBJEXT) revenge_register.$(OBJEXT) \
- revenge_test.$(OBJEXT)
+ revenge_dump.$(OBJEXT) revenge_dump_misc.$(OBJEXT) \
+ revenge_main.$(OBJEXT) revenge_memory.$(OBJEXT) \
+ revenge_register.$(OBJEXT) revenge_test.$(OBJEXT)
revenge_OBJECTS = $(am_revenge_OBJECTS)
revenge_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
@@ -211,6 +211,8 @@ revenge_SOURCES = \
revenge_detect.h \
revenge_dump.c \
revenge_dump.h \
+ revenge_dump_misc.c \
+ revenge_dump_misc.h \
revenge_main.c \
revenge_main.h \
revenge_memory.c \
@@ -312,6 +314,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_texture_wrap_t.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_detect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_dump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_dump_misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revenge_register.Po@am__quote@
diff --git a/src/revenge_dump.c b/src/revenge_dump.c
index 8d2d118..3c16843 100644
--- a/src/revenge_dump.c
+++ b/src/revenge_dump.c
@@ -269,93 +269,3 @@ dump_rb_post (void)
dump_packets (rb_head, rb_tail, rb_mem_map, buf);
free (rb_mem_map);
}
-
-void
-dump_device_id (void)
-{
- FILE *file;
-
- if (!(file = fopen ("device_id.txt", "w")))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- exit (EXIT_FAILURE);
- }
-
- fprintf (file, "%04x\n", reg_device_id);
-
- fclose (file);
-}
-
-void
-dump_device_name (void)
-{
- FILE *file;
-
- if (!(file = fopen ("device_name.txt", "w")))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- exit (EXIT_FAILURE);
- }
-
- fprintf (file, "%s\n", reg_device_name);
-
- fclose (file);
-}
-
-void
-dump_fglrx_version (void)
-{
- system
- ("fglrxinfo 2> /dev/null | sed -n 's/.*(\\([^)]*\\)).*/\\1/p' > fglrx_version.txt");
-}
-
-void
-dump_fglrxinfo (void)
-{
- system ("fglrxinfo -v 2> /dev/null > fglrxinfo.txt");
-}
-
-void
-dump_glxinfo (void)
-{
- system ("glxinfo -v 2> /dev/null > glxinfo.txt");
-}
-
-void
-dump_interface (void)
-{
- FILE *file;
-
- if (!(file = fopen ("interface.txt", "w")))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- exit (EXIT_FAILURE);
- }
-
- switch (option_interface)
- {
- case IF_PCIE:
- fprintf (file, "PCI-E\n");
- break;
- case IF_AGP:
- fprintf (file, "AGP\n");
- break;
- case IF_IGP:
- fprintf (file, "IGP\n");
- break;
- default:
- assert (0);
- break;
- }
-
- fclose (file);
-}
-
-void
-dump_lspci (void)
-{
- system ("lspci -v 2> /dev/null > lspci.txt");
-}
diff --git a/src/revenge_dump.h b/src/revenge_dump.h
index 7539159..3813066 100644
--- a/src/revenge_dump.h
+++ b/src/revenge_dump.h
@@ -25,12 +25,5 @@
void dump_rb_pre (void);
void dump_rb_post (void);
-void dump_device_id (void);
-void dump_device_name (void);
-void dump_fglrx_version (void);
-void dump_fglrxinfo (void);
-void dump_glxinfo (void);
-void dump_interface (void);
-void dump_lspci (void);
#endif
diff --git a/src/revenge_dump_misc.c b/src/revenge_dump_misc.c
new file mode 100644
index 0000000..f896d5f
--- /dev/null
+++ b/src/revenge_dump_misc.c
@@ -0,0 +1,117 @@
+/*
+ * $Id$
+ * Copyright (C) 2007 Oliver McFadden <z3ro.geek@gmail.com>
+ *
+ * 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 Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <revenge_detect.h>
+#include <revenge_main.h>
+
+void
+dump_device_id (void)
+{
+ FILE *file;
+
+ if (!(file = fopen ("device_id.txt", "w")))
+ {
+ fprintf (stderr, "%s: %s\n", program_invocation_short_name,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+
+ fprintf (file, "%04x\n", reg_device_id);
+
+ fclose (file);
+}
+
+void
+dump_device_name (void)
+{
+ FILE *file;
+
+ if (!(file = fopen ("device_name.txt", "w")))
+ {
+ fprintf (stderr, "%s: %s\n", program_invocation_short_name,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+
+ fprintf (file, "%s\n", reg_device_name);
+
+ fclose (file);
+}
+
+void
+dump_fglrx_version (void)
+{
+ system
+ ("fglrxinfo 2> /dev/null | sed -n 's/.*(\\([^)]*\\)).*/\\1/p' > fglrx_version.txt");
+}
+
+void
+dump_fglrxinfo (void)
+{
+ system ("fglrxinfo -v 2> /dev/null > fglrxinfo.txt");
+}
+
+void
+dump_glxinfo (void)
+{
+ system ("glxinfo -v 2> /dev/null > glxinfo.txt");
+}
+
+void
+dump_interface (void)
+{
+ FILE *file;
+
+ if (!(file = fopen ("interface.txt", "w")))
+ {
+ fprintf (stderr, "%s: %s\n", program_invocation_short_name,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+
+ switch (option_interface)
+ {
+ case IF_PCIE:
+ fprintf (file, "PCI-E\n");
+ break;
+ case IF_AGP:
+ fprintf (file, "AGP\n");
+ break;
+ case IF_IGP:
+ fprintf (file, "IGP\n");
+ break;
+ default:
+ assert (0);
+ break;
+ }
+
+ fclose (file);
+}
+
+void
+dump_lspci (void)
+{
+ system ("lspci -v 2> /dev/null > lspci.txt");
+}
diff --git a/src/revenge_dump_misc.h b/src/revenge_dump_misc.h
new file mode 100644
index 0000000..c08e113
--- /dev/null
+++ b/src/revenge_dump_misc.h
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ * Copyright (C) 2007 Oliver McFadden <z3ro.geek@gmail.com>
+ *
+ * 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 Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __DUMP_MISC_H__
+#define __DUMP_MISC_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void dump_device_id (void);
+void dump_device_name (void);
+void dump_fglrx_version (void);
+void dump_fglrxinfo (void);
+void dump_glxinfo (void);
+void dump_interface (void);
+void dump_lspci (void);
+
+#endif
diff --git a/src/revenge_test.c b/src/revenge_test.c
index 1f064a0..c1ad3ae 100644
--- a/src/revenge_test.c
+++ b/src/revenge_test.c
@@ -31,6 +31,7 @@
#include <revenge_detect.h>
#include <revenge_dump.h>
+#include <revenge_dump_misc.h>
#include <revenge_main.h>
#include <revenge_test.h>