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

added data

data handels all intern data and serves as a cache between the CMS and
the (R)DBMS.
parent 1ec675ad
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADER([limits.h])
AC_CHECK_HEADER([stdio.h])
AC_CHECK_HEADER([stdlib.h])
......
......@@ -7,4 +7,6 @@ bin_PROGRAMS = sefht.fcgi
sefht_fcgi_SOURCES =
sefht_fcgi_SOURCES += main.c
sefht_fcgi_SOURCES += macro.h
sefht_fcgi_SOURCES += sefht.h
sefht_fcgi_SOURCES += cms.c cms.h
sefht_fcgi_SOURCES += data.c data.h
......@@ -26,8 +26,11 @@
#include "macro.h"
#include "data.h"
#include "cms.h"
struct SH_Cms *
SH_Cms_new ()
{
......@@ -38,12 +41,16 @@ SH_Cms_new ()
EXIT;
}
cms->data = SH_Data_new ();
return cms;
}
void
SH_Cms_free (struct SH_Cms * cms)
{
SH_Data_free (cms->data);
free (cms);
return;
}
......
......@@ -24,9 +24,13 @@
#ifndef _CMS_H
#define _CMS_H
#include "data.h"
struct SH_Cms
{
//
struct SH_Data * data;
};
struct SH_Cms * SH_Cms_new ();
......
/*
* 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.
*
*
*/
#include <stdlib.h>
#include "macro.h"
#include "data.h"
struct SH_Data *
SH_Data_new ()
{
struct SH_Data * data;
data = malloc (sizeof (struct SH_Data));
if (data == NULL) {
EXIT;
}
return data;
}
void
SH_Data_free (struct SH_Data * data)
{
free (data);
return;
}
/*
* data.h
*
* 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 _DATA_H
#define _DATA_H
#include "sefht.h"
struct SH_Data
{
//
};
struct SH_Data * SH_Data_new ();
void SH_Data_free (struct SH_Data * data);
#endif /* _DATA_H */
/*
* sefht.h
*
* 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 _SEFHT_H
#define _SEFHT_H
#include <limits.h>
typedef unsigned int page_t;
#define PAGE_MIN 0
#define PAGE_MAX UINT_MAX
#endif /* _SEFHT_H */
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