+ char *linepos;
+ char *temp;
+
+ linepos = *line;
+ if (!linepos)
+ return -1;
+
+ /* skip whitespace */
+ while (isspace(linepos[0]) || linepos[0] == ',')
+ linepos++;
+
+ /* get the key */
+ *key = linepos;
+ while (1) {
+ linepos++;
+ if (linepos[0] == '\0')
+ return -1;
+ if (isspace(linepos[0]))
+ break;
+ if (linepos[0] == '=')
+ break;
+ if (linepos[0] == '+')
+ break;
+ if (linepos[0] == '!')
+ break;
+ if (linepos[0] == ':')
+ break;
+ }
+
+ /* remember end of key */
+ temp = linepos;
+
+ /* skip whitespace after key */
+ while (isspace(linepos[0]))
+ linepos++;
+
+ /* get operation type */
+ if (linepos[0] == '=' && linepos[1] == '=') {
+ *operation = KEY_OP_MATCH;
+ linepos += 2;
+ dbg("operator=match");
+ } else if (linepos[0] == '!' && linepos[1] == '=') {
+ *operation = KEY_OP_NOMATCH;
+ linepos += 2;
+ dbg("operator=nomatch");
+ } else if (linepos[0] == '+' && linepos[1] == '=') {
+ *operation = KEY_OP_ADD;
+ linepos += 2;
+ dbg("operator=add");
+ } else if (linepos[0] == '=') {
+ *operation = KEY_OP_ASSIGN;
+ linepos++;
+ dbg("operator=assign");
+ } else if (linepos[0] == ':' && linepos[1] == '=') {
+ *operation = KEY_OP_ASSIGN_FINAL;
+ linepos += 2;
+ dbg("operator=assign_final");
+ } else
+ return -1;