diff --git a/docs/commit_messages.txt b/docs/commit_messages.txt index 04328789df69a5672177a6a75bb463fe305db48c..7f109c4b594801bba67dec34103efca14e2adb50 100644 --- a/docs/commit_messages.txt +++ b/docs/commit_messages.txt @@ -1,19 +1,5 @@ Classes: -Data: - This class will handle Data needed by the CMS, provides storage - for modules, manages the database connection and maybe also - contains some caches. At the moment it only provides access to - the Validator. - The two predicates SH_Data_check_tag and SH_Data_check_attr are - wrappers to the appropriate methods of the validator. These are - needed, as there shouldn't be direct calls to the internal - structure of SH_Data. - The modifying methods are not exposed, as the validator - shouldn't be changed while others depend on it, this has to be - implemented later. - Data also contains a wrapper for the self-closing tag predicate. - Attr: The structure SH_Attr implements an HTML Attribute. For every function there is also a static method/function, diff --git a/docs/sefht.texi b/docs/sefht.texi index 31a03b069ccd015169f9410ad631b0dee876a255..b3501e767ea5205fa19f1431e8f09618c7edba24 100644 --- a/docs/sefht.texi +++ b/docs/sefht.texi @@ -1002,6 +1002,117 @@ The parameter @code{cms} must be a valid (non-@code{NULL}) pointer to a @end deftypefun +@node Data +@cindex Data +@cindex Database +@cindex Persistent Cache +@cindex Caches +@tindex @code{SH_Data} @sortas {Data} +@fileindex src/lib/sefht/data.c +@fileindex src/lib/sefht/data.h +@section Data + +@dfn{@code{SH_Data}} manages runtime data, that is needed through the +library. It will manage the database and some caches, but this isn't +implemented yet. Currently it only provides access to the Validator. +This is necessary, because the Validator shouldn't be changed after +Fragments started to depend on it. That's why, Data only provides +reading access to the Validator. On creation a Validator, is created +with definitions for HTML5. This will be configurable in the future. + +@code{SH_Data} is implemented in @file{src/lib/sefht/data.c}, the +declarations are in @file{src/lib/sefht/data.h}. +@node Using @code{SH_Data} +@subsection Using @code{SH_Data} + +@deftypefun {SH_Data *} SH_Data_new (struct SH_Status * status) +create a new Data object + +This implicitly creates a Validator using @code{SH_Validator_new_html5}. + +The returned pointer must be @code{free}d by passing it to +@code{SH_Data_free}. On failure @code{NULL} is returned. + +The parameter @code{status} must be a valid pointer to a +@code{struct SH_Status} or @code{NULL}. It might be allocated on the +stack. It is updated independently of the occurrence of an error.@* +@xref{Error Handling} for more information about the @code{status} +parameter. +@end deftypefun + +@deftypefun void SH_Data_free (SH_Data * data) +free @code{data} + +The parameter @code{data} must be a valid (non-@code{NULL}) pointer to a +@code{SH_Data} obtained by a call to @code{SH_Data_new}. It will be +@code{free}d after the call. +@end deftypefun + +@deftypefun bool SH_Data_check_tag (SH_Data * data, const char * tag) + +checks whether @code{tag} is known to @code{data}'s internal Validator + +@code{TRUE} is returned, if @code{tag} is a valid HTML tag. This +function calls @code{SH_Validator_check_tag}. + +The parameter @code{data} must be a valid (non-@code{NULL}) pointer to a +@code{SH_Data} obtained by a call to @code{SH_Data_new}. It isn't +modified by the call. + +The parameter @code{tag} must be a non-@code{NULL} pointer to a +@code{NULL}-terminated string. It isn't modified by the call. + +@end deftypefun + +@deftypefun bool SH_Data_check_attr (SH_Data * data, @*@ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +const char * tag, @*@ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +const char * attr) + +checks whether @code{attr} is known in combination with @code{tag} to +@code{data}'s internal Validator + +@code{TRUE} is returned, if @code{attr} can be used as attribute for +the tag @code{tag}. If @code{tag} is @code{NULL}, it is checked, +whether @code{attr} is a valid attribute at all. +This function calls @code{SH_Validator_check_attr}. + +The parameter @code{data} must be a valid (non-@code{NULL}) pointer to +a @code{SH_Data} obtained by a call to @code{SH_Data_new}. It isn't +modified by the call. + +The parameter @code{tag} can be @code{NULL}, otherwise it must be a +valid pointer to a @code{NULL}-terminated string. It isn't modified +by the call. + +The parameter @code{attr} must be a non-@code{NULL} pointer to a +@code{NULL}-terminated string. It isn't modified by the call. + +@end deftypefun + +@deftypefun bool SH_Data_is_self_closing_tag (const SH_Data * data, @*@ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +const char * tag, @*@ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +struct SH_Status * status) + +checks whether @code{tag} is of type void + +@code{TRUE} is returned, if @code{tag} is a void element. This +function calls @code{SH_Validator_is_self_closing_tag}. + +The parameter @code{data} must be a valid (non-@code{NULL}) pointer to a +@code{SH_Data} obtained by a call to @code{SH_Data_new}. It isn't +modified by the call. + +The parameter @code{tag} must be a non-@code{NULL} pointer to a +@code{NULL}-terminated string. It isn't modified by the call. + +@end deftypefun + + + @page @node Logging @cindex Logging diff --git a/sefht.geany b/sefht.geany index 249ac1018b8cea53aa73847af5cec76aae808add..184718514c94cf0ad49ff1f01a09cca765d8c67b 100644 --- a/sefht.geany +++ b/sefht.geany @@ -36,7 +36,7 @@ FILE_NAME_3=84;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fp FILE_NAME_4=73;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2FMakefile.am;0;8 FILE_NAME_5=19;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmain.c;0;8 FILE_NAME_6=455;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fdocs%2FMakefile.am;0;8 -FILE_NAME_7=38091;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fdocs%2Fsefht.texi;0;8 +FILE_NAME_7=41264;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fdocs%2Fsefht.texi;0;8 FILE_NAME_8=9;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fdocs%2Fcommit_messages.txt;0;8 FILE_NAME_9=1867;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2FMakefile.am;0;8 FILE_NAME_10=18;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fcms.c;0;8