+NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, char **ret)
+{
+ int i;
+
+ for (i = 0; i < ctx->keyval_count; i++) {
+ if (strcmp(ctx->data[i]->key, key) == 0) {
+ *ret = ctx->data[i]->val;
+ return NT_STATUS_OK;
+ }
+ }
+ return NT_STATUS_NOT_FOUND;
+}
+
+/****************************************************************
+****************************************************************/
+
+NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int *ret)
+{
+ char *value;
+ NTSTATUS result;
+
+ result = gp_inifile_getstring(ctx,key, &value);
+ if (!NT_STATUS_IS_OK(result)) {
+ return result;
+ }
+
+ *ret = (int)strtol(value, NULL, 10);
+ return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
+NTSTATUS gp_inifile_init_context(TALLOC_CTX *mem_ctx,