Index: gbase.depend
===================================================================
--- gbase.depend	(nonexistent)
+++ gbase.depend	(revision 2581)
@@ -0,0 +1,571 @@
+# depslib dependency file v1.0
+1299610787 source:x:\utils_g\src\scol_gbase.c
+	"../include/scol_gbase.h"
+
+1299610799 x:\utils_g\include\scol_gbase.h
+	"main.h"
+	<glib/gstdio.h>
+
+1298417439 x:\utils_g\include\main.h
+	<stdio.h>
+	<stdlib.h>
+	<string.h>
+	<math.h>
+	<libgen.h>
+	<glib.h>
+	<windows.h>
+	"scol_plugin_win.h"
+	"scol_plugin_lin.h"
+	"macros.h"
+
+1250305080 c:\mingw\include\stdio.h
+	<_mingw.h>
+	<stddef.h>
+	<stdarg.h>
+	<sys/types.h>
+
+1250305074 c:\mingw\include\_mingw.h
+
+1250305082 c:\mingw\include\sys\types.h
+	<_mingw.h>
+	<stddef.h>
+
+1250305080 c:\mingw\include\stdlib.h
+	<_mingw.h>
+	<stddef.h>
+
+1250305080 c:\mingw\include\string.h
+	<_mingw.h>
+	<stddef.h>
+
+1250305078 c:\mingw\include\math.h
+	<_mingw.h>
+
+1250305078 c:\mingw\include\libgen.h
+	<_mingw.h>
+
+1293381426 c:\mingw\include\glib-2.0\glib.h
+	<glib/galloca.h>
+	<glib/garray.h>
+	<glib/gasyncqueue.h>
+	<glib/gatomic.h>
+	<glib/gbacktrace.h>
+	<glib/gbase64.h>
+	<glib/gbitlock.h>
+	<glib/gbookmarkfile.h>
+	<glib/gcache.h>
+	<glib/gchecksum.h>
+	<glib/gcompletion.h>
+	<glib/gconvert.h>
+	<glib/gdataset.h>
+	<glib/gdate.h>
+	<glib/gdatetime.h>
+	<glib/gdir.h>
+	<glib/gerror.h>
+	<glib/gfileutils.h>
+	<glib/ghash.h>
+	<glib/ghook.h>
+	<glib/ghostutils.h>
+	<glib/giochannel.h>
+	<glib/gkeyfile.h>
+	<glib/glist.h>
+	<glib/gmacros.h>
+	<glib/gmain.h>
+	<glib/gmappedfile.h>
+	<glib/gmarkup.h>
+	<glib/gmem.h>
+	<glib/gmessages.h>
+	<glib/gnode.h>
+	<glib/goption.h>
+	<glib/gpattern.h>
+	<glib/gpoll.h>
+	<glib/gprimes.h>
+	<glib/gqsort.h>
+	<glib/gquark.h>
+	<glib/gqueue.h>
+	<glib/grand.h>
+	<glib/grel.h>
+	<glib/gregex.h>
+	<glib/gscanner.h>
+	<glib/gsequence.h>
+	<glib/gshell.h>
+	<glib/gslice.h>
+	<glib/gslist.h>
+	<glib/gspawn.h>
+	<glib/gstrfuncs.h>
+	<glib/gstring.h>
+	<glib/gtestutils.h>
+	<glib/gthread.h>
+	<glib/gthreadpool.h>
+	<glib/gtimer.h>
+	<glib/gtimezone.h>
+	<glib/gtree.h>
+	<glib/gtypes.h>
+	<glib/gunicode.h>
+	<glib/gurifuncs.h>
+	<glib/gutils.h>
+	<glib/gvarianttype.h>
+	<glib/gvariant.h>
+	<glib/gwin32.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\galloca.h
+	<glib/gtypes.h>
+	<alloca.h>
+	<malloc.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gtypes.h
+	<glibconfig.h>
+	<glib/gmacros.h>
+
+1293381426 c:\mingw\lib\glib-2.0\include\glibconfig.h
+	<glib/gmacros.h>
+	<limits.h>
+	<float.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmacros.h
+	<stddef.h>
+
+1250305078 c:\mingw\include\limits.h
+	<_mingw.h>
+
+1250305076 c:\mingw\include\float.h
+	<_mingw.h>
+
+1250305078 c:\mingw\include\malloc.h
+	<_mingw.h>
+	<stdlib.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\garray.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gasyncqueue.h
+	<glib/gthread.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gthread.h
+	<glib/gerror.h>
+	<glib/gutils.h>
+	<glib/gatomic.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gerror.h
+	<stdarg.h>
+	<glib/gquark.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gquark.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gutils.h
+	<glib/gtypes.h>
+	<stdarg.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gatomic.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gbacktrace.h
+	<glib/gtypes.h>
+	<signal.h>
+
+1250305080 c:\mingw\include\signal.h
+	<_mingw.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gbase64.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gbitlock.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gbookmarkfile.h
+	<glib/gerror.h>
+	<time.h>
+
+1250305080 c:\mingw\include\time.h
+	<_mingw.h>
+	<stddef.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gcache.h
+	<glib/glist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\glist.h
+	<glib/gmem.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmem.h
+	<glib/gslice.h>
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gslice.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gchecksum.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gcompletion.h
+	<glib/glist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gconvert.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gdataset.h
+	<glib/gquark.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gdate.h
+	<time.h>
+	<glib/gtypes.h>
+	<glib/gquark.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gdatetime.h
+	<glib/gtimezone.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gtimezone.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gdir.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gfileutils.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\ghash.h
+	<glib/gtypes.h>
+	<glib/glist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\ghook.h
+	<glib/gmem.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\ghostutils.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\giochannel.h
+	<glib/gconvert.h>
+	<glib/gmain.h>
+	<glib/gstring.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmain.h
+	<glib/gpoll.h>
+	<glib/gslist.h>
+	<glib/gthread.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gpoll.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gslist.h
+	<glib/gmem.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gstring.h
+	<glib/gtypes.h>
+	<glib/gunicode.h>
+	<glib/gutils.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gunicode.h
+	<glib/gerror.h>
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gkeyfile.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmappedfile.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmarkup.h
+	<stdarg.h>
+	<glib/gerror.h>
+	<glib/gslist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gmessages.h
+	<stdarg.h>
+	<glib/gtypes.h>
+	<glib/gmacros.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gnode.h
+	<glib/gmem.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\goption.h
+	<glib/gerror.h>
+	<glib/gquark.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gpattern.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gprimes.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gqsort.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gqueue.h
+	<glib/glist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\grand.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\grel.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gregex.h
+	<glib/gerror.h>
+	<glib/gstring.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gscanner.h
+	<glib/gdataset.h>
+	<glib/ghash.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gsequence.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gshell.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gspawn.h
+	<glib/gerror.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gstrfuncs.h
+	<stdarg.h>
+	<glib/gmacros.h>
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gtestutils.h
+	<glib/gmessages.h>
+	<glib/gstring.h>
+	<glib/gerror.h>
+	<glib/gslist.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gthreadpool.h
+	<glib/gthread.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gtimer.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gtree.h
+	<glib/gnode.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gurifuncs.h
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gvarianttype.h
+	<glib/gmessages.h>
+	<glib/gtypes.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gvariant.h
+	<glib/gvarianttype.h>
+	<glib/gstring.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gwin32.h
+	<glib/gtypes.h>
+
+1228530732 c:\mingw\include\windows.h
+	<winresrc.h>
+	<stdarg.h>
+	<windef.h>
+	<wincon.h>
+	<winbase.h>
+	<wingdi.h>
+	<winuser.h>
+	<winnls.h>
+	<winver.h>
+	<winnetwk.h>
+	<winreg.h>
+	<winsvc.h>
+	<cderr.h>
+	<dde.h>
+	<ddeml.h>
+	<dlgs.h>
+	<imm.h>
+	<lzexpand.h>
+	<mmsystem.h>
+	<nb30.h>
+	<rpc.h>
+	<shellapi.h>
+	<winperf.h>
+	<commdlg.h>
+	<winspool.h>
+	<winsock2.h>
+	<winsock.h>
+	<ole2.h>
+
+1228530732 c:\mingw\include\winresrc.h
+	<winuser.h>
+	<winnt.h>
+	<winver.h>
+	<dde.h>
+	<dlgs.h>
+	<commctrl.h>
+
+1228530734 c:\mingw\include\winuser.h
+
+1228530732 c:\mingw\include\winnt.h
+	<winerror.h>
+	<string.h>
+	<basetsd.h>
+	<pshpack4.h>
+	<poppack.h>
+
+1228530732 c:\mingw\include\winerror.h
+
+1228530712 c:\mingw\include\basetsd.h
+
+1228530724 c:\mingw\include\pshpack4.h
+
+1228530724 c:\mingw\include\poppack.h
+
+1228530734 c:\mingw\include\winver.h
+
+1228530714 c:\mingw\include\dde.h
+
+1228530714 c:\mingw\include\dlgs.h
+
+1228530714 c:\mingw\include\commctrl.h
+	<prsht.h>
+
+1228530724 c:\mingw\include\prsht.h
+
+1228530732 c:\mingw\include\windef.h
+	<winnt.h>
+
+1228530732 c:\mingw\include\wincon.h
+
+1228530730 c:\mingw\include\winbase.h
+
+1228530732 c:\mingw\include\wingdi.h
+
+1228530732 c:\mingw\include\winnls.h
+
+1228530732 c:\mingw\include\winnetwk.h
+
+1228530732 c:\mingw\include\winreg.h
+
+1228530734 c:\mingw\include\winsvc.h
+
+1228530712 c:\mingw\include\cderr.h
+
+1228530714 c:\mingw\include\ddeml.h
+
+1228530716 c:\mingw\include\imm.h
+
+1228530720 c:\mingw\include\lzexpand.h
+
+1228530722 c:\mingw\include\mmsystem.h
+
+1228530722 c:\mingw\include\nb30.h
+
+1228530726 c:\mingw\include\rpc.h
+	<windows.h>
+	<rpcdce.h>
+	<rpcnsi.h>
+	<rpcnterr.h>
+	<winerror.h>
+	<excpt.h>
+
+1228530726 c:\mingw\include\rpcdce.h
+	<basetyps.h>
+	<rpcdcep.h>
+
+1228530712 c:\mingw\include\basetyps.h
+
+1228530728 c:\mingw\include\rpcdcep.h
+
+1228530728 c:\mingw\include\rpcnsi.h
+
+1228530728 c:\mingw\include\rpcnterr.h
+
+1250305076 c:\mingw\include\excpt.h
+	<_mingw.h>
+	<windef.h>
+
+1228530728 c:\mingw\include\shellapi.h
+	<pshpack2.h>
+	<poppack.h>
+
+1228530724 c:\mingw\include\pshpack2.h
+
+1228530732 c:\mingw\include\winperf.h
+
+1228530714 c:\mingw\include\commdlg.h
+	<unknwn.h>
+	<prsht.h>
+
+1228530730 c:\mingw\include\unknwn.h
+	<windows.h>
+	<objfwd.h>
+	<wtypes.h>
+
+1228530724 c:\mingw\include\objfwd.h
+	<basetyps.h>
+
+1228530734 c:\mingw\include\wtypes.h
+	<rpc.h>
+	<rpcndr.h>
+
+1228530728 c:\mingw\include\rpcndr.h
+	<rpcnsip.h>
+	<objfwd.h>
+
+1228530728 c:\mingw\include\rpcnsip.h
+
+1228530734 c:\mingw\include\winspool.h
+
+1228530734 c:\mingw\include\winsock2.h
+	<windows.h>
+
+1228530732 c:\mingw\include\winsock.h
+	<windows.h>
+	<mswsock.h>
+
+1228530722 c:\mingw\include\mswsock.h
+
+1228530724 c:\mingw\include\ole2.h
+	<winerror.h>
+	<objbase.h>
+	<olectlid.h>
+	<oleauto.h>
+	<oleidl.h>
+
+1228530724 c:\mingw\include\objbase.h
+	<rpc.h>
+	<rpcndr.h>
+	<stdlib.h>
+	<basetyps.h>
+	<wtypes.h>
+	<unknwn.h>
+	<objidl.h>
+	<cguid.h>
+
+1228530724 c:\mingw\include\objidl.h
+	<objfwd.h>
+
+1228530712 c:\mingw\include\cguid.h
+
+1228530724 c:\mingw\include\olectlid.h
+
+1228530724 c:\mingw\include\oleauto.h
+	<oaidl.h>
+
+1228530722 c:\mingw\include\oaidl.h
+	<windows.h>
+	<ole2.h>
+
+1228530724 c:\mingw\include\oleidl.h
+	<objfwd.h>
+
+1297894138 x:\utils_g\include\scol_plugin_win.h
+	<windows.h>
+	<stdio.h>
+	<stdlib.h>
+
+1296481042 x:\utils_g\include\scol_plugin_lin.h
+	<stdio.h>
+	<stdlib.h>
+
+1298486475 x:\utils_g\include\macros.h
+
+1293381427 c:\mingw\include\glib-2.0\glib\gstdio.h
+	<glib/gprintf.h>
+	<sys/stat.h>
+
+1293381427 c:\mingw\include\glib-2.0\glib\gprintf.h
+	<glib.h>
+	<stdio.h>
+	<stdarg.h>
+
+1250305082 c:\mingw\include\sys\stat.h
+	<_mingw.h>
+	<stddef.h>
+	<sys/types.h>
+
Index: include/scol_gbase.h
===================================================================
--- include/scol_gbase.h	(nonexistent)
+++ include/scol_gbase.h	(revision 2581)
@@ -0,0 +1,33 @@
+/*
+This source file is part of Scol
+For the latest info, see http://www.scolring.org
+
+Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser 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, or go to
+http://www.gnu.org/copyleft/lesser.txt
+
+For others informations, please contact us from http://www.scolring.org/
+*/
+
+#ifndef __SCOL_GBASE_H__
+#define __SCOL_GBASE_H__
+
+#include "main.h"
+#include <glib/gstdio.h>
+
+#define GBASE_PKG_NB        13
+
+
+#endif  /* __SCOL_GBASE_H__ */
Index: gbase.cbp
===================================================================
--- gbase.cbp	(nonexistent)
+++ gbase.cbp	(revision 2581)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="gbase" />
+		<Option pch_mode="2" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="bin\Debug\gbase" prefix_auto="1" extension_auto="1" />
+				<Option object_output="obj\Debug\" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option createDefFile="1" />
+				<Option createStaticLib="1" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-Wshadow" />
+					<Add option="-Winit-self" />
+					<Add option="-Wredundant-decls" />
+					<Add option="-Wcast-align" />
+					<Add option="-Wundef" />
+					<Add option="-Wfloat-equal" />
+					<Add option="-Winline" />
+					<Add option="-Wunreachable-code" />
+					<Add option="-Wmissing-declarations" />
+					<Add option="-Wswitch-enum" />
+					<Add option="-Wswitch-default" />
+					<Add option="-pedantic" />
+					<Add option="-Wextra" />
+					<Add option="-Wall" />
+					<Add option="-g" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="bin\gbase" prefix_auto="1" extension_auto="1" />
+				<Option object_output="obj\Release\" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option createDefFile="1" />
+				<Option createStaticLib="1" />
+				<Compiler>
+					<Add option="-O2" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+				</Linker>
+			</Target>
+		</Build>
+		<Compiler>
+			<Add option="-O1" />
+			<Add option="-Wshadow" />
+			<Add option="-Winit-self" />
+			<Add option="-Wredundant-decls" />
+			<Add option="-Wcast-align" />
+			<Add option="-Wundef" />
+			<Add option="-Wfloat-equal" />
+			<Add option="-Winline" />
+			<Add option="-Wunreachable-code" />
+			<Add option="-Wswitch-enum" />
+			<Add option="-Wswitch-default" />
+			<Add option="-pedantic" />
+			<Add option="-Wextra" />
+			<Add option="-Wall" />
+			<Add option="-mms-bitfields" />
+			<Add directory="$(#gtk.include)" />
+			<Add directory="$(#gtk.include)\gtk-2.0" />
+			<Add directory="$(#gtk.include)\cairo" />
+			<Add directory="$(#gtk.include)\gdk" />
+			<Add directory="$(#gtk.include)\glib-2.0" />
+			<Add directory="$(#gtk.lib)\glib-2.0\include" />
+			<Add directory="$(#gtk.include)\pango-1.0" />
+			<Add directory="$(#gtk.lib)\gtk-2.0\include" />
+			<Add directory="$(#gtk.include)\atk-1.0" />
+		</Compiler>
+		<Linker>
+			<Add library="gtk-win32-2.0" />
+			<Add library="gobject-2.0" />
+			<Add library="glib-2.0" />
+			<Add directory="$(#gtk.lib)" />
+		</Linker>
+		<Unit filename="include\macros.h" />
+		<Unit filename="include\main.h" />
+		<Unit filename="include\scol_gbase.h" />
+		<Unit filename="include\scol_plugin_lin.h" />
+		<Unit filename="include\scol_plugin_win.h" />
+		<Unit filename="src\scol_gbase.c">
+			<Option compilerVar="CC" />
+		</Unit>
+		<Extensions>
+			<code_completion />
+			<debugger />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: src/scol_gbase.c
===================================================================
--- src/scol_gbase.c	(nonexistent)
+++ src/scol_gbase.c	(revision 2581)
@@ -0,0 +1,578 @@
+/*
+This source file is part of Scol
+For the latest info, see http://www.scolring.org
+
+Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser 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, or go to
+http://www.gnu.org/copyleft/lesser.txt
+
+For others informations, please contact us from http://www.scolring.org/
+*/
+
+#include "../include/scol_gbase.h"
+
+#if ((defined _WIN32) || (defined __WIN32__))
+cbmachine ww;
+#endif
+mmachine  mm;
+
+
+/**
+ * \brief _gbaseUserName : Returns the user (or real) name
+ *
+ * fun [] S
+ *
+ * \param : nothing
+ * \return S : this name
+ */
+int SCOL_gbaseUserName (mmachine m)
+{
+    const gchar * name;
+
+    name = g_get_user_name ();
+    if (name == NULL)
+        name = g_get_real_name ();
+
+    if (name == NULL)
+    {
+        Mpushstrbloc (m, "unknown");
+        return 0;
+    }
+    Mpushstrbloc (m, (char *) name);
+    return 0;
+}
+
+/**
+ * \brief _gBaseHostName : Returns the host name
+ *
+ * fun [] S
+ *
+ * \param : nothing
+ * \return S : this name
+ */
+int SCOL_gBaseHostName (mmachine m)
+{
+    const gchar * name;
+
+    name = g_get_host_name ();
+    if (name == NULL)
+    {
+        Mpushstrbloc (m, "unknown");
+        return 0;
+    }
+    Mpushstrbloc (m, (char *) name);
+    return 0;
+}
+
+/**
+ * \brief _gBaseDirCur : Returns the current directory (by default on MS Windows "C:\Program Files\Scol Voyager")
+ *
+ * fun [] S
+ *
+ * \param : nothing
+ * \return S : this directory
+ */
+int SCOL_gBaseDirCur (mmachine m)
+{
+    const gchar * name;
+
+    name = g_get_current_dir ();
+    if (name == NULL)
+    {
+        Mpushstrbloc (m, "unknown");
+        return 0;
+    }
+    Mpushstrbloc (m, (char *) name);
+    return 0;
+}
+
+/**
+ * \brief _gBasePathAbsolute : Returns 1 if the given file_name is an absolute file name.
+ *
+ * fun [S] I
+ *
+ * \param S : any path
+ * \return I : 1 if TRUE,otherwise 0
+ */
+ int SCOL_gBasePathAbsolute (mmachine m)
+ {
+    int mpath;
+    gboolean value;
+
+    mpath = MMpull (m);
+    if (mpath == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+
+    value = g_path_is_absolute (MMstartstr (m, MTOP (mpath)));
+    MMpush (m, ITOM (value));
+    return 0;
+ }
+
+/**
+ * \brief _gBasePathBase : Returns the last component of the filename
+ *
+ * fun [S] S
+ *
+ * \param S : any path
+ * \return S : this last component
+ */
+int SCOL_gBasePathBase (mmachine m)
+{
+    int mpath;
+    gchar *base;
+
+    mpath = MMpull (m);
+    if (mpath == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    base = g_path_get_basename (MMstartstr (m, MTOP (mpath)));
+    Mpushstrbloc (m, base);
+    g_free (base);
+    return 0;
+}
+
+/**
+ * \brief _gBasePathDir : Returns the directory components of a file name.
+ *
+ * fun [S] S
+ *
+ * \param S : any path
+ * \return S : this directory
+ */
+int SCOL_gBasePathDir (mmachine m)
+{
+    int mpath;
+    gchar *dir;
+
+    mpath = MMpull (m);
+    if (mpath == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    dir = g_path_get_dirname (MMstartstr (m, MTOP (mpath)));
+    Mpushstrbloc (m, dir);
+    g_free (dir);
+    return 0;
+}
+
+/**
+ * \brief _gBasePathBuild : Creates a filename from a list of elements using the correct separator for filenames.
+ *
+ * fun [[S r1] I] S
+ *
+ * \param [S r1] : a list of elements (typically, a list of directory : a :: b :: c :: file.ext)
+ * \param I : 1 : OS separator, otherwise Scol separator (/)
+ * \return S : the filename
+ */
+int SCOL_gBasePathBuild (mmachine m)
+{
+    int mlist, mflag;
+    int size = 0, i = 0;
+    gchar **list;
+    gchar *fn;
+
+    mflag = MTOI (MMpull (m));
+    mlist = MMget (m, 0);
+    if (mlist == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    mlist = MTOP (mlist);
+
+    while (mlist != NIL)
+    {
+        size++;
+        mlist = MMfetch (m, mlist, 1)>>1;
+    }
+
+    list = g_new0 (gchar*, size + 2);
+    mlist = MTOP (MMpull (m));
+    for (; i < size; i++)
+    {
+        list[i] = MMstartstr (m, MTOP (MMfetch (m, mlist, 0)));
+        mlist = MTOP (MMfetch (m, mlist, 1));
+    }
+
+    if (mflag == 1)
+        fn = g_build_filenamev (list);
+    else
+        fn = g_build_pathv ("/", list);
+    Mpushstrbloc (m, fn);
+    g_free (list);
+    g_free (fn);
+    return 0;
+}
+
+/**
+ * \brief _gBaseStringUTF8 : Converts a string in the current locale into a UTF-8 string or reverse.
+ *
+ * fun [S I] S
+ *
+ * \param S : any string
+ * \param I : 1 to UTF8, 0 to current locale
+ * \return : the new string
+ */
+int SCOL_gBaseStringUTF8 (mmachine m)
+{
+    int mstring, mflag;
+    gchar *string;
+
+    mflag = MMpull (m);
+    mstring = MMpull (m);
+
+    if (mstring == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    if (mflag)
+        string = SCOLUTF8 (MMstartstr (m, MTOP (mstring)), -1);
+    else
+        string = UTF8SCOL (MMstartstr (m, MTOP (mstring)), -1);
+    Mpushstrbloc (m, string);
+    g_free (string);
+    return 0;
+}
+
+/**
+ * \brief _gbaseChecksumS : Computes the checksum of a string.
+ *
+ * fun [S I] S
+ *
+ * \param S : any string
+ * \param I : the hashing algorithm to use : 0 -> MD5 (default), 1 -> SHA-1, 2 -> SHA-256
+ * \return S : the checksum as an hexadecimal string.
+ */
+int SCOL_gbaseChecksumS (mmachine m)
+{
+    int mstring, mtype;
+    GChecksumType type = G_CHECKSUM_MD5;
+    gchar *string;
+
+    mtype = MTOI (MMpull (m));
+    mstring = MMpull (m);
+
+    if (mstring == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    mstring = MTOP (mstring);
+
+    if (mtype == 1)
+        type = G_CHECKSUM_SHA1;
+    else if (mtype == 2)
+        type = G_CHECKSUM_SHA256;
+
+    string = g_compute_checksum_for_string (type, MMstartstr (m, mstring), -1);
+    Mpushstrbloc (m, string);
+    g_free (string);
+    return 0;
+}
+
+/**
+ * \brief _gbaseChecksumP : Computes the checksum of a file.
+ *
+ * fun [P I] S
+ *
+ * \param S : any file (read referenced only)
+ * \param I : the hashing algorithm to use : 0 -> MD5 (default), 1 -> SHA-1, 2 -> SHA-256
+ * \return S : the checksum as an hexadecimal string.
+ */
+int SCOL_gbaseChecksumP (mmachine m)
+{
+    /* #define SCSP_MAX_SIZE G_MAXUINT-1 */ /* i'm stupid ! */
+    #define SCSP_MAX_SIZE 1024*32   /* 32 ko / each loop */
+    int mfile, mtype;
+    guchar data[SCSP_MAX_SIZE];
+    gsize size = 0;
+    GChecksumType type = G_CHECKSUM_MD5;
+    GChecksum *cs;
+    const gchar *string;
+    FILE *file;
+
+    mtype = MTOI (MMpull (m));
+    mfile = MMpull (m);
+
+    if (mfile == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    mfile = MTOP (mfile);
+
+    file = fopen (MMstartstr (m, mfile), "rb");
+    if (file == NULL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+
+    if (mtype == 1)
+        type = G_CHECKSUM_SHA1;
+    else if (mtype == 2)
+        type = G_CHECKSUM_SHA256;
+
+    cs = g_checksum_new (type);
+    do
+    {
+        size = fread((void *) data, sizeof (guchar), SCSP_MAX_SIZE, file);
+        g_checksum_update (cs, data, size);
+    }
+    while (size == SCSP_MAX_SIZE);
+    fclose (file);
+
+    string = g_checksum_get_string (cs);
+    Mpushstrbloc (m, (char *) string);
+    g_checksum_free (cs);
+    return 0;
+}
+
+/**
+ * \brief _gbaseSleep : Pauses the current thread for the given number of milliseconds.
+ *
+ * fun [I] I
+ *
+ * \param I : the number of milliseconds
+ * \return I : 0 if success, nil if error
+ */
+int SCOL_gbaseSleep (mmachine m)
+{
+    int msleep;
+
+    msleep = MTOI (MMpull (m));
+    if (msleep <= 0)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+
+    g_usleep (1000*msleep);
+    MMpush (m, ITOM (0));
+    return 0;
+}
+
+/**
+ * \brief _gbaseFileStat : it should not be used, at this time
+ *
+ * fun [P] [I I I I]
+ *
+ * \param P : a filename (read reference only)
+ * \return [I I I I] : size, last access, last modification, last state changed
+ */
+int SCOL_gbaseFileStat (mmachine m)
+{
+    int mfile;
+    int result;
+    GStatBuf *s = NULL;
+
+    mfile = MMpull(m);
+    if (mfile == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    mfile = MTOP (mfile);
+
+    result = g_stat (MMstartstr (m, mfile), s);
+    if (result != 0)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    MMpush (m, ITOM (s->st_size));
+    MMpush (m, ITOM (s->st_atime));
+    MMpush (m, ITOM (s->st_mtime));
+    MMpush (m, ITOM (s->st_ctime));
+    MMpush (m, ITOM (4));
+    MBdeftab (m);
+
+    return 0;
+}
+
+/**
+ * \brief _gbaseIsIp : Tests if a string is a form of an IPv4 or IPv6 address (like "123.210.012.231").
+ * fun [S] I
+ * \param S : any string
+ * \return I : 1 if TRUE, 0 if FALSE
+ */
+int SCOL_gbaseIsIp (mmachine m)
+{
+    int ms;
+
+    ms = MMpull (m);
+    if (ms == NIL)
+    {
+        MMpush (m, NIL);
+        return 0;
+    }
+    MMpush (m, ITOM (g_hostname_is_ip_address (MMstartstr (m, MTOP (ms)))));
+    return 0;
+}
+
+
+
+
+
+
+/* API définitions : */
+
+char* gbase_name[GBASE_PKG_NB]=
+{
+    "_gbaseUserName",
+    "_gBaseHostName",
+    "_gBaseDirCur",
+    "_gBasePathAbsolute",
+    "_gBasePathBase",
+    "_gBasePathDir",
+    "_gBasePathBuild",
+    "_gBaseStringUTF8",
+    "_gbaseChecksumS",
+    "_gbaseChecksumP",
+    "_gbaseSleep",
+    "_gbaseFileStat",
+    "_gbaseIsIp"
+};
+
+int (*gbase_fun[GBASE_PKG_NB])(mmachine m)=
+{
+    SCOL_gbaseUserName,
+    SCOL_gBaseHostName,
+    SCOL_gBaseDirCur,
+    SCOL_gBasePathAbsolute,
+    SCOL_gBasePathBase,
+    SCOL_gBasePathDir,
+    SCOL_gBasePathBuild,
+    SCOL_gBaseStringUTF8,
+    SCOL_gbaseChecksumS,
+    SCOL_gbaseChecksumP,
+    SCOL_gbaseSleep,
+    SCOL_gbaseFileStat,
+    SCOL_gbaseIsIp
+};
+
+int gbase_narg[GBASE_PKG_NB]=
+{
+    0,      /* SCOL_gbaseUserName */
+    0,      /* SCOL_gBaseHostName */
+    0,      /* SCOL_gBaseDirCur */
+    1,      /* SCOL_gBasePathAbsolute */
+    1,      /* SCOL_gBasePathBase */
+    1,      /* SCOL_gBasePathDir */
+    2,      /* SCOL_gBasePathBuild */
+    2,       /* SCOL_gBaseStringUTF8 */
+    2,       /* SCOL_gbaseChecksumS */
+    2,       /* SCOL_gbaseChecksumP */
+    1,       /* SCOL_gbaseSleep */
+    1,       /* SCOL_gbaseFileStat */
+    1       /* SCOL_gbaseIsIp */
+};
+
+char* gbase_type[GBASE_PKG_NB]=
+{
+    "fun [] S",                     /* SCOL_gbaseUserName */
+    "fun [] S",                     /* SCOL_gBaseHostName */
+    "fun [] S",                     /* SCOL_gBaseDirCur */
+    "fun [S] I",                    /* SCOL_gBasePathAbsolute */
+    "fun [S] S",                    /* SCOL_gBasePathBase */
+    "fun [S] S",                    /* SCOL_gBasePathDir */
+    "fun [[S r1] I] S",             /* SCOL_gBasePathBuild */
+    "fun [S I] S",                  /* SCOL_gBaseStringUTF8 */
+    "fun [S I] S",                  /* SCOL_gbaseChecksumS */
+    "fun [P I] S",                  /* SCOL_gbaseChecksumS */
+    "fun [I] I",                    /* SCOL_gbaseSleep */
+    "fun [P] [I I I I]",            /* SCOL_gbaseFileStat */
+    "fun [S] I"                    /* SCOL_gbaseIsIp */
+};
+
+int SCOLinitGbaseClass (mmachine m)
+{
+    int k;
+
+    MMechostr (0, "SCOLinitGbaseClass : entering\n");
+
+    k = PKhardpak (m, "GBaseEngine", GBASE_PKG_NB, gbase_name, gbase_fun, gbase_narg, gbase_type);
+    return k;
+}
+
+
+/**
+ * \brief Load and free the regular expression library
+ * Plateforms supported : MS Windows and GNU / Linux
+ */
+
+int GBaseRelease ()
+{
+    MMechostr (0, "\nGBASE library released !\n");
+    return 0;
+}
+
+#if ((defined _WIN32) || (defined __WIN32__))
+
+__declspec (dllexport) int SCOLloadGBASE (mmachine m, cbmachine w)
+{
+    int k = 0;
+    ww = w;
+    mm = m;
+
+    MMechostr (MSKDEBUG, "\nGBASE library loading .... !\n");
+    SCOLinitplugin (w);
+    if ((k = SCOLinitGbaseClass (m))) return k;
+    MMechostr(MSKDEBUG, "\nGBASE library loaded !\n");
+    return k;
+}
+
+__declspec (dllexport) int SCOLfreeGBASE ()
+{
+    GBaseRelease ();
+    return 0;
+}
+
+
+
+
+
+/* Version GNU / Linux */
+#elif ((defined linux) || (defined __linux))
+
+int SCOLloadGBASE (mmachine m)
+{
+    int k = 0;
+    mm = m;
+
+    MMechostr (MSKDEBUG, "\nGBASE library loading !\n");
+    if ((k = SCOLinitGbaseClass (m))) return k;
+    MMechostr (MSKDEBUG, "\nGBASE library loaded !\n");
+
+    return k;
+}
+
+int SCOLfreeGBASE ()
+{
+    GBaseRelease ();
+    return 0;
+}
+
+#else
+#error no platform supported
+#endif
+
Index: bin/libgbase.dll.def
===================================================================
--- bin/libgbase.dll.def	(nonexistent)
+++ bin/libgbase.dll.def	(revision 2581)
@@ -0,0 +1,3 @@
+EXPORTS
+    SCOLfreeGBASE @1
+    SCOLloadGBASE @2
Index: bin/gbase.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: bin/gbase.dll
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: gbase.layout
===================================================================
--- gbase.layout	(nonexistent)
+++ gbase.layout	(revision 2581)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_layout_file>
+	<ActiveTarget name="Release" />
+	<File name="include\macros.h" open="1" top="0" tabpos="4">
+		<Cursor position="2418" topLine="52" />
+	</File>
+	<File name="include\main.h" open="0" top="0" tabpos="0">
+		<Cursor position="0" topLine="11" />
+	</File>
+	<File name="include\scol_gbase.h" open="1" top="1" tabpos="2">
+		<Cursor position="1106" topLine="2" />
+	</File>
+	<File name="src\scol_gbase.c" open="1" top="0" tabpos="1">
+		<Cursor position="10030" topLine="422" />
+	</File>
+</CodeBlocks_layout_file>
