1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 10:18:28 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Werner Almesberger
44e4434b4c qpkg: towards "struct id" without jrb reference - change ID creation
- id.h, id.c (make_id): return a "struct jrb *", so that we have access to
  key and value
- gobble.c (ID, gobble_buf): adapt to above change
- gobble.c (compact_pkg, gobble_buf): keep the RB node reference instead
  of awkwardly regenerating it via pkg->id->jrb
2010-11-21 03:12:00 -03:00
Werner Almesberger
7058115a64 qpkg: towards "struct id" without jrb reference - change iteration and lookup
- id.h, id.c (first_id, next_id): removed
- qpkg.c (list_all_packages): use jrb_first/jrb_next instead of
  first_id/next_id
- id.h, id.c (find_id): return the RB tree node instead of the ID
- qpkg.c (list_one_package, find_prereq): adapted for above change
- id.h: explain the role of key and value
2010-11-21 03:11:54 -03:00
Werner Almesberger
3d1ef02aba qpkg: added copyright headers and changed name to emphasize speediness
- Makefile, gobble.h, gobble.c, id.h, id.c, prereq.h, prereq.c, qpkg.h,
  qpkg.c, rbtest.c: added copyright header
- id.c: include jrb.h (for completeness)
- README: change name from "Query package databases" to "Quick package
  database query"
2010-11-20 07:29:18 -03:00
Werner Almesberger
03c5e4ffe7 qpkg: optimize duplicate lookup when inserting a new name
- jrb.h, jrb.c (jrb_find_or_insert): new function to look for a node and
  to insert a new one if not found
- id.c (make_id): use jrb_find_or_insert to avoid looking up new nodes
  twice
- TODO: report the improvement
2010-11-19 22:20:15 -03:00
Werner Almesberger
64c70e77f4 qpkg: use "val" field of jrb nodes instead of keeping one in "struct id"
- id.h (struct id), id.c (make_id): remove field "value"
- gobble.c (compact_pkg, gobble_buf), prereq.c (list_all_packages,
  list_one_package, find_prereq): use id->jrb->val instead of id->value
2010-11-19 22:02:42 -03:00
Werner Almesberger
a9f12d5666 qpkg: converted ID comparison from "struct id *" to "void *"
- id.h (struct tree, comp_id, make_tree), id.c (comp_id, make_tree):
  comparison function now takes "void *" (pointing to a "struct id")
  arguments instead of "struct id *", for compatibility with jrb
- id.c (comp_id, do_comp_id): added wrapper to convert "void *" back to
  "struct id *"
2010-11-19 21:53:43 -03:00
Werner Almesberger
e1814ce372 qpkg: converted dumb binary trees to red-black trees (in progress)
This is a change of the underlying mechanism but it's not polished or
optimized yet. The compare functions haven't been updated, so they work
but produce compiler warnings because of type mismatches.

- Makefile (OBJS): added jrb.o
- id.h, id.c: use jrb instead of own dumb binary trees
- TODO: brag about the efficiency improvement
2010-11-19 21:53:38 -03:00
Werner Almesberger
43b9dc1972 qpkg/: initial commit (sneak preview only, doesn't work properly yet) 2010-11-19 14:00:15 -03:00