From 25e5fcd7a88ee2da882e68c1290972706ee38d30 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 21 Jun 2010 18:27:03 +0200 Subject: [PATCH] Initial import. --- .gitignore | 48 +++++++++++++++ AUTHORS | 1 + Makefile.am | 31 ++++++++++ NEWS | 0 README | 0 autogen.sh | 23 +++++++ config.h.in | 65 ++++++++++++++++++++ configure.ac | 56 +++++++++++++++++ docs/Makefile.am | 1 + docs/reference/Makefile.am | 102 +++++++++++++++++++++++++++++++ docs/reference/version.xml.in | 1 + libautoz.pc.in | 11 ++++ src/Makefile.am | 13 ++++ src/autoz.c | 111 ++++++++++++++++++++++++++++++++++ src/autoz.h | 59 ++++++++++++++++++ tests/Makefile.am | 12 ++++ tests/test.c | 25 ++++++++ 17 files changed, 559 insertions(+) create mode 100644 .gitignore create mode 100644 AUTHORS create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100644 config.h.in create mode 100644 configure.ac create mode 100644 docs/Makefile.am create mode 100644 docs/reference/Makefile.am create mode 100644 docs/reference/version.xml.in create mode 100644 libautoz.pc.in create mode 100644 src/Makefile.am create mode 100644 src/autoz.c create mode 100644 src/autoz.h create mode 100644 tests/Makefile.am create mode 100644 tests/test.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9812ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +*~ +*.rpath +*.pot +*.mo +*.gmo +*.o +*.lo +*.la +*.bak +*.stamp +*.tar.gz +*.pc +*.sed +*.sin +*.header +.libs +.deps +ABOUT-NLS +INSTALL +Makefile +Makefile.in +Makefile.in.in +Makevars +aclocal.m4 +autom4te.cache/ +config.guess +config.log +config.sub +configure +depcomp +gtk-doc.make +install-sh +ltmain.sh +m4/ +missing +config.h +config.status +docs/reference/version.xml +docs/reference/html/ +docs/reference/xml/ +libtool +stamp-h1 +tests/test +POTFILES +mkinstalldirs +stamp-it +intltool-* +Rules-quot diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ad1de0f --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Andrea Zagli diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..e398d34 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,31 @@ +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + +SUBDIRS = src tests docs + +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = libautoz.pc.in + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libautoz.pc + +distclean-local: + if test "$(srcdir)" = "."; then :; else \ + rm -f ChangeLog; \ + fi + +ChangeLog: + @echo Creating $@ + @if test -d "$(srcdir)/.git"; then \ + (GIT_DIR=$(top_srcdir)/.git ./missing --run git log --stat -M -C --name-status --date=short --no-color) | fmt --split-only > $@.tmp \ + && mv -f $@.tmp $@ \ + || ($(RM) $@.tmp; \ + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ + (test -f $@ || echo git-log is required to generate this file >> $@)); \ + else \ + test -f $@ || \ + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ + echo A git checkout and git-log is required to generate this file >> $@); \ + fi + +.PHONY: ChangeLog 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/autogen.sh b/autogen.sh new file mode 100755 index 0000000..8904930 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="libautoz" + +(test -f $srcdir/configure.ac \ + && test -d $srcdir/src \ + && test -f $srcdir/src/autoz.h) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level libautoz directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from GNOME and make" + echo "sure the gnome-autogen.sh script is in your \$PATH." + exit 1 +} + +USE_GNOME2_MACROS=1 . gnome-autogen.sh diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..8ee95d7 --- /dev/null +++ b/config.h.in @@ -0,0 +1,65 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..b9daa10 --- /dev/null +++ b/configure.ac @@ -0,0 +1,56 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.65) +AC_INIT([libautoz], [0.0.1], [azagli@libero.it]) +AC_CONFIG_SRCDIR([src/autoz.c]) +AC_CONFIG_HEADER([config.h]) + +AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CANONICAL_SYSTEM + +LT_INIT + +AC_LIBTOOL_WIN32_DLL + +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL +AC_PROG_RANLIB + +GTK_DOC_CHECK + +# Checks for libraries. +PKG_CHECK_MODULES(AUTOZ, [gobject-2.0 >= 2.24.0 + glib-2.0 >= 2.24.0]) + +AC_SUBST(AUTOZ_CFLAGS) +AC_SUBST(AUTOZ_LIBS) + +# Checks for header files. +AC_HEADER_STDC + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +# Checks for library functions. + +# Checks for library functions. +AC_CONFIG_FILES([ + libautoz.pc + Makefile + src/Makefile + tests/Makefile + docs/Makefile + docs/reference/Makefile + docs/reference/version.xml +]) +AC_OUTPUT diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..f3ddc22 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = reference diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am new file mode 100644 index 0000000..9032a45 --- /dev/null +++ b/docs/reference/Makefile.am @@ -0,0 +1,102 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=autoz + +# Uncomment for versioned docs and specify the version of the module, e.g. '2'. +#DOC_MODULE_VERSION=2 + + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# Directories containing the source code, relative to $(srcdir). +# gtk-doc will search all .c and .h files beneath these paths +# for inline comments documenting functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk +DOC_SOURCE_DIR=../../src + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +# e.g. MKTMPL_OPTIONS=--only-section-tmpl +MKTMPL_OPTIONS= + +# Extra options to supply to gtkdoc-mkhtml +MKHTML_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(top_srcdir)/src/*.h +CFILE_GLOB=$(top_srcdir)/src/*.c + +# Extra header to include when scanning, which are not under DOC_SOURCE_DIR +# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h +EXTRA_HFILES= + +# Header files to ignore when scanning. Use base file name, no paths +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES= + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files = version.xml.in + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +GTKDOC_CFLAGS=-I$(top_srcdir)/src $(AUTOZ_CFLAGS) +GTKDOC_LIBS=$(top_builddir)/src/libautoz.la $(AUTOZ_LIBS) + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in + +# Files not to distribute +# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types +# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt +#DISTCLEANFILES += + +# Comment this out if you want your docs-status tested during 'make check' +if ENABLE_GTK_DOC +#TESTS_ENVIRONMENT = cd $(srcsrc) && +#TESTS = $(GTKDOC_CHECK) +endif + +-include $(top_srcdir)/git.mk diff --git a/docs/reference/version.xml.in b/docs/reference/version.xml.in new file mode 100644 index 0000000..a24f987 --- /dev/null +++ b/docs/reference/version.xml.in @@ -0,0 +1 @@ +@PACKAGE_VERSION@ diff --git a/libautoz.pc.in b/libautoz.pc.in new file mode 100644 index 0000000..da9a23f --- /dev/null +++ b/libautoz.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: Class to manage authorizations. +Version: @PACKAGE_VERSION@ +Requires: glib-2.0 +Libs: -L${libdir} -lautoz +Cflags: -I${includedir} diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..5bc3211 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,13 @@ +LIBS = $(AUTOZ_LIBS) + +AM_CPPFLAGS = $(AUTOZ_CFLAGS) + +lib_LTLIBRARIES = libautoz.la + +libautoz_la_SOURCES = autoz.c + +libautoz_la_LDFLAGS = -no-undefined + +libautoz_include_HEADERS = autoz.h + +libautoz_includedir = $(includedir)/libautoz diff --git a/src/autoz.c b/src/autoz.c new file mode 100644 index 0000000..4e301a0 --- /dev/null +++ b/src/autoz.c @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2010 Andrea Zagli + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "autoz.h" + +static void autoz_class_init (AutozClass *class); +static void autoz_init (Autoz *form); + +static void autoz_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void autoz_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + +#define AUTOZ_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_AUTOZ, AutozPrivate)) + +typedef struct _AutozPrivate AutozPrivate; +struct _AutozPrivate + { + gpointer foo; + }; + +G_DEFINE_TYPE (Autoz, autoz, G_TYPE_OBJECT) + +static void +autoz_class_init (AutozClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->set_property = autoz_set_property; + object_class->get_property = autoz_get_property; + + g_type_class_add_private (object_class, sizeof (AutozPrivate)); +} + +static void +autoz_init (Autoz *form) +{ + AutozPrivate *priv = AUTOZ_GET_PRIVATE (form); +} + +/** + * autoz_new: + * + * Returns: the newly created #Autoz object. + */ +Autoz +*autoz_new () +{ + + return AUTOZ (g_object_new (autoz_get_type (), NULL)); +} + +/* PRIVATE */ +static void +autoz_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + Autoz *form = (Autoz *)object; + + AutozPrivate *priv = AUTOZ_GET_PRIVATE (form); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +autoz_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + Autoz *form = (Autoz *)object; + + AutozPrivate *priv = AUTOZ_GET_PRIVATE (form); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} diff --git a/src/autoz.h b/src/autoz.h new file mode 100644 index 0000000..ede2970 --- /dev/null +++ b/src/autoz.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Andrea Zagli + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __LIBAUTOZ_H__ +#define __LIBAUTOZ_H__ + +#include +#include + + +G_BEGIN_DECLS + + +#define TYPE_AUTOZ (autoz_get_type ()) +#define AUTOZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTOZ, Autoz)) +#define AUTOZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTOZ, AutozClass)) +#define IS_AUTOZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTOZ)) +#define IS_AUTOZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTOZ)) +#define AUTOZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTOZ, AutozClass)) + + +typedef struct _Autoz Autoz; +typedef struct _AutozClass AutozClass; + +struct _Autoz + { + GObject parent; + }; + +struct _AutozClass + { + GObjectClass parent_class; + }; + +GType autoz_get_type (void) G_GNUC_CONST; + + +Autoz *autoz_new (void); + + +G_END_DECLS + + +#endif /* __LIBAUTOZ_H__ */ diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..7345b40 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,12 @@ +LIBS = $(AUTOZ_LIBS) \ + -export-dynamic + +AM_CPPFLAGS = $(AUTOZ_CFLAGS) \ + -I$(top_srcdir)/src \ + -DGUIDIR="\"@abs_builddir@\"" + +noinst_PROGRAMS = test + +LDADD = $(top_builddir)/src/libautoz.la + +EXTRA_DIST = diff --git a/tests/test.c b/tests/test.c new file mode 100644 index 0000000..1cdf29c --- /dev/null +++ b/tests/test.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2010 Andrea Zagli + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "autoz.h" + +int +main (int argc, char **argv) +{ + return 0; +} -- 2.49.0