Subversion Repositories RepoView

Rev

Rev 3 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 41
Line 1... Line 1...
1
/* $Id: query.c 3 2024-08-20 21:05:24Z nishi $ */
1
/* $Id: query.c 41 2024-08-22 04:26:35Z nishi $ */
2
 
2
 
3
#include "rv_query.h"
3
#include "rv_query.h"
4
 
4
 
5
#include "rv_util.h"
5
#include "rv_util.h"
6
 
6
 
Line 13... Line 13...
13
	char* value;
13
	char* value;
14
};
14
};
15
 
15
 
16
struct query_entry** qentries;
16
struct query_entry** qentries;
17
 
17
 
18
struct query_entry** query;
18
struct query_entry** query = NULL;
19
struct query_entry** postquery;
19
struct query_entry** postquery = NULL;
20
 
20
 
21
void rv_save_query(char c) {
21
void rv_save_query(char c) {
22
	if(c == 'Q') {
22
	if(c == 'Q') {
23
		query = qentries;
23
		query = qentries;
24
	} else if(c == 'P') {
24
	} else if(c == 'P') {
Line 89... Line 89...
89
	free(qentries);
89
	free(qentries);
90
}
90
}
91
 
91
 
92
char* rv_get_query(const char* key) {
92
char* rv_get_query(const char* key) {
93
	int i;
93
	int i;
-
 
94
	if(qentries == NULL) return NULL;
94
	for(i = 0; qentries[i] != NULL; i++) {
95
	for(i = 0; qentries[i] != NULL; i++) {
95
		if(strcmp(qentries[i]->key, key) == 0) {
96
		if(strcmp(qentries[i]->key, key) == 0) {
96
			return qentries[i]->value;
97
			return qentries[i]->value;
97
		}
98
		}
98
	}
99
	}