From: Michael Rasmussen Date: Wed, 21 Feb 2024 23:28:44 +0000 (+0100) Subject: initial upload X-Git-Url: http://git.datanom.net/schooladm.git/commitdiff_plain/refs/heads/master?ds=inline initial upload --- f5429b2e8b834e9220a288893621ab8b04a4f342 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4593820 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +COPYING +INSTALL +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +auxdir/ +config.h +config.h.in +config.log +config.status +configure +libtool +m4/ +project.geany +src/.deps/ +src/Makefile +src/Makefile.in +src/main.o +src/repository.o +src/schooladm +stamp-h1 + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..61297d7 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,14 @@ +AUTOMAKE_OPTIONS = gnu + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = \ + src + +EXTRA_DIST = \ + AUTHORS \ + ChangeLog \ + NEWS \ + README \ + TODO \ + autogen.sh diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..7d56e3b --- /dev/null +++ b/autogen.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +echo "Rebuilding build system......" + +autoreconf --version 2>&1 > /dev/null 2>&1 + +if [ ! -e m4 ]; then + mkdir m4 +fi + +if [ $? -eq 0 ]; then + AUTORECONF=autoreconf +else + AUTORECONF= +fi + +error() { + echo "Missing tool: $1" + echo "Cannot proceed until the missing tool is available" + exit 1 +} + +if [ ! -z ${AUTORECONF} ]; then + echo "Using autoreconf to rebuild build system" + autoreconf --force --install --symlink +else + echo "No autoreconf found. Using plain old tools to rebuild build system" + libtoolize --automake --force || error libtoolize + aclocal -I m4 || error aclocal + autoheader --force || error autoheader + automake --add-missing --force-missing --gnu || error automake + autoconf --force || error autoconf +fi +./configure --enable-maintainer-mode $* + +exit 0 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..e74530d --- /dev/null +++ b/configure.ac @@ -0,0 +1,84 @@ +AC_PREREQ([2.71]) +AC_INIT([studentadm],[0.1],[mir@datanom.net]) +AC_COPYRIGHT([Copyright (c) 2024 Michael Rasmussen.]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR(auxdir) +AC_CANONICAL_TARGET + +AC_CONFIG_SRCDIR([src/main.c]) +AM_INIT_AUTOMAKE([gnu no-dist-gzip dist-bzip2 1.10]) +AC_CONFIG_HEADERS([config.h]) +AM_MAINTAINER_MODE + +CFLAGS="-g -Wall" + +if test "x$USE_MAINTAINER_MODE" = "xyes"; then + CFLAGS="${CFLAGS} -Werror -DDEBUG" + AC_DEFINE_UNQUOTED(DEBUG, [1], [Enable debug mode.]) +else + CFLAGS="${CFLAGS} -O -O2" +fi +GLIB_REQUIRED=2.70.0 +GOBJECT_REQUIRED=2.70.0 +#GTK_REQUIRED=3.14.0 + +AC_SUBST(GLIB_REQUIRED) +AC_SUBST(GOBJECT_REQUIRED) +#AC_SUBST(GTK_REQUIRED) + +# Checks for programs. +AC_PROG_CC +#AC_PROG_CPP +LT_INIT +if test -n "$lt_prog_compiler_pic"; then + CFLAGS="$CFLAGS $lt_prog_compiler_pic" +fi + +PKG_PROG_PKG_CONFIG +AC_LIB_PREFIX + +# Checks for libraries. +PKG_CHECK_MODULES([GLIB], + [glib-2.0 >= $GLIB_REQUIRED + gobject-2.0 >= $GOBJECT_REQUIRED + gmodule-2.0 >= $GOBJECT_REQUIRED] +) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +#PKG_CHECK_MODULES([GTK], gtk+-3.0 >= $GTK_REQUIRED) +#AC_SUBST(GTK_CFLAGS) +#AC_SUBST(GTK_LIBS) + +#PKG_CHECK_MODULES([JSON], json-glib-1.0 >= 1.6) +#AC_SUBST(JSON_CFLAGS) +#AC_SUBST(JSON_LIBS) + +#ac_enable_tui="no" +#AC_ARG_ENABLE([tui], +# [AS_HELP_STRING([--enable-tui],[Build TUI [default=no]])], +# [ac_enable_tui="${enableval}"]) + +#AC_MSG_CHECKING([whether to build TUI]) +#if test x"$ac_enable_tui" = xyes; then +# AC_MSG_RESULT(yes) +# AC_DEFINE_UNQUOTED(BUILD_TUI, [1], [Build TUI instead of GUI]) +#else +# AC_MSG_RESULT(no) +# AC_DEFINE_UNQUOTED(BUILD_TUI, [0], [Build TUI instead of GUI]) +#fi +#AM_CONDITIONAL(BUILD_TUI, test x"$ac_enable_tui" = "xyes") + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) + +AC_OUTPUT +echo " +Configuration: + + Source code: ${ac_pwd} + Compiler: ${CC} $($CC -dumpversion) + CFLAGS: ${CFLAGS} +" diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..c3696ee --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,16 @@ +AUTOMAKE_OPTIONS = gnu + +AM_CPPFLAGS = \ + -I${top_srcdir} \ + -I${top_builddir} \ + @GLIB_CFLAGS@ + +bin_PROGRAMS = schooladm + +schooladm_SOURCES = \ + main.c \ + repository.c \ + repository.h + +schooladm_LDADD = \ + @GLIB_LIBS@ diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..835eea9 --- /dev/null +++ b/src/main.c @@ -0,0 +1,30 @@ +/* + * main.c + * + * Copyright 2024 Michael Rasmussen + * + * 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 + +int main(int argc, char **argv) +{ + + return 0; +} + diff --git a/src/repository.c b/src/repository.c new file mode 100644 index 0000000..2709738 --- /dev/null +++ b/src/repository.c @@ -0,0 +1,25 @@ +/* + * repository.c + * + * Copyright 2024 Michael Rasmussen + * + * 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 + + diff --git a/src/repository.h b/src/repository.h new file mode 100644 index 0000000..2239b55 --- /dev/null +++ b/src/repository.h @@ -0,0 +1,32 @@ +/* + * repository.h + * + * Copyright 2024 Michael Rasmussen + * + * 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 "repository.c" + +typedef struct { + SchoolClass *classes; +} School; + +typedef struct { + char +} SchoolClass; +