ossp-pkg/var/var_test.c 1.28 -> 1.29
--- var_test.c 2001/12/16 23:40:16 1.28
+++ var_test.c 2001/12/17 10:29:43 1.29
@@ -39,7 +39,7 @@
const char *data;
};
-static int var_lookup(
+static var_rc_t var_lookup(
void *context,
const char *varname, size_t name_len, int idx,
const char **data, size_t *data_len,
@@ -55,14 +55,16 @@
*data = vars[i].data;
*data_len = strlen(*data);
*buffer_size = 0;
- return 1;
+ return VAR_OK;
}
}
}
else {
for (i = 0; vars[i].name; ++i) {
if (strncmp(varname, vars[i].name, name_len) == 0) {
+#ifdef DEBUG
printf("Found variable at index %d.\n", i);
+#endif
counter = 1;
length = strlen(vars[i].data);
while ( vars[i + counter].data
@@ -75,11 +77,11 @@
*data = buf;
*data_len = strlen(buf);
*buffer_size = 0;
- return 1;
+ return VAR_OK;
}
}
}
- return 0;
+ return VAR_ERR_UNDEFINED_VARIABLE;
}
struct test_case {
|
|