libcwa
11 years agouse more conformant encoding for linebreaks, add a html_fmt_raw() master
Christian Thaeter [Thu, 20 Mar 2008 05:56:21 +0000 (06:56 +0100)]
use more conformant encoding for linebreaks, add a html_fmt_raw()

'\r\n' is not guranteed by C to conform to '\xd\xa' which is required
by http, even on non ascii machines.

11 years agoAdd a encoder to covert html to unix style lineendings
Christian Thaeter [Wed, 19 Mar 2008 12:05:33 +0000 (13:05 +0100)]
Add a encoder to covert html to unix style lineendings

11 years agonew parse_urlencoded implementation
Christian Thaeter [Sun, 10 Feb 2008 11:10:32 +0000 (12:10 +0100)]
new parse_urlencoded implementation

11 years agoFix array length calculation paren typo
Christian Thaeter [Sun, 10 Feb 2008 10:48:43 +0000 (11:48 +0100)]
Fix array length calculation paren typo

11 years agoadd support for different printing functions for html_fmt..()
Christian Thaeter [Tue, 29 Jan 2008 22:20:51 +0000 (23:20 +0100)]
add support for different printing functions for html_fmt..()

11 years agolet the urlencoders return char* instead const char*
Christian Thaeter [Tue, 29 Jan 2008 22:20:10 +0000 (23:20 +0100)]
let the urlencoders return char* instead const char*

11 years agoadd host_name to the cgi request structure
Christian Thaeter [Tue, 29 Jan 2008 22:19:31 +0000 (23:19 +0100)]
add host_name to the cgi request structure

11 years agoreplace print_urlencoeded with the same, sane way as used in encoding.c
Christian Thaeter [Mon, 28 Jan 2008 17:56:32 +0000 (18:56 +0100)]
replace print_urlencoeded with the same, sane way as used in encoding.c

11 years agoset cgi->request_method temporary to "COOKIE" while parsing cookies
Christian Thaeter [Mon, 28 Jan 2008 17:55:11 +0000 (18:55 +0100)]
set cgi->request_method temporary to "COOKIE" while parsing cookies

This is just a convinience feature to allow applications to check if a
value comes from a cookie or from request itself.

11 years agoFix: forgot to terminate encoded strings, missing end of data detection
Christian Thaeter [Sun, 27 Jan 2008 00:18:45 +0000 (01:18 +0100)]
Fix: forgot to terminate encoded strings, missing end of data detection

11 years agoadd encoding functions for url encoding/decoding
Christian Thaeter [Sat, 26 Jan 2008 22:58:56 +0000 (23:58 +0100)]
add encoding functions for url encoding/decoding

11 years agoexport parse_namevalue() declaration
Christian Thaeter [Sat, 26 Jan 2008 22:57:59 +0000 (23:57 +0100)]
export parse_namevalue() declaration

11 years agoAdd cookie parsing to request handling
Christian Thaeter [Sat, 26 Jan 2008 01:23:12 +0000 (02:23 +0100)]
Add cookie parsing to request handling

Cookies are using the same callback functions as other cgi parameters and
are evaluated at first.

11 years agoadd a parsing function for cookie parsing
Christian Thaeter [Sat, 26 Jan 2008 01:19:52 +0000 (02:19 +0100)]
add a parsing function for cookie parsing

takes data which is formatted as semicolon separated name(=value) list

11 years agoadd recycling temporary buffers
Christian Thaeter [Sat, 26 Jan 2008 01:06:11 +0000 (02:06 +0100)]
add recycling temporary buffers

we have a static set of 64 buffers which are dynamically allocated to at
least the requested size (and rarely shrunk when they are far to big)

each call to cwa_buffer_provider() will return a new buffer in cycle which
will wrap around after 64 requests.

cwa_buffer_freeall() will release all memory allocated for buffers.

11 years agoadd user_agent and user_addr fields to struct cgi
Christian Thaeter [Wed, 23 Jan 2008 13:17:15 +0000 (14:17 +0100)]
add user_agent and user_addr fields to struct cgi

11 years agoadd html_include_escaped
Christian Thaeter [Sun, 20 Jan 2008 16:09:13 +0000 (17:09 +0100)]
add html_include_escaped

includes a file and prints it in escaped form

11 years agoFIX: quote escaping was wrong
Christian Thaeter [Tue, 8 Jan 2008 06:01:19 +0000 (07:01 +0100)]
FIX: quote escaping was wrong

11 years agoBinary blob nodes for low level raw data
Christian Thaeter [Tue, 8 Jan 2008 06:00:27 +0000 (07:00 +0100)]
Binary blob nodes for low level raw data

11 years agochange most strdup functions to strndup variants
Christian Thaeter [Wed, 2 Jan 2008 08:32:30 +0000 (09:32 +0100)]
change most strdup functions to strndup variants

11 years agoadd a html_fmt_vargs variant
Christian Thaeter [Wed, 26 Dec 2007 23:43:11 +0000 (00:43 +0100)]
add a html_fmt_vargs variant

11 years agoreplace cwa_strdup with cwa_strndup takeing always a size argument,
Christian Thaeter [Tue, 25 Dec 2007 20:49:00 +0000 (21:49 +0100)]
replace cwa_strdup with cwa_strndup takeing always a size argument,
use SIZE_MAX in doubt.

11 years agoFix: iteration in append_tail_vargs dereferenced null pointer
Christian Thaeter [Tue, 25 Dec 2007 20:45:37 +0000 (21:45 +0100)]
Fix: iteration in append_tail_vargs dereferenced null pointer

11 years agoFix inserting lists in envs
Christian Thaeter [Sat, 22 Dec 2007 10:27:45 +0000 (11:27 +0100)]
Fix inserting lists in envs

11 years agorefactor str_replace and tail_replace, remove swap
Christian Thaeter [Fri, 21 Dec 2007 14:01:32 +0000 (15:01 +0100)]
refactor str_replace and tail_replace, remove swap

tail_replace renamed to tail_append and doesnt delete old tail
remove now unused head_replace
rewritten str_replace

11 years agomake html_list_free() more generic and rename it to html_tail_free()
Christian Thaeter [Fri, 21 Dec 2007 13:24:37 +0000 (14:24 +0100)]
make html_list_free() more generic and rename it to html_tail_free()
freeing any kind of node tail

11 years agoAdd a new LIST node-type
Christian Thaeter [Thu, 20 Dec 2007 14:38:18 +0000 (15:38 +0100)]
Add a new LIST node-type

List nodes can be used to efficiently prepend and append new data
into an existing document tree.

12 years agouse '127' as tag value for magic string/html detection instead '0'
Christian Thaeter [Sun, 16 Dec 2007 17:49:28 +0000 (18:49 +0100)]
use '127' as tag value for magic string/html detection instead '0'

12 years agocwa_strdup(NULL) returns a copy of an empty string
Christian Thaeter [Sun, 16 Dec 2007 17:47:47 +0000 (18:47 +0100)]
cwa_strdup(NULL) returns a copy of an empty string

12 years agoadd cgi_destroy as NOP fro now
Christian Thaeter [Sun, 16 Dec 2007 17:46:44 +0000 (18:46 +0100)]
add cgi_destroy as NOP fro now

12 years agooutput cosmetics
Christian Thaeter [Tue, 11 Dec 2007 18:00:38 +0000 (19:00 +0100)]
output cosmetics

12 years agoadd 'html_strdup_raw()'
Christian Thaeter [Tue, 11 Dec 2007 03:17:09 +0000 (04:17 +0100)]
add 'html_strdup_raw()'

12 years agoFix: find, bug in recursion
Christian Thaeter [Sun, 9 Dec 2007 02:59:00 +0000 (03:59 +0100)]
Fix: find, bug in recursion

12 years agostring find and replace functions
Christian Thaeter [Sun, 9 Dec 2007 00:31:38 +0000 (01:31 +0100)]
string find and replace functions

html_find_str() lets one search for a string in a Html tree,
html_replace_str() replaces a string by a new tree

12 years agocosmetic: html_new() initializes tail to NULL
Christian Thaeter [Fri, 7 Dec 2007 05:46:36 +0000 (06:46 +0100)]
cosmetic: html_new() initializes tail to NULL

12 years agomake cwa_strdup() more graceful
Christian Thaeter [Fri, 7 Dec 2007 05:25:04 +0000 (06:25 +0100)]
make cwa_strdup() more graceful

When NULL is passed, NULL is returned and no attempt to
strdup(NULL) is made

12 years agoliteral strings are 'raw' strings, not html-encoded
Christian Thaeter [Fri, 7 Dec 2007 04:09:32 +0000 (05:09 +0100)]
literal strings are 'raw' strings, not html-encoded

12 years agorenamed 'html_env()' to 'html()'
Christian Thaeter [Fri, 7 Dec 2007 04:08:03 +0000 (05:08 +0100)]
renamed 'html_env()' to 'html()'

12 years agoFix: close tag creation
Christian Thaeter [Fri, 7 Dec 2007 04:03:49 +0000 (05:03 +0100)]
Fix: close tag creation

closing tags stolen a string structure, resulting in double frees

12 years agoIntroduce Htmlv and magic string constructors
Christian Thaeter [Thu, 6 Dec 2007 10:33:28 +0000 (11:33 +0100)]
Introduce Htmlv and magic string constructors

Many parameters became 'Htmlv' that is:
They can either be Html or a static (literal) *nonempty* string.
In the later case the library automagically generates html nodes
from the string. Thus 'html_str()' will be rarely needed.

12 years agochange tag handling in envs with dedicatedv print functions
Christian Thaeter [Wed, 5 Dec 2007 22:35:04 +0000 (23:35 +0100)]
change tag handling in envs with dedicatedv print functions

This should pave the road for prettyprinting html in future

12 years agonicer error string
Christian Thaeter [Tue, 4 Dec 2007 10:32:54 +0000 (11:32 +0100)]
nicer error string

12 years agoFix: pass length 0 for empty values in url parser
Christian Thaeter [Tue, 4 Dec 2007 10:32:31 +0000 (11:32 +0100)]
Fix: pass length 0 for empty values in url parser

12 years agoFix: QUERY_STRING handling
Christian Thaeter [Tue, 4 Dec 2007 09:08:15 +0000 (10:08 +0100)]
Fix: QUERY_STRING handling

12 years agoFix: set printfn in html_head_replace
Christian Thaeter [Tue, 4 Dec 2007 08:27:23 +0000 (09:27 +0100)]
Fix: set printfn in html_head_replace

12 years agoerror() will clash with some libgit function, rename it to error_get()
Christian Thaeter [Tue, 4 Dec 2007 07:33:34 +0000 (08:33 +0100)]
error() will clash with some libgit function, rename it to error_get()

12 years agofix: request.h was never used
Christian Thaeter [Tue, 4 Dec 2007 07:25:10 +0000 (08:25 +0100)]
fix: request.h was never used

12 years agoWe got real error handling now!
Christian Thaeter [Tue, 4 Dec 2007 07:00:21 +0000 (08:00 +0100)]
We got real error handling now!

12 years agorenamed the sourcedir to 'libcwa' and add error handling
Christian Thaeter [Tue, 4 Dec 2007 05:43:53 +0000 (06:43 +0100)]
renamed the sourcedir to 'libcwa' and add error handling

error handling from cinelerra, stripped down to use no threads.
Passes 'const char*' instead error numbers arround.

12 years agoadd CRLF at end of document
Christian Thaeter [Tue, 4 Dec 2007 03:09:44 +0000 (04:09 +0100)]
add CRLF at end of document

12 years agomade parameters to meta and link_rel tags a node
Christian Thaeter [Tue, 4 Dec 2007 02:37:40 +0000 (03:37 +0100)]
made parameters to meta and link_rel tags a node

12 years agorenamed 'cgi_parse_query' to 'cgi_run_query' which is more proper
Christian Thaeter [Mon, 3 Dec 2007 22:23:43 +0000 (23:23 +0100)]
renamed 'cgi_parse_query' to 'cgi_run_query' which is more proper

12 years agohtml_last_get traverses to the tail of a Html node
Christian Thaeter [Mon, 3 Dec 2007 22:23:02 +0000 (23:23 +0100)]
html_last_get traverses to the tail of a Html node

12 years agochange the insert/append functions to a more verbose name head/tail _replace
Christian Thaeter [Mon, 3 Dec 2007 22:02:30 +0000 (23:02 +0100)]
change the insert/append functions to a more verbose name head/tail _replace

12 years agofile including in html
Christian Thaeter [Mon, 3 Dec 2007 09:39:56 +0000 (10:39 +0100)]
file including in html

12 years agoinclude stdarg.h from html.h
Christian Thaeter [Mon, 3 Dec 2007 09:08:44 +0000 (10:08 +0100)]
include stdarg.h from html.h

12 years agoheavy cosmetics
Christian Thaeter [Mon, 3 Dec 2007 04:32:59 +0000 (05:32 +0100)]
heavy cosmetics

12 years agosupport for http headers
Christian Thaeter [Mon, 3 Dec 2007 03:33:52 +0000 (04:33 +0100)]
support for http headers

12 years agomore argumentlist handling cleanup
Christian Thaeter [Mon, 3 Dec 2007 02:56:23 +0000 (03:56 +0100)]
more argumentlist handling cleanup

12 years agoargumentlist refactoring, 'variable' bites the dust for something more generic
Christian Thaeter [Mon, 3 Dec 2007 00:54:59 +0000 (01:54 +0100)]
argumentlist refactoring, 'variable' bites the dust for something more generic

12 years agomake package installable, add common header
Christian Thaeter [Sun, 2 Dec 2007 01:36:17 +0000 (02:36 +0100)]
make package installable, add common header

12 years agoremove test code, read POST data from stdin
Christian Thaeter [Sat, 1 Dec 2007 20:58:14 +0000 (21:58 +0100)]
remove test code, read POST data from stdin

12 years agoautomakeified
Christian Thaeter [Sat, 1 Dec 2007 19:17:43 +0000 (20:17 +0100)]
automakeified

12 years agoC89'fied and prepared for library building
Christian Thaeter [Sat, 1 Dec 2007 19:11:44 +0000 (20:11 +0100)]
C89'fied and prepared for library building

12 years agocgi request handler and parsing
Christian Thaeter [Sat, 1 Dec 2007 17:20:34 +0000 (18:20 +0100)]
cgi request handler and parsing

12 years agocleanup html things
Christian Thaeter [Fri, 30 Nov 2007 02:29:11 +0000 (03:29 +0100)]
cleanup html things

12 years agosimplified html_str variants
Christian Thaeter [Tue, 27 Nov 2007 17:03:24 +0000 (18:03 +0100)]
simplified html_str variants

12 years agohtml_fmt creates formatted strings
Christian Thaeter [Tue, 27 Nov 2007 04:32:51 +0000 (05:32 +0100)]
html_fmt creates formatted strings

12 years agogenesis of a cgitoolbox
Christian Thaeter [Tue, 27 Nov 2007 03:45:19 +0000 (04:45 +0100)]
genesis of a cgitoolbox