summaryrefslogtreecommitdiffstats
path: root/tools/serial_probe/serial_probe.c
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2001-08-07 17:40:36 +0000
committerMystery Man <unknown@mandriva.org>2001-08-07 17:40:36 +0000
commit068d599562888a36a50e5bbdeb8b70f83fa7c287 (patch)
tree18f5eed8353b3af647412875d438b55ef8c07670 /tools/serial_probe/serial_probe.c
parentbe838931607e1ab14c8c699e20dd807b55579f7b (diff)
downloaddrakx-topic/v_webmin_0_87.tar
drakx-topic/v_webmin_0_87.tar.gz
drakx-topic/v_webmin_0_87.tar.bz2
drakx-topic/v_webmin_0_87.tar.xz
drakx-topic/v_webmin_0_87.zip
This commit was manufactured by cvs2svn to create branchtopic/v_webmin_0_87
'v_webmin_0_87'.
Diffstat (limited to 'tools/serial_probe/serial_probe.c')
-rw-r--r--tools/serial_probe/serial_probe.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/tools/serial_probe/serial_probe.c b/tools/serial_probe/serial_probe.c
deleted file mode 100644
index b8abb6917..000000000
--- a/tools/serial_probe/serial_probe.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright 1999 MandrakeSoft <fpons@mandrakesoft.com>
- *
- * The following file used by this one are copyrighted by RedHat and
- * are taken from kudzu :
- * device.h
- * serial.h
- * serial.c
- * This file is taken from kudzu.c copyrighted by RedHat, 1999.
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "serial.h"
-#include "device.h"
-
-typedef struct device *(newFunc)(struct device *);
-typedef int (initFunc)();
-typedef struct device *(probeFunc)(enum deviceClass, int, struct device *);
-
-char *classStrings[] = {
- "UNSPEC", "OTHER", "NETWORK", "SCSI", "VIDEO", "AUDIO",
- "MOUSE", "MODEM", "CDROM", "TAPE", "FLOPPY", "SCANNER",
- "HD", "RAID", "PRINTER", "CAPTURE", "KEYBOARD", NULL
-};
-
-struct device *newDevice(struct device *old, struct device *new) {
- if (!old) {
- if (!new) {
- new = malloc(sizeof(struct device));
- memset(new,'\0',sizeof(struct device));
- }
- new->class = CLASS_UNSPEC;
- } else {
- new->class = old->class;
- if (old->device) new->device = strdup(old->device);
- if (old->driver) new->driver = strdup(old->driver);
- if (old->desc) new->desc = strdup(old->desc);
- }
- new->newDevice = newDevice;
- new->freeDevice = freeDevice;
- new->compareDevice = compareDevice;
- return new;
-}
-
-void freeDevice(struct device *dev) {
- if (!dev) {
- printf("freeDevice(null)\n");
- abort(); /* return; */
- }
- if (dev->device) free (dev->device);
- if (dev->driver) free (dev->driver);
- if (dev->desc) free (dev->desc);
- free (dev);
-}
-
-void writeDevice(FILE *file, struct device *dev) {}
-int compareDevice(struct device *dev1, struct device *dev2) { return 0; }
-
-int main () {
- struct device* devices = NULL;
- struct serialDevice* serialDevice = NULL;
-
- devices = serialProbe(CLASS_UNSPEC, 0, devices);
- while (devices) {
- serialDevice = (struct serialDevice*)devices;
-
- printf("CLASS=%s\n", classStrings[serialDevice->class]);
- printf("BUS=SERIAL\n");
- printf("DEVICE=/dev/%s\n", serialDevice->device);
- printf("DRIVER=%s\n", serialDevice->driver);
- if (!serialDevice->pnpdesc) printf("DESCRIPTION=%s\n", serialDevice->desc);
- if (serialDevice->pnpmfr) printf("MANUFACTURER=%s\n", serialDevice->pnpmfr);
- if (serialDevice->pnpmodel) printf("MODEL=%s\n", serialDevice->pnpmodel);
- if (serialDevice->pnpcompat) printf("COMPAT=%s\n", serialDevice->pnpcompat);
- if (serialDevice->pnpdesc) printf("DESCRIPTION=%s\n", serialDevice->pnpdesc);
- printf("\n");
-
- devices=devices->next;
- }
-
- return 0;
-}