2005-11-28  Scott James Remnant  <scott@netsplit.com>

	* configure.ac: Release 1.1.0.
	* NEWS: Update release notes.

	* src/pcimap.c (pcimap_udev_event): Add function to fill device
	structure from environment of udev event.
	* tests/pcimap.at (pcimap works from udev event): Add new test.
	* src/usbmap.c (usbmap_udev_event): Add function to fill device
	structure from environment of udev event.
	* tests/usbmap.at (usbmap works from udev event): Add new test.
	* src/inputmap.c (inputmap_udev_event): Add function to fill
	device structure from environment of udev event.
	* tests/inputmap.at (inputmap works from udev event): Add new test.
	* src/ieee1394map.c (ieee1394map_udev_event): Add function to fill
	device structure from environment of udev event.
	(ieee1394map_parse_args): Parse model argument from command-line.
	* tests/ieee1394map.at (ieee1394map works from udev event): Test.
	Also update other tests.
	* src/ccwmap.c (ccwmap_udev_event): Add function to fill device
	structure from environment of udev event.
	* tests/ccwmap.at (ccwmap works from udev event): Add new test.
	* src/seriomap.c (seriomap_udev_event): Add function to fill device
	structure from environmentof udev event.
	* tests/seriomap.at (seriomap works from udev event): Add new test.
	* src/grepmap.h: Add prototypes for all udev_event functions.
	* src/grepmap.c (opts, longopts): Add --udev/-d argument.
	(MapFileTypeInfo): Add udev_subsystem name and udev_event_func
	pointer to structure, and add information to each table entry.
	(main): Handle --udev by parsing the environment and using the
	per-map udev_event() function instead of parsing the command-line.
	* doc/C/grepmap.8: Document --udev option and include an example
	rule.  Update ieee1394map documentation.
	* README: Give example udev rule here too.
	* NEWS: Document --udev option.

	* src/pcimap.c (pcimap_parse_args): Split out argument parsing from
	the match function into a separate one.
	(pcimap_modules): Use passed-in device structure to match.
	* src/usbmap.c (usbmap_parse_args): Split out argument parsing from
	the match function into a separate one.
	(usbmap_modules): Use passed-in device structure to match.
	* src/inputmap.c (inputmap_parse_args): Split out argument parsing
	from the match function into a seperate one.
	(inputmap_modules): Use passed-in device structure to match.
	* src/ieee1394map.c (ieee1394map_parse_args): Split out argument
	parsing from the match function into a separate one.
	(ieee1394map_modules): Use passed-in structure to match.
	* src/ccwmap.c (ccwmap_parse_args): Split out argument parsing from
	the match function into a separate one.
	(ccwmap_modules): Use passed-in device structure to match.
	* src/seriomap.c (seriomap_parse_args): Split out argument parsing
	from the match function into a separate one.
	(seriomap_modules): Use passed-in device structure to match.
	* src/grepmap.h: Move all structure definitions out of their
	separate files and to here.  Modify all function prototypes to
	accept a device structure pointer rather than argv.  Add prototypes
	for all argument-parsing functions.
	* src/grepmap.c (MapFileTypeInfo): Alter structure definition to take
	the size of the device structure instead of the number of arguments,
	and a pointer to the new per-map parse_args functions.
	(main): Allocate enough memory for the device structure and call the
	parse_args function to fill it before calling the modules function.

	* README: Drop all references to bug-compatibility with hotplug.

	* src/ieee1394map.c (ieee1394map_modules): Match the model
	parameter as the kernel does.
	* README: Remove note about ieee1394map bug compatibility.
	* NEWS: Added note about new behaviour.

	* src/inputmap.c (inputmap_modules): Change the version field
	matching to do what the kernel does, instead of what hotplug
	used to do.
	* tests/inputmap.at: Update tests to match.
	* README: Remove note about inputmap bug compatibility.
	* NEWS: Updated inputmap note to reflect new behaviour.

	* README: Replace note about modules.ccwmap not being parsed with
	one about ofmap not being parsed.

	* doc/C/grepmap.8: Update documentation to mention new options.
	Remove note about replacing the slow hotplug shell code, now we're
	using it for a bit more.

	* src/seriomap.c: New file with support for the seriomap files.
	* src/grepmap.h (seriomap_modules): Add function prototype.
	* src/grepmap.c: Add seriomap to the list of parsers.
	* src/Makefile.am (grepmap_SOURCES): Add seriomap.c
	* tests/seriomap.at: Add test suite for seriomap parser
	* tests/testsuite.at: Include seriomap.at
	* tests/Makefile.am (TESTSUITE_GROUPS): Add seriomap.at
	* NEWS: Added note about seriomap support.

	* src/ccwmap.c: New file with support for the s/390 fans.
	* src/grepmap.h (ccwmap_modules): Add function prototype.
	* src/grepmap.c: Add ccwmap to the list of parsers.
	* src/Makefile.am (grepmap_SOURCES): Add ccwmap.c
	* tests/ccwmap.at: Add test suite for ccwmap parser.
	* tests/testsuite.at: Include ccwmap.at.
	* tests/Makefile.am (TESTSUITE_GROUPS): Add ccwmap.at
	* NEWS: Added note about ccwmap support.

	* src/inputmap.c (InputMatchFlags): Add INPUT_MATCH_SWBIT.
	(InputDevice): Add swbit member with appropriate size definitions.
	(inputmap_modules): Parse swbit from command-line, map file and match.
	* src/grepmap.c (map_info): Increase number of arguments to inputmap
	by one.
	* tests/inputmap.at: Add swbit argument to all tests.
	(inputmap obeys match_flags): add test of swbit parameter.
	* NEWS: Added note about inputmap parser change.

2005-09-30  Scott James Remnant  <scott@netsplit.com>

	* configure.ac: Release 1.0.1.
	* NEWS: Updated release notes.

	* configure.ac: Include a check for the size of the long type,
	we'll use this to detect I?LP64 platforms and adjust inputmap
	sizes appropriately.
	* src/grepmap.h: Define LONG_ARRAYS if we're on a platform with
	at least 64 bits in unsigned long; define BitArray to be the
	right type on either.
	* src/inputmap.c (InputDevice): Define array lengths depending
	whether arrays are long or not, change types to BitArray.
	* src/util.c (parse_array): Change parameter type to BitArray,
	when arrays are long use %lx as the scanf parameter().  Change
	array_len parameter to a plain int.
	(parse_line): Use different variables for integer and array
	pointers, change array pointer type to BitArray *.  Change array_len
	parameter to a plain int.
	(match_array): Change parameter types to BitArray, and array_len
	parameter to a plain int.

2005-09-29  Scott James Remnant  <scott@netsplit.com>

	* AUTHORS, src/grepmap.c, src/grepmap.h, src/ieee1394map.c,
	src/inputmap.c, src/pcimap.c, src/usbmap.c, src/util.c: Changed
	author e-mail address from scott@canonical.com to scott@ubuntu.com.

	* src/util.c (parse_line): Fix docstring terminator.

	* configure.ac: Release 1.0.0.
	* NEWS: Updated with release notes.

	* src/grepmap.c (main): Return 2 in case of error.
	* src/ieee1394map.c (ieee1394map_modules): Return 2 if arguments
	weren't in the right format.
	* src/inputmap.c (inputmap_modules): Return 2 also.
	* src/pcimap.c (pcimap_modules): Also return 2.
	* src/usbmap.c (usbmap_modules): And here 2 ;-)

	* doc/C/grepmap.8: Update copyright, document the additional
	permitted prefixes and add a warning that --file files should
	be in the right format.  Document the 2 exit status for other
	errors that I haven't added yet.

	* COPYING: Update to get new FSF address.

	* m4/compiler.m4: Update to latest version.
	(SJR_COMPILER_OPTIMISATIONS): Explicitly set -O0 as gcc sometimes
	seems to prefer a little optimisation now.
	(SJR_COMPILER_COVERAGE): New macro to enable gcc 4 coverage tests.
	* m4/linker.m4: Update to latest version.
	* configure.ac (AC_COPYRIGHT): Update copyright year.
	(AM_INIT_AUTOMAKE): Increase automake version requirement.
	Add SJR_COMPILER_COVERAGE macro.

	* src/grepmap.c (_print_version): Update copyright year.

	* src/util.c (parse_array): Taken from inputmap.c and turned into
	a function we can use anywhere; removed the pos argument and
	logic to move beyond the end of the array, changed array_sz to
	array_len and made it the number of elements not the sizeof.
	(match_array): Also taken from input.c with array_sz changed to
	array_len.
	* src/inputmap.c (_parse_array, _match_array): Remove old static
	function definitions from this file.
	(inputmap_modules): Adjust to use parse_array, match_array and
	parse_line functions from util.c, remember array lengths using
	an enum. 
	* src/ieee1394map.c (ieee1394map_modules): Update to use new
	parse_line() function so we gain the same flexibility benefit.
	* src/pcimap.c (pcimap_modules): Update to use parse_line().
	* src/usbmap.c (usbmap_modules): Update to use parse_line().
	* tests/ieee1394map.at (ieee1394map works without 0x prefixes):
	Add test case for more liberal file parsing.
	* tests/inputmap.at (inputmap works without 0x prefixes): New test.
	* tests/pcimap.at (pcimap works without 0x prefixes): New test.
	* tests/usbmap.at (usbmap works without 0x prefixes): New test.

2004-10-31  Scott James Remnant  <scott@netsplit.com>

	* configure.ac: Add check for size_t
	(AC_INIT): Bump version to 0.1.0
	* NEWS: Add date for 0.1.0 release.

	* README: Document the couple of notes we've obtained so far, and
	generally introduce the software.
	* src/grepmap.c: Remove ccwmap and isapnpmap for now.
	(_print_usage): Add some help for the map type arguments, not much,
	but enough to hint what's happening.
	* doc/C/grepmap.8: Add manual page.
	* Makefile.am (SUBDIRS): Add doc
	* configure.ac (AC_CONFIG_FILES): Add doc/Makefile
	* doc/Makefile.am (man_MANS, EXTRA_DIST): Add C/grepmap.8

	* src/ieee1394map.c (ieee1394map_modules): Parse modules.ieee1394map
	files (firewire, if you prefer), a nice and easy one.
	* src/grepmap.c: Add ieee1394map_modules to map_info table,
	only three arguments for this one.
	* src/grepmap.h (ieee1394map_modules): Add prototype.
	* src/Makefile.am (grepmap_SOURCES): Add ieee1394map.c
	* tests/ieee1394map.at: Test suite for ieee1394map parsing.
	* tests/testsuite.at: Include ieee1394map.at
	* tests/Makefile.am (TESTSUITE_GROUPS): Add ieee1394map.at

	* tests/inputmap.at: Test suite for inputmap parsing.
	* tests/testsuite.at: Include inputmap.at
	* tests/Makefile.am (TESTSUITE_GROUPS): Add inputmap.at
	* src/inputmap.c (inputmap_modules): Add a note about the possibly
	bogus version test (I'm being bug-compatible with hotplug for now).
	* tests/usbmap.at (usbmap ignores comments): Correct title, comments
	not commands, oops.

	* src/inputmap.c (_parse_array): The array is given by the kernel
	in reverse, and length matters for matching; load it in reverse
	and shift it up to the front afterwards.
	(inputmap_modules): Empty strings are valid, so remove any checking
	of the array -- it'll simply return a zero set.

2004-10-30  Scott James Remnant  <scott@netsplit.com>

	* src/inputmap.c (inputmap_modules): Parse modules.inputmap file,
	an evil format involving many values and colon-separated arrays.
	(_parse_array): Helper function to parse colon-separated arrays.
	(_match_array): Helper function to compare two arrays as mask/value.
	* src/grepmap.h (FLAG_SET): Generically useful, so move to the
	header rather than hiding in usbmap.c
	(inputmap_modules): Add inputmap_modules prototype.
	* src/usbmap.c (usbmap_modules): Use < rather than != to check
	sscanf() return value.  Test flags first rather than values.
	* src/pcimap.c (pcimap_modules): Likewise, and as PCI_ANY is the
	more common case check for it first.
	* src/util.c (fgets_alloc): Use a static line buffer for performance
	and increase in allocations of BUFSIZ, not 5 (debugging debris).
	* src/grepmap.c: Add inputmap_modules to map_info table, an
	incredible 12 arguments required.
	* src/Makefile.am (grepmap_SOURCES): Add inputmap.c

	* tests/usbmap.at (usbmap obeys device range): test an exact
	version match.

2004-10-29  Scott James Remnant  <scott@netsplit.com>

	* src/grepmap.c: Add function to MapFileTypeInfo structure and
	associate it in the map_info list to the right ones.  Set number
	of arguments for usbmap (a whopping 9!).
	(main): Call the function through the table rather than a switch.
	* src/usbmap.c (usbmap_modules): Implement modules.usbmap parsing.
	* src/Makefile.am (grepmap_SOURCES): Add usbmap.c
	* tests/usbmap.at: Test usbmap functionality.
	* tests/Makefile.am (TESTSUITE_GROUPS): Add usbmap.at
	* tests/testsuite.at: Include usbmap.at

	* tests/Makefile.am (EXTRA_DIST): Make sure the testsuite group
	files actually get put in the tarball, just in case users feel like
	editing them.

	* tests/Makefile.am (distclean-local): Add missing distclean rule
	to clean out stuff so distcheck works.

	* src/pcimap.c (pcimap_modules): Implement modules.pcimap parsing.
	* src/util.c (fgets_alloc): New function to do an allocating fgets.
	(parse_hex): New function to parse a hexadecimal value.
	* src/grepmap.c (suggest_help): Promote to extern.
	* tests/testsuite.at: Add test suite and include pcimap.at.
	* tests/pcimap.at: Test pcimap functionality.
	* configure.ac: Add AC_CONFIG_TESTDIR, check for autom4te and output
	tests/Makefile, add bug report address.
	* Makefile.am (SUBDIRS): Add tests sub-directory.
	* tests/Makefile.am: Write based on autotest example.

	* src/grepmap.c (main): Save return value from pcimap_modules
	and exit with it later, rather than immediately.
	* src/Makefile.am (grepmap_SOURCES): Add util.c.

	* src/grepmap.c (main): Add a single map_info array to record
	various things about each map type.  Check the number of extra
	arguments matches those needed for the given map type.
	Call pcimap_modules with arguments for the pcimap file type.
	(_map_filename): Use new map_info array.
	* src/pcimap.c (pcimap_modules): New function in a new file.
	* src/Makefile.am (grepmap_SOURCES): Add pcimap.c.

	* src/grepmap.c (main): Move --help and --version's values out
	of the way of others.  Add various map type options, allow only
	one to be specified at a time, fail if none are specified.
	(_print_usage): Document the map type options, flesh out the
	long description a little.
	(_suggest_help): Simple function for when the user needs help.

	* src/grepmap.h: Make program_name available to other files.

	* src/grepmap.c (main): Add -k/--kernel and -f/--file options,
	open the map file and close it when done. --file=- is stdin.
	(_map_filename): New function to construct path	to a map file.
	(_print_usage): Document new options, remove -h and -V as short
	options for --help and --version, use multi-line strings for
	easier translation.
	(_print_version): Use multi-line strings for easier translation.

	* configure.ac: Remove dist-bzip2 from AM_INIT_AUTOMAKE call,
	add AC_CONFIG_MACRO_DIR.
	* src/Makefile.am (INCLUDES): Add -I to intl directory for
	systems without gettext.
	(grepmap_LDADD): Rename grepmap_LIBS to correct name.

2004-10-28  Scott James Remnant  <scott@netsplit.com>

	* src/grepmap.c (main): Gettext initialisation and getopt loop.
	(_print_usage): Prints usage instructions.
	(_print_version): Prints version information.
	* src/grepmap.h: Include gettext.h header and define friendlier
	forms.
	* configure.ac: Correct copyright to include year, oops.
	Check for 'src/grepmap.c' rather than 'src/main.c'.
	Check for C 'const' keyword.
	Check for 'getopt.h' header.
	* m4/compiler.m4: Put -Werror back, removed due to error.
	* src/Makefile.am (INCLUDES): Add gettext magic.
	(grepmap_SOURCES): compile grepmap.c and grepmap.h.

	* ChangeLog: Project started.

