head 1.24; access; symbols STR_0_9_12:1.24 LMTP2NNTP_1_4_1:1.24 LMTP2NNTP_1_4_0:1.24 STR_0_9_11:1.24 STR_0_9_10:1.24 LMTP2NNTP_1_3_0:1.24 LMTP2NNTP_1_3b2:1.24 LMTP2NNTP_1_3b1:1.24 LMTP2NNTP_1_3a3:1.24 LMTP2NNTP_1_3a2:1.24 STR_0_9_9:1.24 LMTP2NNTP_1_3a1:1.24 STR_0_9_8:1.23 LMTP2NNTP_1_2_0:1.23 LMTP2NNTP_1_2b4:1.23 LMTP2NNTP_1_2b3:1.23 LMTP2NNTP_1_2b2:1.23 LMTP2NNTP_1_2b1:1.23 LMTP2NNTP_1_2a8:1.23 LMTP2NNTP_1_2a7:1.23 LMTP2NNTP_1_2a6:1.22 LMTP2NNTP_1_2a5:1.22 STR_0_9_7:1.22 LMTP2NNTP_1_2a4:1.21 LMTP2NNTP_1_2a3:1.21 OSSP_RC_SPEC:1.21 LMTP2NNTP_1_2a1:1.21 LMTP2NNTP_1_1_1:1.21 LMTP2NNTP_1_1_0:1.21 LMTP2NNTP_1_1b4:1.21 LMTP2NNTP_1_1b3:1.21 LMTP2NNTP_1_1b2:1.21 LMTP2NNTP_1_1b1:1.21 STR_0_9_6:1.21 STR_0_9_5:1.21 STR_0_9_4:1.20 STR_0_9_3:1.17 STR_0_9_2:1.17 STR_0_9_1:1.16 STR_0_9_0:1.14 str_init:1.1.1.1 str:1.1.1; locks; strict; comment @# @; 1.24 date 2003.06.01.07.07.06; author rse; state Exp; branches; next 1.23; 1.23 date 2003.01.06.19.13.47; author rse; state Exp; branches; next 1.22; 1.22 date 2002.04.01.08.32.54; author rse; state Exp; branches; next 1.21; 1.21 date 2001.04.27.12.22.21; author rse; state Exp; branches; next 1.20; 1.20 date 2000.07.03.09.38.16; author rse; state Exp; branches; next 1.19; 1.19 date 2000.05.25.12.51.33; author rse; state Exp; branches; next 1.18; 1.18 date 2000.04.24.16.34.53; author rse; state Exp; branches; next 1.17; 1.17 date 2000.02.04.16.48.16; author rse; state Exp; branches; next 1.16; 1.16 date 2000.01.02.12.25.27; author rse; state Exp; branches; next 1.15; 1.15 date 2000.01.02.12.21.25; author rse; state Exp; branches; next 1.14; 1.14 date 2000.01.01.13.01.48; author rse; state Exp; branches; next 1.13; 1.13 date 2000.01.01.13.01.06; author rse; state Exp; branches; next 1.12; 1.12 date 99.12.28.15.25.10; author rse; state Exp; branches; next 1.11; 1.11 date 99.12.28.10.46.04; author rse; state Exp; branches; next 1.10; 1.10 date 99.12.26.16.05.40; author rse; state dead; branches; next 1.9; 1.9 date 99.12.26.15.12.40; author rse; state Exp; branches; next 1.8; 1.8 date 99.12.26.15.02.01; author rse; state Exp; branches; next 1.7; 1.7 date 99.12.26.14.58.38; author rse; state Exp; branches; next 1.6; 1.6 date 99.12.25.20.57.22; author rse; state Exp; branches; next 1.5; 1.5 date 99.12.25.18.23.02; author rse; state Exp; branches; next 1.4; 1.4 date 99.11.26.18.08.40; author rse; state Exp; branches; next 1.3; 1.3 date 99.11.26.17.08.35; author rse; state Exp; branches; next 1.2; 1.2 date 99.11.23.13.56.55; author rse; state Exp; branches; next 1.1; 1.1 date 99.11.22.17.29.12; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.11.22.17.29.12; author rse; state Exp; branches; next ; desc @@ 1.24 log @remember these issues @ text @ _ ___ ____ ____ ____ _ |_|_ _ / _ \/ ___/ ___|| _ \ ___| |_ _ __ _|_||_| | | | \___ \___ \| |_) | / __| __| '__| |_||_|_| | |_| |___) |__) | __/ \__ \ |_| | |_|_|_| \___/|____/____/|_| |___/\__|_| OSSP str - String Handling TODO o look at printf ideas from ../stdio/printf!! o look at ../strnatcmp o dynamic strings o aprintf() variant of str_format (see end of str_format.c!) The following *have* to be done before 1.0.0: o perhaps a str_shave() or str_strip() function which allows one to strip off characters out of a set from begin and end of a string. Usually for zapping whitespaces from begin and end of string. => str_shave(" \t foo bar ", " \t\n") => "foo bar" o use stdio-style "t" strings insead of STR_TRIGRAPH bitmasks o finish str_test.c: more tests o Dean wrote: btw -- str_compare taking a mode argument doesn't let you trim a few cycles by going into strcmp/strcasecmp which are usually hand-tuned assembly beasts on most boxes. i'd go for str_compare and str_casecompare. The following *could* be done before 1.0.0: o Unicode/UTF-8 support!! o str_encode/str_decode: - plain base64 - strict base64 (with newlines and padding, etc.) o str to/from symbol conversion: - long str_symbol(char *str); o str_format merged with strptime o str_locate could become a "mode" argument which indicates whether "s" is small or large and if it is small a (faster) brute force search could be done. o str_parse could support s/.../g or even m/.../g o one could add "vstr" support with own malloc Dean wrote: have you seen djb's stralloc stuff? it's part of qmail. it looks like a nice way to avoid thinking about lengths. > I really like your Str library, but I have a question: > > What is its equivalent og the Perl 'g' modifier, such as in this example > (Perl): > > $teststr = 'hello/world/nice/to/meet/you'; > $teststr =~ s/\//:/g; > # $teststr == 'hello:world:nice:to:meet:you'; > > I couldn't find it in the documentation. Has this been implemented yet? > If not, is there some other way of doing it? Hmmm... yes, I initially left our the /g variant because I thought just about _matching_ like in m/.../g. But that was silly. You're right, for s/.../ the global flag is very important. It is currently still not implemented, but I've now added it to my TODO list for Str. OTOH your s/\//:/g usually can be performed more easier without str_parse, of course. Just use str_span() in a loop and replace the underlaying character in each step until str_span reached the end of the string. o Feedback from http://www.and.org/vstr/comparison.html: The printf implementation is internal and based on the Apache snprintf() function, '\'' (thousand modifiers), 'a', 'F', 'Lf', 'lld', 'td', 'zd', 'hhd' , etc. and i18n format parameter modifiers are all completely missing Unspecified precision is broken, as is corner cases for octal etc. also infinity/nan output is not correct with regard to case. Buffer overflows are possible in the integer formatting paths You can have custom modifiers, but only triggered on the system '%' character ... so gcc will currently spam warnings. It also looks like the ISO C std. is completely ignored for certain corner cases. Also note that due to the fact that the strings cannot be resized by the library the printf implementation uses a snprint() interface, this means that data can be lost using the interface if the programer isn't carefull. @ 1.23 log @- adjust copyright messages for new year 2003 - strip trailing whitespaces - consistently use OSSP ASCII-art - add standard devtool.conf stuff from OSSP sa @ text @d68 16 @ 1.22 log @finally switch to full OSSP branding @ text @d1 7 a7 7 ____ _ / ___|| |_ _ __ \___ \| __| '__| ___) | |_| | |____/ \__|_| OSSP str - String Handling d15 1 a15 1 d43 1 a43 1 o str_parse could support s/.../g or even m/.../g @ 1.21 log @*** empty log message *** @ text @d7 1 a7 1 Str - String Library @ 1.20 log @*** empty log message *** @ text @d13 2 @ 1.19 log @*** empty log message *** @ text @d10 3 d31 1 @ 1.18 log @*** empty log message *** @ text @d13 6 @ 1.17 log @*** empty log message *** @ text @d36 20 @ 1.16 log @*** empty log message *** @ text @d11 1 a11 1 The following have to be done before 1.0.0: d20 1 a20 1 The following could be done before 1.0.0: @ 1.15 log @*** empty log message *** @ text @a14 1 d25 2 @ 1.14 log @*** empty log message *** @ text @d16 5 d32 2 @ 1.13 log @*** empty log message *** @ text @d11 1 a11 1 The following have to be done before 1.0.0: d13 2 a14 2 o "t" statt STR_TRIGRAPH etc. nutzen! o finish str_test.c: more tests d16 1 a16 1 The following could be done before 1.0.0: d18 9 a26 10 o str_encode/str_decode: - plain base64 - strict base64 (with newlines and padding, etc.) o str_format merged with strptime o str_locate could become a "mode" argument which indicates whether "s" is small or large and if it is small a (faster) brute force search could be done. o str_parse could support s/.../g or even m/.../g o one could add "vstr" support with own malloc @ 1.12 log @*** empty log message *** @ text @d18 5 @ 1.11 log @*** empty log message *** @ text @d13 1 a13 1 o finish str.pod: str_parse needs documenting @ 1.10 log @*** empty log message *** @ text @d1 7 d9 14 a22 3 - str_parse sollte s/.../g unterstuetzen oder sogar m/.../g mit wideraufsetzen - man koennte vstr support einbauen ueber eigene malloc - str.pod @ 1.9 log @*** empty log message *** @ text @@ 1.8 log @*** empty log message *** @ text @a2 1 - str_locate muss noch n parameter unterstuetzen! @ 1.7 log @*** empty log message *** @ text @a5 1 - str-config @ 1.6 log @*** empty log message *** @ text @a4 1 - libtool @ 1.5 log @*** empty log message *** @ text @d3 1 a3 1 - str_find muss noch n parameter unterstuetzen! @ 1.4 log @*** empty log message *** @ text @d5 3 @ 1.3 log @*** empty log message *** @ text @d4 1 @ 1.2 log @*** empty log message *** @ text @a1 2 - str_format soll str_strchr etc. nutzen!! - str_format sollte %pX auslagern in externe structs der Application @ 1.1 log @Initial revision @ text @d4 1 @ 1.1.1.1 log @ @ text @@