diff options
author | Klaus Kaempf <kkaempf@suse.de> | 2008-02-07 08:53:19 +0000 |
---|---|---|
committer | Klaus Kaempf <kkaempf@suse.de> | 2008-02-07 08:53:19 +0000 |
commit | 65503b9344f9e5246844ce58c72691a66489aa47 (patch) | |
tree | 1fca738a72ddb305565ee790ae9b826a0a4d927e /src/solvable.h | |
parent | 48efc15fc6092516c0550a2696b0c551c79a3074 (diff) | |
download | libsolv-65503b9344f9e5246844ce58c72691a66489aa47.tar.gz libsolv-65503b9344f9e5246844ce58c72691a66489aa47.tar.bz2 libsolv-65503b9344f9e5246844ce58c72691a66489aa47.zip |
introduce Solvable.kind to remove the need for strcmp()/strchr() when
accessing the name in libzypp and other applications.
Its also in preparation of per-kind solving (not implemented yet).
The name prefix (e.g. "pattern:") is still kept but only needed for
capability matching. kind is implemented as an offset (unsigned int)
matching the length of the name prefix. Applications can simply use
(solvable.name + solvable.kind) to strip the prefix from the name.
To prevent name clashes, "product:" was renamed to "prod:". Being
seldomly used, this seems to be acceptable.
Missing understandable documentation on the format of .solv files, the
kind value is currently NOT stored but computed on read.
tools/repo_susetags.c is already prepared to write the kind, solv
version6 should support storing kind values in .solv files.
Diffstat (limited to 'src/solvable.h')
-rw-r--r-- | src/solvable.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/solvable.h b/src/solvable.h index 785128d..c11689f 100644 --- a/src/solvable.h +++ b/src/solvable.h @@ -18,7 +18,20 @@ struct _Repo; +typedef enum { + KIND_PACKAGE = 0, + KIND_PRODUCT = 5, /* strlen("prod:") */ + KIND_PATCH = 6, /* strlen("patch:") */ + KIND_SOURCE = 7, /* strlen("source:") */ + KIND_PATTERN = 8, /* strlen("pattern:") */ + KIND_NOSOURCE = 9, /* strlen("nosource:") */ + _KIND_MAX +} solvable_kind; + +extern const char *kind_prefix( solvable_kind kind ); + typedef struct _Solvable { + unsigned int kind; /* one of KIND_xxx */ Id name; Id arch; Id evr; /* epoch:version-release */ |