Skip to content
Snippets Groups Projects
Commit c408639b authored by Jonathan Schöbel's avatar Jonathan Schöbel
Browse files

added splint annotations (fragment)

parent 6f871cb6
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=6
current_page=10
FILE_NAME_0=923;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
FILE_NAME_1=73;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2FMakefile.am;0;8
FILE_NAME_2=1143;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmain.c;0;8
......@@ -37,27 +37,29 @@ FILE_NAME_4=1593;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fpr
FILE_NAME_5=1395;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fcms.h;0;8
FILE_NAME_6=2921;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fdata.c;0;8
FILE_NAME_7=1583;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fdata.h;0;8
FILE_NAME_8=1733;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.c;0;8
FILE_NAME_9=2164;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.h;0;8
FILE_NAME_10=1296;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.c;0;8
FILE_NAME_11=2259;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.h;0;8
FILE_NAME_12=1384;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext.c;0;8
FILE_NAME_13=2692;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext.h;0;8
FILE_NAME_14=1212;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.c;0;8
FILE_NAME_15=1260;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.h;0;8
FILE_NAME_16=1466;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator_tag.c;0;8
FILE_NAME_17=1135;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator_tag.h;0;8
FILE_NAME_18=4304;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fstatus.h;0;8
FILE_NAME_19=1017;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Flog.h;0;4
FILE_NAME_20=1077;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fmacro.h;0;8
FILE_NAME_21=937;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fsefht.h;0;8
FILE_NAME_22=499;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2FMakefile.am;0;8
FILE_NAME_23=1510;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_cms.c;0;8
FILE_NAME_24=3878;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_25=14714;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_node_fragment.c;0;8
FILE_NAME_26=976;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_27=6814;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
FILE_NAME_28=165;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
FILE_NAME_8=1185;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.c;0;8
FILE_NAME_9=1835;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.h;0;8
FILE_NAME_10=1156;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment_data.c;0;8
FILE_NAME_11=1164;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment_class.c;0;8
FILE_NAME_12=1099;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.c;0;8
FILE_NAME_13=2259;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.h;0;8
FILE_NAME_14=1384;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext.c;0;8
FILE_NAME_15=2692;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext.h;0;8
FILE_NAME_16=1212;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.c;0;8
FILE_NAME_17=1260;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.h;0;8
FILE_NAME_18=1466;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator_tag.c;0;8
FILE_NAME_19=1135;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator_tag.h;0;8
FILE_NAME_20=4304;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fstatus.h;0;8
FILE_NAME_21=1017;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Flog.h;0;4
FILE_NAME_22=1077;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fmacro.h;0;8
FILE_NAME_23=937;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fsefht.h;0;8
FILE_NAME_24=499;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2FMakefile.am;0;8
FILE_NAME_25=1510;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_cms.c;0;8
FILE_NAME_26=3878;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_27=14714;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_node_fragment.c;0;8
FILE_NAME_28=976;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_29=6814;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
FILE_NAME_30=165;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
[VTE]
last_dir=/home/jonathan/Documents/projects/prgm/internet/web/SeFHT/tests
......
......@@ -17,6 +17,8 @@ libsefht_la_SOURCES += sefht/text.c sefht/text.h
libsefht_la_SOURCES += sefht/validator.c sefht/validator.h
EXTRA_DIST =
EXTRA_DIST += sefht/fragment_class.c
EXTRA_DIST += sefht/fragment_data.c
EXTRA_DIST += sefht/validator_tag.c
nobase_include_HEADERS =
......
......@@ -31,26 +31,41 @@
#include "fragment.h"
#include "fragment_data.c"
/*@null@*/
/*@only@*/
struct SH_Fragment *
SH_Fragment_copy (struct SH_Fragment * fragment,
struct SH_Status * status)
SH_Fragment_copy (const struct SH_Fragment * fragment,
/*@out@*/ /*@null@*/ struct SH_Status * status)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/
{
return fragment->methods->copy (fragment, status);
}
void
SH_Fragment_free (struct SH_Fragment * fragment)
SH_Fragment_free (/*@only@*/ struct SH_Fragment * fragment)
/*@modifies fragment@*/
/*@releases fragment@*/
{
return fragment->methods->free (fragment);
fragment->methods->free (fragment);
return;
}
struct SH_Text *
SH_Fragment_to_html (struct SH_Fragment * fragment,
/*@null@*/
/*@only@*/
SH_Text *
SH_Fragment_to_html (const struct SH_Fragment * fragment,
enum HTML_MODE mode,
unsigned int indent_base,
unsigned int indent_step,
char * indent_char,
struct SH_Status * status)
const char * indent_char,
/*@out@*/ /*@null@*/ struct SH_Status * status)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/
{
return fragment->methods->to_html (fragment, mode,
indent_base,
......
......@@ -41,98 +41,34 @@ enum HTML_MODE
WRAP
};
#ifdef LIB_SEFHT_COMPILATION
typedef /*@abstract@*/ struct SH_Fragment SH_Fragment;
enum SH_FRAGMENT_TYPE
{
NODE
};
struct fragment_methods;
struct SH_Fragment;
struct SH_Fragment
{
SH_Data * data;
enum SH_FRAGMENT_TYPE type;
const struct fragment_methods * methods;
};
struct fragment_methods
{
struct SH_Fragment * (*copy) (struct SH_Fragment *,
struct SH_Status *);
void (*free) (struct SH_Fragment *);
struct SH_Text * (*to_html) (struct SH_Fragment *,
enum HTML_MODE,
unsigned int,
unsigned int,
const char *,
struct SH_Status *);
};
static inline
void
init_fragment (struct SH_Fragment * fragment,
struct SH_Data * data,
const enum SH_FRAGMENT_TYPE type,
const struct fragment_methods * const methods)
{
fragment->data = data;
fragment->type = type;
fragment->methods = methods;
return;
}
static inline
void
free_fragment (struct SH_Fragment * fragment)
{
(void) fragment;
return;
}
static inline
void
copy_fragment (struct SH_Fragment * copy,
struct SH_Fragment * fragment)
{
copy->data = fragment->data;
copy->type = fragment->type;
copy->methods = fragment->methods;
return;
}
static inline
enum SH_FRAGMENT_TYPE
get_type (struct SH_Fragment * fragment)
{
return fragment->type;
}
#endif /* LIB_SEFHT_COMPILATION */
typedef struct SH_Fragment SH_Fragment;
SH_Fragment *
SH_Fragment_copy (SH_Fragment * fragment,
struct SH_Status * status);
/*@null@*/
/*@only@*/
struct SH_Fragment *
SH_Fragment_copy (const SH_Fragment * fragment,
/*@out@*/ /*@null@*/ struct SH_Status * status)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/;
void
SH_Fragment_free (SH_Fragment * fragment);
SH_Fragment_free (/*@only@*/ SH_Fragment * fragment)
/*@modifies fragment@*/
/*@releases fragment@*/;
/*@null@*/
/*@only@*/
SH_Text *
SH_Fragment_to_html (SH_Fragment * fragment,
SH_Fragment_to_html (const struct SH_Fragment * fragment,
enum HTML_MODE mode,
unsigned int indent_base,
unsigned int indent_step,
char * indent_char,
struct SH_Status * status);
const char * indent_char,
/*@out@*/ /*@null@*/ struct SH_Status * status)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/;
#endif /* __FRAGMENT_H__ */
/*
* fragment_class.c
*
* Copyright 2022 Jonathan Schöbel <jonathan@Ubermos-2019>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#ifndef __FRAGMENT_CLASS_C__
#define __FRAGMENT_CLASS_C__
#if !defined (__SEFHT_H_INSIDE__) && !defined (LIB_SEFHT_COMPILATION)
#error "Only <sefht/sefht.h> can be included directly."
#endif
#include "status.h"
#include "data.h"
#include "text.h"
#ifdef LIB_SEFHT_COMPILATION
#include "fragment_data.c"
static inline
void
init_fragment (struct SH_Fragment * fragment,
SH_Data * data,
const enum SH_FRAGMENT_TYPE type,
const struct fragment_methods * const methods)
/*@sets fragment->data,
fragment->type@*/
{
fragment->data = data;
fragment->type = type;
fragment->methods = methods;
return;
}
static inline
void
free_fragment (struct SH_Fragment * fragment)
{
(void) fragment;
return;
}
static inline
void
copy_fragment (struct SH_Fragment * copy,
struct SH_Fragment * fragment)
{
copy->data = fragment->data;
copy->type = fragment->type;
copy->methods = fragment->methods;
return;
}
static inline
enum SH_FRAGMENT_TYPE
get_type (struct SH_Fragment * fragment)
{
return fragment->type;
}
#endif /* LIB_SEFHT_COMPILATION */
#endif /* __FRAGMENT_CLASS_C__ */
/*
* fragment_data.c
*
* Copyright 2022 Jonathan Schöbel <jonathan@Ubermos-2019>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#ifndef __FRAGMENT_DATA_C__
#define __FRAGMENT_DATA_C__
#if !defined (__SEFHT_H_INSIDE__) && !defined (LIB_SEFHT_COMPILATION)
#error "Only <sefht/sefht.h> can be included directly."
#endif
#include "status.h"
#include "data.h"
#include "text.h"
#ifdef LIB_SEFHT_COMPILATION
enum SH_FRAGMENT_TYPE
{
NODE
};
struct SH_Fragment;
struct fragment_methods
{
/*@null@*/
/*@only@*/
struct SH_Fragment *
(*copy) (const struct SH_Fragment *,
/*@out@*/ /*@null@*/ struct SH_Status *)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/;
void
(*free) (/*@only@*/ struct SH_Fragment *)
/*@modifies fragment@*/
/*@releases fragment@*/;
/*@null@*/
/*@only@*/
struct SH_Text *
(*to_html) (const struct SH_Fragment *,
enum HTML_MODE,
unsigned int,
unsigned int,
const char *,
/*@out@*/ /*@null@*/ struct SH_Status *)
/*@globals fileSystem@*/
/*@modifies fileSystem@*/
/*@modifies status@*/;
};
struct SH_Fragment
{
SH_Data * data;
enum SH_FRAGMENT_TYPE type;
const struct fragment_methods * methods;
};
#endif /* LIB_SEFHT_COMPILATION */
#endif /* __FRAGMENT_DATA_C__ */
......@@ -40,6 +40,8 @@
#include "node_fragment.h"
#include "fragment_class.c"
struct SH_NodeFragment
{
struct SH_Fragment base;
......@@ -59,7 +61,7 @@ struct SH_NodeFragment
static const struct fragment_methods methods = {
(struct SH_Fragment * (*)(struct SH_Fragment *,
(struct SH_Fragment * (*)(const struct SH_Fragment *,
struct SH_Status *))
SH_NodeFragment_deepcopy,
......
......@@ -114,7 +114,7 @@ do \
size_t index; \
size_t free_index; \
\
for (index = 1; index <= ITER##_n; index++) \
for (index = (size_t) 1; index <= ITER##_n; index++) \
{ \
/* if tag is not in the list of free blocks */ \
is_free = FALSE; \
......@@ -189,7 +189,7 @@ copy_tags (/*@out@*/ struct SH_Validator * copy,
/* copy data */
copy_index = 0;
for (index = 1; index <= validator->tag_n; index++)
for (index = (size_t) 1; index <= validator->tag_n; index++)
{
/* if tag is not in the list of free blocks */
is_free = FALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment