1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[qs_parse] const

This commit is contained in:
Witold Filipczyk 2022-02-09 18:19:22 +01:00
parent bd6a1d1d23
commit ae32e08ee4
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@
#define HEX2DEC(x) (((x)>='0'&&(x)<='9') ? (x)-48 : ((x)>='A'&&(x)<='F') ? (x)-55 : ((x)>='a'&&(x)<='f') ? (x)-87 : 0)
#define ISQSCHR(x) ((((x)=='=')||((x)=='#')||((x)=='&')||((x)=='\0')) ? 0 : 1)
int qs_strncmp(char * s, char * qs, size_t n)
int qs_strncmp(const char * s, char * qs, size_t n)
{
int i=0;
unsigned char u1, u2, unyb, lnyb;
@ -129,7 +129,7 @@ int qs_decode(char * qs)
}
char * qs_k2v(char * key, char * qs_kv[], int qs_kv_size)
char * qs_k2v(const char *key, char * qs_kv[], int qs_kv_size)
{
int i;
size_t key_len, skip;

View File

@ -11,7 +11,7 @@ extern "C" {
/* Similar to strncmp, but handles URL-encoding for either string */
int qs_strncmp(char * s, char * qs, size_t n);
int qs_strncmp(const char * s, char * qs, size_t n);
/* Finds the beginning of each key/value pair and stores a pointer in qs_kv.
@ -28,7 +28,7 @@ int qs_decode(char * qs);
/* Looks up the value according to the key on a pre-processed query string
* A future enhancement will be a compile-time option to look up the key
* in a pre-sorted qs_kv array via a binary search. */
char * qs_k2v(char * key, char * qs_kv[], int qs_kv_size);
char * qs_k2v(const char * key, char * qs_kv[], int qs_kv_size);
/* Non-destructive lookup of value, based on key. User provides the