Commit Graph

14 Commits

Author SHA1 Message Date
Andrew Bettison
5013424ab1 New "str.h" functions: strn_str_cmp(), strn_str_casecmp() 2013-02-13 15:52:44 +10:30
Andrew Bettison
8425882ffc Merge branch 'newconfig' into 'master'
Conflicts:
	commandline.c
	conf.h
	dataformats.c
	log.h
	overlay_address.c
	overlay_interface.c
	packetformats.c
	rhizome.c
	serval.h
	tests/directory_service
	vomp_console.c
2012-12-07 14:09:55 +10:30
Andrew Bettison
c4b90a108b Fix compile warnings on Solaris (gcc 4.4) 2012-11-28 14:13:25 +10:30
Andrew Bettison
494a766b9e Improve str.h and str.c
Move alloca_tohex() from serval.h into str.h so it can be used stand-alone.

Rename str_to_ll_scaled() to str_to_int64_scaled().  Add str_to_uint64_scaled()
and scale_factor().

Add a few more URI parsing functions.  Move some functions out of str.c and
into str.h as inline functions.
2012-11-22 18:15:40 +10:30
Andrew Bettison
960a6293e1 Move str_is_uri() from dataformats.c to str.c
Add lots of URI unpacking functions as well.
2012-11-21 18:08:06 +10:30
Andrew Bettison
c84b7e5db4 Improve str.h functions
Add strn_startswith() and strncase_startswith().

Make all str*_startswith() functions take const char * arguments, to make it
possible to do safe programming with consts.
2012-11-20 18:10:08 +10:30
Andrew Bettison
0e435683f7 Move toprint functions from log.h to str.h
Move alloca_sockaddr() to strbuf_helpers.h

So that stand-alone executables can use them without pulling in the entire
logging framework.
2012-11-20 18:10:08 +10:30
Andrew Bettison
4450116472 Refactor string functions, add str_fromprint()
Move lots of non-Serval-specific string functions from "serval.h"/dataformats.c
to "str.h"/str.c.

Add str_fromprint() function that reverses the effect of toprint(): interprets
escape sequences in the source string "\n\t\r\0\xHH\\" and replaces them with a
single char in the destination string.
2012-11-07 16:42:45 +10:30
Andrew Bettison
d38ce66c95 Improve test framework: create_file()
New executable in Makefile 'all' target: tfw_createfile.

New str.h function: str_to_ll_scaled().
2012-10-31 18:13:33 +10:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
245c7e7f49 Change str_str() to return (char*) not (const char*)
Also rewrite implementation to handle edge cases, rename arguments to be more
self documenting.
2012-10-03 17:13:45 +09:30
Jeremy Lakeman
fa7719fbe8 Write simple vomp console client 2012-09-28 15:23:50 +09:30
gardners
fb82043246 added str_str() to help parse http POST requests for rhizome direct. #9 2012-08-31 13:01:29 +09:30
Jeremy Lakeman
7705676a9e Move str functions to c file to enable reuse 2012-08-09 13:30:52 +09:30