
And this is the big "Fix the Parser" patch. It turns the sam_parse function in src/parse.c into something that actually works. Generating the argument list from an incoming SAM thingy is a bit memory churn-y; perhaps when I have time I'll replace all those strdups with structures that simply track the (start,end) indices. Oh and also I moved i2p-ping to the new system. Which required 0 change in code. All I did was fix the Makefile, and add shared library libtool support. Anyway, so enjoy folks. It's rare I'm this productive - polecat
25 lines
395 B
C
25 lines
395 B
C
#ifndef _PARSE_HEADER_FEEP
|
|
#define _PARSE_HEADER_FEEP
|
|
|
|
#include "tinystring.h"
|
|
|
|
typedef struct arg_s {
|
|
string_t name;
|
|
string_t value;
|
|
// int pos;
|
|
} arg_t;
|
|
|
|
typedef struct {
|
|
arg_t* arg;
|
|
int num;
|
|
} args_t;
|
|
|
|
args_t arg_parse(const char*);
|
|
void arg_done(args_t);
|
|
arg_t* arg_get(args_t,int);
|
|
arg_t* arg_find(args_t,string_t);
|
|
|
|
#define AG(a,b) arg_get(a,b)
|
|
|
|
#endif /* _PARSE_HEADER_FEEP */
|