1
0
mirror of git://erdgeist.org/opentracker synced 2025-01-12 07:50:52 +00:00
opentracker/scan_urlencoded_query.h
2007-01-31 09:50:46 +00:00

34 lines
1.1 KiB
C

/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
It is considered beerware. Prost. Skol. Cheers or whatever. */
#ifndef __SCAN_URLENCODED_QUERY_H__
#define __SCAN_URLENCODED_QUERY_H__
#define SCAN_PATH 0
#define SCAN_SEARCHPATH_PARAM 1
#define SCAN_SEARCHPATH_VALUE 2
/* string pointer to source, pointer to after terminator on return
deststring pointer to destination
flags determines, what to parse
returns number of valid converted characters in deststring
or -1 for parse error
*/
ssize_t scan_urlencoded_query(char **string, char *deststring, int flags);
/* data pointer to len chars of string
len length of chars in data to parse
number number to receive result
returns number of bytes not parsed, mostly !=0 means fail
*/
ssize_t scan_fixed_int( char *data, size_t len, int *number );
/* data pointer to len chars of string
len length of chars in data to parse
ip buffer to receive result
returns number of bytes not parsed, mostly !=0 means fail
*/
ssize_t scan_fixed_ip( char *data, size_t len, unsigned char ip[4] );
#endif