summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <sven.eden@gmx.de>2013-02-11 08:37:27 +0100
committerSven Eden <sven.eden@gmx.de>2013-02-11 08:40:03 +0100
commitb23472af8e6dda4e7040e39916fa896619e417f0 (patch)
tree4d16948fbe0de6bf51e021c3c6dba059000b68d5 /ufed-curses-types.c
parentAdded new pkguse field to generation and removed obsolete and superfluous ad... (diff)
downloadufed-b23472af8e6dda4e7040e39916fa896619e417f0.tar.gz
ufed-b23472af8e6dda4e7040e39916fa896619e417f0.tar.bz2
ufed-b23472af8e6dda4e7040e39916fa896619e417f0.zip
Added sixth flag character to addFlagDesc() and new statePkgUse to use it to struct sDesc_.
Diffstat (limited to 'ufed-curses-types.c')
-rw-r--r--ufed-curses-types.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ufed-curses-types.c b/ufed-curses-types.c
index 0d31300..3cdb04d 100644
--- a/ufed-curses-types.c
+++ b/ufed-curses-types.c
@@ -102,7 +102,7 @@ sFlag* addFlag (sFlag** root, const char* name, int line, int ndesc, const char
* @param[in] state '+','-',' ' for global, installed, forced, masked, package - in that order.
* @return the full length of the description including package list and separators
**/
-size_t addFlagDesc (sFlag* flag, const char* pkg, const char* desc, const char state[5])
+size_t addFlagDesc (sFlag* flag, const char* pkg, const char* desc, const char state[6])
{
size_t result = 3; // space and brackets.
if (flag) {
@@ -111,7 +111,7 @@ size_t addFlagDesc (sFlag* flag, const char* pkg, const char* desc, const char s
if (idx < flag->ndesc) {
// state is a byte mask. Check it first:
- for (int i = 0; i < 5; ++i) {
+ for (int i = 0; i < 6; ++i) {
if (('+' != state[i]) && ('-' != state[i]) && (' ' != state[i]))
ERROR_EXIT(-1, "Illegal character '%c' in state string at position %d\n",
state[i], i)
@@ -125,6 +125,7 @@ size_t addFlagDesc (sFlag* flag, const char* pkg, const char* desc, const char s
flag->desc[idx].stateForced = state[2];
flag->desc[idx].stateMasked = state[3];
flag->desc[idx].statePackage = state[4];
+ flag->desc[idx].statePkgUse = state[5];
// Set flag mask and force status if this is a global and masked/forced description
if (flag->desc[idx].isGlobal && ('+' == flag->desc[idx].stateMasked))