/* Copyright 1999 Red Hat, Inc.
 *
 * 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.
 *
 */


#ifndef _KUDZU_DEVICES_H_
#define _KUDZU_DEVICES_H_

#include <stdio.h>

enum deviceClass {
    /* device classes... this is somewhat ad-hoc */
	CLASS_UNSPEC, CLASS_OTHER, CLASS_NETWORK, CLASS_SCSI, CLASS_VIDEO, 
	CLASS_AUDIO, CLASS_MOUSE, CLASS_MODEM, CLASS_CDROM, CLASS_TAPE,
	CLASS_FLOPPY, CLASS_SCANNER, CLASS_HD, CLASS_RAID, CLASS_PRINTER,
	CLASS_CAPTURE, CLASS_KEYBOARD, CLASS_PCMCIA
};

enum deviceBus {
    /* 'bus' that a device is attached to... this is also ad-hoc */
    /* BUS_SBUS is sort of a misnomer - it's more or less Sun */
    /* OpenPROM probing of all various associated non-PCI buses */
    BUS_UNSPEC = 0,
    BUS_OTHER = (1 << 0),
    BUS_PCI = (1 << 1),
    BUS_SBUS = (1 << 2),
    BUS_PSAUX = (1 << 3),
    BUS_SERIAL = (1 << 4),
    BUS_PARALLEL = (1 << 5),
    BUS_SCSI = (1 << 6),
    BUS_IDE = (1 << 7),
    /* Again, misnomer */
    BUS_KEYBOARD = (1 << 8),
#ifdef _i_wanna_build_this_crap_
    BUS_ISAPNP = (1 << 9),
#endif
};

struct device {
	/* This pointer is used to make lists by the library. */
	/* Do not expect it to remain constant (or useful) across library calls. */
	struct device *next;
	/* Used for ordering, and for aliasing (modem0, modem1, etc.) */
	int index;
	enum deviceClass class;	/* type */
	enum deviceBus bus;		/* bus it's attached to */
	char * device;		/* device file associated with it */
	char * driver;		/* driver to load, if any */
	char * desc;		/* a description */
	int detached;		/* should we care if it disappears? */
	struct device *(*newDevice) (struct device *old, struct device *new);
	void (*freeDevice) (struct device *dev);
	void (*writeDevice) (FILE *file, struct device *dev);
	int (*compareDevice) (struct device *dev1, struct device *dev2);
};

struct device *newDevice(struct device *old, struct device *new);
void freeDevice(struct device *dev);
void writeDevice(FILE *file, struct device *dev);
int compareDevice(struct device *dev1, struct device *dev2);
struct device *readDevice(FILE *file);

/* Most of these aren't implemented yet...... */
/* Return everything found, even non-useful stuff */
#define PROBE_ALL       1
/* Don't do 'dangerous' probes that could do weird things (isapnp, serial) */
#define PROBE_SAFE (1<<1)
/* Stop at first device found */
#define PROBE_ONE       (1<<2)


#endif
option value='topic/before_matchbox_wm'>topic/before_matchbox_wm</option>
<option value='topic/bug-13680'>topic/bug-13680</option>
<option value='topic/dietlibc'>topic/dietlibc</option>
<option value='topic/efi'>topic/efi</option>
<option value='topic/extlinux'>topic/extlinux</option>
<option value='topic/firewall'>topic/firewall</option>
<option value='topic/gdk-pixbuf-0-branch'>topic/gdk-pixbuf-0-branch</option>
<option value='topic/gi-ppc'>topic/gi-ppc</option>
<option value='topic/ia64-8_1'>topic/ia64-8_1</option>
<option value='topic/mandrakesoft'>topic/mandrakesoft</option>
<option value='topic/mlcd4'>topic/mlcd4</option>
<option value='topic/ppp'>topic/ppp</option>
<option value='topic/rp-pppoe'>topic/rp-pppoe</option>
<option value='topic/switching_to_dnf'>topic/switching_to_dnf</option>
<option value='topic/switching_to_urpmi'>topic/switching_to_urpmi</option>
<option value='topic/unlabeled-1.1.1'>topic/unlabeled-1.1.1</option>
<option value='topic/v_webmin_0_87'>topic/v_webmin_0_87</option>
<option value='topic/x86_64-branch'>topic/x86_64-branch</option>
<option value='user/animtim/designWork'>user/animtim/designWork</option>
<option value='user/colin/rescue-systemd'>user/colin/rescue-systemd</option>
<option value='user/ennael/mga6'>user/ennael/mga6</option>
<option value='user/erwan/bug-13680'>user/erwan/bug-13680</option>
<option value='user/jibz/aarch64'>user/jibz/aarch64</option>
<option value='user/martinw/mga6'>user/martinw/mga6</option>
<option value='user/pterjan/arm64'>user/pterjan/arm64</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Mageia Installer and base platform for many utilities</td><td class='sub right'>Thierry Vignaud [tv]</td></tr></table>
<table class='tabs'><tr><td>
<a href='/software/drakx/?h=18.23'>summary</a><a href='/software/drakx/refs/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>refs</a><a href='/software/drakx/log/?h=18.23'>log</a><a href='/software/drakx/tree/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>tree</a><a class='active' href='/software/drakx/commit/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>commit</a><a href='/software/drakx/diff/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>diff</a><a href='/software/drakx/stats/?h=18.23'>stats</a></td><td class='form'><form class='right' method='get' action='/software/drakx/log/'>
<input type='hidden' name='h' value='18.23'/><input type='hidden' name='id' value='ddd841d85a7688c52e882c1dbd927d7e33a11332'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='18.23'/><input type='hidden' name='id' value='ddd841d85a7688c52e882c1dbd927d7e33a11332'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>José Melo &lt;mmodem@mandriva.org&gt;</td><td class='right'>2006-03-10 14:45:15 +0000</td></tr>
<tr><th>committer</th><td>José Melo &lt;mmodem@mandriva.org&gt;</td><td class='right'>2006-03-10 14:45:15 +0000</td></tr>
<tr><th>commit</th><td colspan='2' class='sha1'><a href='/software/drakx/commit/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>ddd841d85a7688c52e882c1dbd927d7e33a11332</a> (<a href='/software/drakx/patch/?id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='sha1'><a href='/software/drakx/tree/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>11ec8066c9612b1e6e1ab2c9f432836d35dbda14</a></td></tr>
<tr><th>parent</th><td colspan='2' class='sha1'><a href='/software/drakx/commit/?h=18.23&amp;id=893c851d0be2775f772ee960b36b73c67bace3cc'>893c851d0be2775f772ee960b36b73c67bace3cc</a> (<a href='/software/drakx/diff/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332&amp;id2=893c851d0be2775f772ee960b36b73c67bace3cc'>diff</a>)</td></tr><tr><th>download</th><td colspan='2' class='sha1'><a href='/software/drakx/snapshot/drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar'>drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar</a><br/><a href='/software/drakx/snapshot/drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.gz'>drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.gz</a><br/><a href='/software/drakx/snapshot/drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.bz2'>drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.bz2</a><br/><a href='/software/drakx/snapshot/drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.xz'>drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.tar.xz</a><br/><a href='/software/drakx/snapshot/drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.zip'>drakx-ddd841d85a7688c52e882c1dbd927d7e33a11332.zip</a><br/></td></tr></table>
<div class='commit-subject'>*** empty log message ***</div><div class='commit-msg'></div><div class='diffstat-header'><a href='/software/drakx/diff/?h=18.23&amp;id=ddd841d85a7688c52e882c1dbd927d7e33a11332'>Diffstat</a></div><table summary='diffstat' class='diffstat'>