Posted
over 9 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-10 06:05:27 -0400 (Thu, 10 Sep 2015)
New Revision: 9818
Modified:
trunk/gui/AG_FileDlg.3
trunk/gui/console.c
trunk/gui/file_dlg.c
trunk/gui/file_dlg.h
trunk/tests/loader.c
Log:
simplify error handling in
... [More]
AG_FileDlg(3) load. AG_FileDlgAddType() now
accepts an AG_IntFn routine returning an error condition.
Modified: trunk/gui/AG_FileDlg.3
===================================================================
--- trunk/gui/AG_FileDlg.32015-09-10 07:37:03 UTC (rev 9817)
trunk/gui/AG_FileDlg.32015-09-10 10:05:27 UTC (rev 9818)
< at >< at > -84,7 84,7 < at >< at >
.Fn AG_FileDlgSetFilenameS "AG_FileDlg *file_dlg" "const char *filename"
.Pp
.Ft "AG_FileType *"
-.Fn AG_FileDlgAddType "AG_FileDlg *file_dlg" "const char *descr" "const char *exts" "void (*fn)(AG_Event *)" "const char *fnArgs" "..."
.Fn AG_FileDlgAddType "AG_FileDlg *file_dlg" "const char *descr" "const char *exts" "int (*fn)(AG_Event *)" "const char *fnArgs" "..."
.Pp
.Ft "void"
.Fn AG_FileDlgRefresh "AG_FileDlg *file_dlg"
Modified: trunk/gui/console.c
===================================================================
--- trunk/gui/console.c2015-09-10 07:37:03 UTC (rev 9817)
trunk/gui/console.c2015-09-10 10:05:27 UTC (rev 9818)
< at >< at > -1,5 1,5 < at >< at >
/*
- * Copyright (c) 2005-2012 Hypertriton, Inc. <http://hypertriton.com/>
* Copyright (c) 2005-2015 Hypertriton, Inc. <http://hypertriton.com/>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
< at >< at > -35,6 35,7 < at >< at >
#include <stdarg.h>
#include <string.h>
#include <errno.h>
AG_Console *
AG_ConsoleNew(void *parent, Uint flags)
< at >< at > -186,6 187,7 < at >< at >
}
return (s);
}
static void
MenuCopy(AG_Event *event)
{
< at >< at > -203,7 205,14 < at >< at >
}
free(s);
}
-static void
static int
MenuCopyActive(AG_Event *event)
{
AG_Console *cons = AG_PTR(1);
return (cons->pos != -1) ? 1 : 0;
}
static int
MenuExportToFileTXT(AG_Event *event)
{
AG_Console *cons = AG_PTR(1);
< at >< at > -212,21 221,17 < at >< at >
FILE *f;
if ((s = AG_ConsoleExportText(cons, 1)) == NULL) {
-return;
return (-1);
}
if ((f = fopen(path, "wb")) == NULL) {
-AG_TextMsg(AG_MSG_ERROR, _("Unable to open %s"), path);
-goto out;
AG_SetError("%s: %s", path, AG_Strerror(errno));
free(s);
return (-1);
}
-if (fwrite(s, strlen(s), 1, f) != 1) {
-AG_TextMsg(AG_MSG_ERROR, _("Write error"));
-} else {
-AG_TextTmsg(AG_MSG_INFO, 1000, _("Successfully saved to %s"),
- path);
-}
fwrite(s, strlen(s), 1, f);
fclose(f);
-out:
free(s);
return (0);
}
static void
MenuExportToFileDlg(AG_Event *event)
< at >< at > -249,6 254,7 < at >< at >
AG_FileDlgAddType(fd, _("Text file"), "*.txt",
MenuExportToFileTXT, "%p", cons);
AG_WindowShow(win);
}
< at >< at > -259,29 265,9 < at >< at >
cons->pos = 0;
cons->sel = cons->nLines-1;
AG_Redraw(cons);
}
-static AG_PopupMenu *
-PopupMenu(AG_Console *cons)
-{
-AG_PopupMenu *pm;
-AG_MenuItem *m;
-
-if ((pm = AG_PopupNew(cons)) == NULL) {
-return (NULL);
-}
-m = AG_MenuAction(pm->item, _("Copy"), NULL,
- MenuCopy, "%p", cons);
-m->state = (cons->pos != -1);
-m = AG_MenuAction(pm->item, _("Export to file..."), NULL,
- MenuExportToFileDlg, "%p", cons);
-m->state = (cons->pos != -1);
-AG_MenuSeparator(pm->item);
-AG_MenuAction(pm->item, _("Select All"), NULL,
- MenuSelectAll, "%p", cons);
-return (pm);
-}
-
static void
BeginSelect(AG_Event *event)
{
< at >< at > -296,8 282,7 < at >< at >
AG_WidgetFocus(cons);
}
if (cons->pm != NULL) {
-AG_PopupDestroy(cons, cons->pm);
-cons->pm = NULL;
AG_PopupHide(cons->pm);
}
if (cons->nLines > 0) {
MapLine(cons, y, &cons->pos);
< at >< at > -311,24 296,40 < at >< at >
CloseSelect(AG_Event *event)
{
AG_Console *cons = AG_SELF();
-
cons->flags &= ~(AG_CONSOLE_SELECTING);
}
static void
-ShowPopup(AG_Event *event)
PopupMenu(AG_Event *event)
{
AG_Console *cons = AG_SELF();
int x = AG_INT(2);
int y = AG_INT(3);
AG_PopupMenu *pm;
AG_MenuItem *mi;
-if ((cons->flags & AG_CONSOLE_NOPOPUP) == 0) {
-if (cons->pm != NULL) {
-AG_PopupDestroy(cons, cons->pm);
-}
-if ((cons->pm = PopupMenu(cons)) != NULL)
-AG_PopupShowAt(cons->pm, x, y);
if (cons->flags & AG_CONSOLE_NOPOPUP)
return;
if (cons->pm != NULL) {
AG_PopupShowAt(cons->pm, x, y);
return;
}
if ((pm = cons->pm = AG_PopupNew(cons)) == NULL) {
return;
}
mi = AG_MenuAction(pm->item, _("Copy"), NULL, MenuCopy, "%p", cons);
mi->stateFn = AG_SetIntFn(pm->menu, MenuCopyActive, "%p", cons);
AG_MenuAction(pm->item, _("Export to file..."), NULL,
MenuExportToFileDlg, "%p", cons);
AG_MenuSeparator(pm->item);
AG_MenuAction(pm->item, _("Select All"), NULL,
MenuSelectAll, "%p", cons);
AG_PopupShowAt(pm, x, y);
}
static void
< at >< at > -419,7 420,7 < at >< at >
AG_ActionFn(cons, "BeginSelect", BeginSelect, NULL);
AG_ActionFn(cons, "CloseSelect", CloseSelect, NULL);
-AG_ActionFn(cons, "ShowPopup",ShowPopup, NULL);
AG_ActionFn(cons, "PopupMenu",PopupMenu, NULL);
AG_ActionFn(cons, "ScrollUp",ScrollUp, NULL);
AG_ActionFn(cons, "ScrollDown",ScrollDown, NULL);
AG_ActionFn(cons, "PageUp",PageUp, NULL);
< at >< at > -427,7 428,7 < at >< at >
AG_ActionOnButtonDown(cons, AG_MOUSE_LEFT, "BeginSelect");
AG_ActionOnButtonUp(cons, AG_MOUSE_LEFT, "CloseSelect");
-AG_ActionOnButtonDown(cons, AG_MOUSE_RIGHT, "ShowPopup");
AG_ActionOnButtonDown(cons, AG_MOUSE_RIGHT, "PopupMenu");
AG_ActionOnButtonDown(cons, AG_MOUSE_WHEELUP, "ScrollUp");
AG_ActionOnButtonDown(cons, AG_MOUSE_WHEELDOWN, "ScrollDown");
< at >< at > -560,6 561,9 < at >< at >
{
AG_Console *cons = p;
if (cons->pm != NULL) {
AG_PopupDestroy(cons->pm);
}
FreeLines(cons);
}
Modified: trunk/gui/file_dlg.c
===================================================================
--- trunk/gui/file_dlg.c2015-09-10 07:37:03 UTC (rev 9817)
trunk/gui/file_dlg.c2015-09-10 10:05:27 UTC (rev 9818)
< at >< at > -333,8 333,7 < at >< at >
}
}
if (ft != NULL && ft->action != NULL) {
-AG_PostEvent(NULL, fd, ft->action->name, "%s,%p",
- fd->cfile, ft);
AG_PostEventByPtr(NULL, fd, ft->action, "%s,%p", fd->cfile, ft);
}
AG_PostEvent(NULL, fd, "file-chosen", "%s,%p", fd->cfile, ft);
< at >< at > -510,10 509,9 < at >< at >
AG_FileDlgSetFilenameS(fd, itFile->text);
if (fd->okAction != NULL) {
-AG_PostEvent(NULL, fd, fd->okAction->name, "%s,%p",
AG_PostEventByPtr(NULL, fd, fd->okAction, "%s,%p",
fd->cfile,
- (fd->comTypes != NULL) ?
- AG_TlistSelectedItemPtr(fd->comTypes->list) : NULL);
fd->comTypes ? AG_TlistSelectedItemPtr(fd->comTypes->list) : NULL);
} else {
CheckAccessAndChoose(fd);
}
< at >< at > -529,7 527,7 < at >< at >
AG_ObjectLock(fd);
if (fd->okAction != NULL) {
-AG_PostEvent(NULL, fd, fd->okAction->name, "%s", fd->cfile);
AG_PostEventByPtr(NULL, fd, fd->okAction, "%s", fd->cfile);
} else {
CheckAccessAndChoose(fd);
}
< at >< at > -753,7 751,7 < at >< at >
AG_ObjectLock(fd);
if (fd->cancelAction != NULL) {
-AG_PostEvent(NULL, fd, fd->cancelAction->name, NULL);
AG_PostEventByPtr(NULL, fd, fd->cancelAction, NULL);
} else if (fd->flags & AG_FILEDLG_CLOSEWIN) {
if ((pwin = AG_ParentWindow(fd)) != NULL) {
/*AG_PostEvent(NULL, pwin, "window-close", NULL); */
< at >< at > -1280,7 1278,7 < at >< at >
/* Register a new file type. */
AG_FileType *
AG_FileDlgAddType(AG_FileDlg *fd, const char *descr, const char *exts,
- void (*fn)(AG_Event *), const char *fmt, ...)
AG_IntFn fn, const char *fmt, ...)
{
AG_FileType *ft;
char *dexts, *ds, *ext;
< at >< at > -1303,7 1301,7 < at >< at >
AG_ObjectLock(fd);
if (fn != NULL) {
-ft->action = AG_SetEvent(fd, NULL, fn, NULL);
ft->action = AG_SetIntFn(fd, fn, NULL);
AG_EVENT_GET_ARGS(ft->action, fmt);
#ifdef AG_THREADS
if (fd->flags & AG_FILEDLG_ASYNC)
Modified: trunk/gui/file_dlg.h
===================================================================
--- trunk/gui/file_dlg.h2015-09-10 07:37:03 UTC (rev 9817)
trunk/gui/file_dlg.h2015-09-10 10:05:27 UTC (rev 9818)
< at >< at > -44,7 44,7 < at >< at >
const char *descr;/* Description */
char **exts;/* Filename extensions */
Uint nexts;
-AG_Event *action; /* Action (save/load) */
AG_Function *action; /* Action (save/load) */
AG_TAILQ_HEAD_(ag_file_type_option) opts; /* Type-specific options */
AG_TAILQ_ENTRY(ag_file_type) types;
} AG_FileType;
< at >< at > -109,9 109,8 < at >< at >
int AG_FileDlgCheckWriteAccess(AG_FileDlg *);
void AG_FileDlgRefresh(AG_FileDlg *);
-AG_FileType *AG_FileDlgAddType(AG_FileDlg *, const char *,
- const char *, void (*)(AG_Event *),
- const char *, ...);
AG_FileType *AG_FileDlgAddType(AG_FileDlg *, const char *, const char *,
AG_IntFn, const char *, ...);
AG_FileOption *AG_FileOptionNewBool(AG_FileType *, const char *, const char *,
int);
Modified: trunk/tests/loader.c
===================================================================
--- trunk/tests/loader.c2015-09-10 07:37:03 UTC (rev 9817)
trunk/tests/loader.c2015-09-10 10:05:27 UTC (rev 9818)
< at >< at > -11,7 11,7 < at >< at >
#include "config/datadir.h"
/* Callback routine for AG_FileDlg. */
-static void
static int
LoadImage(AG_Event *event)
{
/*AG_FileDlg *fd = AG_SELF(); */
< at >< at > -31,15 31,15 < at >< at >
} else if (strcmp(ft->exts[0], "*.png") == 0) {
s = AG_SurfaceFromPNG(file);
} else {
-return;
AG_SetError("Unrecognized format: %s", ft->exts[0]);
return (-1);
}
-if (s == NULL) {
-AG_TextMsg(AG_MSG_ERROR, "%s: %s", file, AG_GetError());
-return;
-}
if (s == NULL)
return (-1);
if ((win = AG_WindowNew(0)) == NULL) {
-return;
AG_SurfaceFree(s);
return (-1);
}
AG_WindowSetCaption(win, "Image <%s>", AG_ShortFilename(file));
< at >< at > -71,6 71,8 < at >< at >
AG_WindowSetGeometry(win, -1, -1, 320, 240);
AG_WindowAttach(winParent, win);
AG_WindowShow(win);
return (0);
}
static int
< at >< at > -104,15 106,9 < at >< at >
* Register the loader functions. We can assign a set of user
* specified options to specific types as well.
*/
-ft[0] = AG_FileDlgAddType(fd, "Windows Bitmap",
- "*.bmp",
- LoadImage, "%p", win);
-ft[1] = AG_FileDlgAddType(fd, "JPEG image",
- "*.jpg,*.jpeg",
- LoadImage, "%p", win);
-ft[2] = AG_FileDlgAddType(fd, "Portable Network Graphics",
- "*.png",
- LoadImage, "%p", win);
ft[0] = AG_FileDlgAddType(fd, "Windows Bitmap", "*.bmp",LoadImage, "%p", win);
ft[1] = AG_FileDlgAddType(fd, "JPEG image", "*.jpg,*.jpeg",LoadImage, "%p", win);
ft[2] = AG_FileDlgAddType(fd, "Portable Network Graphics", "*.png",LoadImage, "%p", win);
for (i = 0; i < 3; i )
AG_FileOptionNewBool(ft[i], "Inverted", "invert", 0);
< at >< at > -142,7 138,7 < at >< at >
const AG_TestCase loaderTest = {
"loader",
N_("Test the AG_FileDlg(3) file selection widget"),
-"1.4.2",
"1.5.0",
0,
sizeof(AG_TestInstance),
NULL,/* init */
[Less]
|
Posted
over 9 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-10 03:37:03 -0400 (Thu, 10 Sep 2015)
New Revision: 9817
Modified:
trunk/configure
trunk/configure.in
Log:
rename objdebug -> debug-core. add debug-gui.
Modified: trunk/configure
... [More]
===================================================================
--- trunk/configure2015-09-10 07:35:55 UTC (rev 9816)
+++ trunk/configure2015-09-10 07:37:03 UTC (rev 9817)
< at >< at > -388,8 +388,8 < at >< at >
echo " --with-pthreads[=PREFIX] POSIX Threads support [check]"
echo ""
echo "Options specific to CORE library:"
+echo " --enable-debug-core Expensive AG_Object debugging [no]"
echo " --enable-network Network interface [check]"
-echo " --enable-objdebug Object system debugging [no]"
echo " --with-db4[=PREFIX] AG_Db: Berkeley DB backend [check]"
echo " --with-mysql[=PREFIX] AG_Db: MySQL backend [no]"
echo " --with-iconv[=PREFIX] Character set conversion [check]"
< at >< at > -407,6 +407,7 < at >< at >
echo " --with-portaudio[=PREFIX] Enable portaudio driver [check]"
echo ""
echo "Options specific to GUI library:"
+echo " --enable-debug-gui Expensive GUI debugging info [no]"
echo " --with-freetype[=PREFIX] Enable FreeType support [check]"
echo " --with-fontconfig[=PREFIX] Enable Fontconfig support [check]"
echo " --with-gl[=PREFIX] OpenGL rendering support [check]"
< at >< at > -3720,17 +3721,28 < at >< at >
echo "#undef AG_DEBUG" >$BLD/include/agar/config/ag_debug.h
echo "hdefs[\"AG_DEBUG\"] = nil" >>configure.lua
fi
-if [ "${enable_objdebug}" = "yes" ]
+if [ "${enable_debug_core}" = "yes" ]
then
-AG_OBJDEBUG="yes"
-echo "#ifndef AG_OBJDEBUG" > $BLD/include/agar/config/ag_objdebug.h
-echo "#define AG_OBJDEBUG \"$AG_OBJDEBUG\"" >> $BLD/include/agar/config/ag_objdebug.h
-echo "#endif" >> $BLD/include/agar/config/ag_objdebug.h
-echo "hdefs[\"AG_OBJDEBUG\"] = \"$AG_OBJDEBUG\"" >>configure.lua
+AG_DEBUG_CORE="yes"
+echo "#ifndef AG_DEBUG_CORE" > $BLD/include/agar/config/ag_debug_core.h
+echo "#define AG_DEBUG_CORE \"$AG_DEBUG_CORE\"" >> $BLD/include/agar/config/ag_debug_core.h
+echo "#endif" >> $BLD/include/agar/config/ag_debug_core.h
+echo "hdefs[\"AG_DEBUG_CORE\"] = \"$AG_DEBUG_CORE\"" >>configure.lua
else
-echo "#undef AG_OBJDEBUG" >$BLD/include/agar/config/ag_objdebug.h
-echo "hdefs[\"AG_OBJDEBUG\"] = nil" >>configure.lua
+echo "#undef AG_DEBUG_CORE" >$BLD/include/agar/config/ag_debug_core.h
+echo "hdefs[\"AG_DEBUG_CORE\"] = nil" >>configure.lua
fi
+if [ "${enable_debug_gui}" = "yes" ]
+ then
+AG_DEBUG_GUI="yes"
+echo "#ifndef AG_DEBUG_GUI" > $BLD/include/agar/config/ag_debug_gui.h
+echo "#define AG_DEBUG_GUI \"$AG_DEBUG_GUI\"" >> $BLD/include/agar/config/ag_debug_gui.h
+echo "#endif" >> $BLD/include/agar/config/ag_debug_gui.h
+echo "hdefs[\"AG_DEBUG_GUI\"] = \"$AG_DEBUG_GUI\"" >>configure.lua
+else
+echo "#undef AG_DEBUG_GUI" >$BLD/include/agar/config/ag_debug_gui.h
+echo "hdefs[\"AG_DEBUG_GUI\"] = nil" >>configure.lua
+fi
if [ "${enable_legacy}" != "no" ]
then
AG_LEGACY="yes"
< at >< at > -9718,302 +9730,302 < at >< at >
shift
done
EOT
+echo "JPEG_LIBS=$JPEG_LIBS" >>Makefile.config
+echo "mdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
+echo "CFLAGS=$CFLAGS" >>Makefile.config
+echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
+echo "COCOA_LIBS=$COCOA_LIBS" >>Makefile.config
+echo "mdefs[\"COCOA_LIBS\"] = \"$COCOA_LIBS\"" >>configure.lua
+echo "HAVE_LD_STATIC_LIBGCC=$HAVE_LD_STATIC_LIBGCC" >>Makefile.config
+echo "mdefs[\"HAVE_LD_STATIC_LIBGCC\"] = \"$HAVE_LD_STATIC_LIBGCC\"" >>configure.lua
+echo "WNO_UNINITIALIZED=$WNO_UNINITIALIZED" >>Makefile.config
+echo "mdefs[\"WNO_UNINITIALIZED\"] = \"$WNO_UNINITIALIZED\"" >>configure.lua
+echo "HAVE_CC_MCONSOLE=$HAVE_CC_MCONSOLE" >>Makefile.config
+echo "mdefs[\"HAVE_CC_MCONSOLE\"] = \"$HAVE_CC_MCONSOLE\"" >>configure..lua
+echo "UIM_LIBS=$UIM_LIBS" >>Makefile.config
+echo "mdefs[\"UIM_LIBS\"] = \"$UIM_LIBS\"" >>configure.lua
+echo "JPEG_CFLAGS=$JPEG_CFLAGS" >>Makefile.config
+echo "mdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
+echo "MYSQL_LIBS=$MYSQL_LIBS" >>Makefile.config
+echo "mdefs[\"MYSQL_LIBS\"] = \"$MYSQL_LIBS\"" >>configure.lua
+echo "BINDIR=$BINDIR" >>Makefile.config
+echo "mdefs[\"BINDIR\"] = \"$BINDIR\"" >>configure.lua
+echo "HAVE_PACKED_ATTRIBUTE=$HAVE_PACKED_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
+echo "PNG_LIBS=$PNG_LIBS" >>Makefile.config
+echo "mdefs[\"PNG_LIBS\"] = \"$PNG_LIBS\"" >>configure.lua
+echo "ENABLE_NLS=$ENABLE_NLS" >>Makefile.config
+echo "mdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
+echo "_MK_HAVE_FLOAT_H=$_MK_HAVE_FLOAT_H" >>Makefile.config
+echo "mdefs[\"_MK_HAVE_FLOAT_H\"] = \"$_MK_HAVE_FLOAT_H\"" >>configure..lua
+echo "GETTEXT_LIBS=$GETTEXT_LIBS" >>Makefile.config
+echo "mdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
+echo "HAVE_DEPRECATED_ATTRIBUTE=$HAVE_DEPRECATED_ATTRIBUTE" >>Makefile..config
+echo "mdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
echo "HAVE_ASPRINTF=$HAVE_ASPRINTF" >>Makefile.config
echo "mdefs[\"HAVE_ASPRINTF\"] = \"$HAVE_ASPRINTF\"" >>configure.lua
-echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
-echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
-echo "_MK_HAVE_SYS_TYPES_H=$_MK_HAVE_SYS_TYPES_H" >>Makefile.config
-echo "mdefs[\"_MK_HAVE_SYS_TYPES_H\"] = \"$_MK_HAVE_SYS_TYPES_H\"" >>configure.lua
-echo "CC=$CC" >>Makefile.config
-echo "mdefs[\"CC\"] = \"$CC\"" >>configure.lua
-echo "COCOA_CFLAGS=$COCOA_CFLAGS" >>Makefile.config
-echo "mdefs[\"COCOA_CFLAGS\"] = \"$COCOA_CFLAGS\"" >>configure.lua
-echo "LIBDIR=$LIBDIR" >>Makefile.config
-echo "mdefs[\"LIBDIR\"] = \"$LIBDIR\"" >>configure.lua
-echo "RELEASE=$RELEASE" >>Makefile.config
-echo "mdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
-echo "GLX_LIBS=$GLX_LIBS" >>Makefile.config
-echo "mdefs[\"GLX_LIBS\"] = \"$GLX_LIBS\"" >>configure.lua
-echo "HAVE_PORTAUDIO=$HAVE_PORTAUDIO" >>Makefile.config
-echo "mdefs[\"HAVE_PORTAUDIO\"] = \"$HAVE_PORTAUDIO\"" >>configure.lua
-echo "UIM_LIBS=$UIM_LIBS" >>Makefile.config
-echo "mdefs[\"UIM_LIBS\"] = \"$UIM_LIBS\"" >>configure.lua
-echo "OBJC=$OBJC" >>Makefile.config
-echo "mdefs[\"OBJC\"] = \"$OBJC\"" >>configure.lua
-echo "DB4_CFLAGS=$DB4_CFLAGS" >>Makefile.config
-echo "mdefs[\"DB4_CFLAGS\"] = \"$DB4_CFLAGS\"" >>configure.lua
-echo "LIBTOOLOPTS_SHARED=$LIBTOOLOPTS_SHARED" >>Makefile.config
-echo "mdefs[\"LIBTOOLOPTS_SHARED\"] = \"$LIBTOOLOPTS_SHARED\"" >>configure.lua
-echo "HAVE_CYGWIN=$HAVE_CYGWIN" >>Makefile.config
-echo "mdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
-echo "OBJCFLAGS=$OBJCFLAGS" >>Makefile.config
-echo "mdefs[\"OBJCFLAGS\"] = \"$OBJCFLAGS\"" >>configure.lua
+echo "SNDFILE_CFLAGS=$SNDFILE_CFLAGS" >>Makefile.config
+echo "mdefs[\"SNDFILE_CFLAGS\"] = \"$SNDFILE_CFLAGS\"" >>configure.lua
+echo "SYSCONFDIR=$SYSCONFDIR" >>Makefile.config
+echo "mdefs[\"SYSCONFDIR\"] = \"$SYSCONFDIR\"" >>configure.lua
+echo "VERSION=$VERSION" >>Makefile.config
+echo "mdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
+echo "HAVE_LD_NO_UNDEFINED=$HAVE_LD_NO_UNDEFINED" >>Makefile.config
+echo "mdefs[\"HAVE_LD_NO_UNDEFINED\"] = \"$HAVE_LD_NO_UNDEFINED\"" >>configure.lua
+echo "UIM_CFLAGS=$UIM_CFLAGS" >>Makefile.config
+echo "mdefs[\"UIM_CFLAGS\"] = \"$UIM_CFLAGS\"" >>configure.lua
+echo "EXECSUFFIX=$EXECSUFFIX" >>Makefile.config
+echo "mdefs[\"EXECSUFFIX\"] = \"$EXECSUFFIX\"" >>configure.lua
+echo "STATEDIR=$STATEDIR" >>Makefile.config
+echo "mdefs[\"STATEDIR\"] = \"$STATEDIR\"" >>configure.lua
+echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
+echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
+echo "ICONV_CFLAGS=$ICONV_CFLAGS" >>Makefile.config
+echo "mdefs[\"ICONV_CFLAGS\"] = \"$ICONV_CFLAGS\"" >>configure.lua
echo "_MK_HAVE_UNISTD_H=$_MK_HAVE_UNISTD_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNISTD_H\"] = \"$_MK_HAVE_UNISTD_H\"" >>configure.lua
-echo "X11_CFLAGS=$X11_CFLAGS" >>Makefile.config
-echo "mdefs[\"X11_CFLAGS\"] = \"$X11_CFLAGS\"" >>configure.lua
-echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
-echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
+echo "XINERAMA_CFLAGS=$XINERAMA_CFLAGS" >>Makefile.config
+echo "mdefs[\"XINERAMA_CFLAGS\"] = \"$XINERAMA_CFLAGS\"" >>configure.lua
+echo "PORTAUDIO_CFLAGS=$PORTAUDIO_CFLAGS" >>Makefile.config
+echo "mdefs[\"PORTAUDIO_CFLAGS\"] = \"$PORTAUDIO_CFLAGS\"" >>configure..lua
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
-echo "WNO_UNINITIALIZED=$WNO_UNINITIALIZED" >>Makefile.config
-echo "mdefs[\"WNO_UNINITIALIZED\"] = \"$WNO_UNINITIALIZED\"" >>configure.lua
-echo "HAVE_XINERAMA=$HAVE_XINERAMA" >>Makefile.config
-echo "mdefs[\"HAVE_XINERAMA\"] = \"$HAVE_XINERAMA\"" >>configure.lua
-echo "JPEG_LIBS=$JPEG_LIBS" >>Makefile.config
-echo "mdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
-echo "FONTCONFIG_CFLAGS=$FONTCONFIG_CFLAGS" >>Makefile.config
-echo "mdefs[\"FONTCONFIG_CFLAGS\"] = \"$FONTCONFIG_CFLAGS\"" >>configure.lua
-echo "FONTCONFIG_LIBS=$FONTCONFIG_LIBS" >>Makefile.config
-echo "mdefs[\"FONTCONFIG_LIBS\"] = \"$FONTCONFIG_LIBS\"" >>configure.lua
-echo "SNDFILE_CFLAGS=$SNDFILE_CFLAGS" >>Makefile.config
-echo "mdefs[\"SNDFILE_CFLAGS\"] = \"$SNDFILE_CFLAGS\"" >>configure.lua
-echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
-echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
-echo "MATH_LIBS=$MATH_LIBS" >>Makefile.config
-echo "mdefs[\"MATH_LIBS\"] = \"$MATH_LIBS\"" >>configure.lua
+echo "SUBDIR_au=$SUBDIR_au" >>Makefile.config
+echo "mdefs[\"SUBDIR_au\"] = \"$SUBDIR_au\"" >>configure.lua
+echo "HAVE_COCOA=$HAVE_COCOA" >>Makefile.config
+echo "mdefs[\"HAVE_COCOA\"] = \"$HAVE_COCOA\"" >>configure.lua
+echo "HAVE_NETWORK=$HAVE_NETWORK" >>Makefile.config
+echo "mdefs[\"HAVE_NETWORK\"] = \"$HAVE_NETWORK\"" >>configure.lua
+echo "HAVE_MYSQL=$HAVE_MYSQL" >>Makefile.config
+echo "mdefs[\"HAVE_MYSQL\"] = \"$HAVE_MYSQL\"" >>configure.lua
+echo "PTHREADS_XOPEN_CFLAGS=$PTHREADS_XOPEN_CFLAGS" >>Makefile.config
+echo "mdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
+echo "HAVE_PORTAUDIO=$HAVE_PORTAUDIO" >>Makefile.config
+echo "mdefs[\"HAVE_PORTAUDIO\"] = \"$HAVE_PORTAUDIO\"" >>configure.lua
+echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
+echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "HAVE_JPEG=$HAVE_JPEG" >>Makefile.config
echo "mdefs[\"HAVE_JPEG\"] = \"$HAVE_JPEG\"" >>configure.lua
-echo "PACKAGE=$PACKAGE" >>Makefile.config
-echo "mdefs[\"PACKAGE\"] = \"$PACKAGE\"" >>configure.lua
-echo "SUBDIR_vg=$SUBDIR_vg" >>Makefile.config
-echo "mdefs[\"SUBDIR_vg\"] = \"$SUBDIR_vg\"" >>configure.lua
-echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
-echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
+echo "PROG_GUI_FLAGS=$PROG_GUI_FLAGS" >>Makefile.config
+echo "mdefs[\"PROG_GUI_FLAGS\"] = \"$PROG_GUI_FLAGS\"" >>configure.lua
+echo "SDL_CFLAGS=$SDL_CFLAGS" >>Makefile.config
+echo "mdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
echo "HAVE___INT64=$HAVE___INT64" >>Makefile.config
echo "mdefs[\"HAVE___INT64\"] = \"$HAVE___INT64\"" >>configure.lua
-echo "XINERAMA_CFLAGS=$XINERAMA_CFLAGS" >>Makefile.config
-echo "mdefs[\"XINERAMA_CFLAGS\"] = \"$XINERAMA_CFLAGS\"" >>configure.lua
-echo "SSE_CFLAGS=$SSE_CFLAGS" >>Makefile.config
-echo "mdefs[\"SSE_CFLAGS\"] = \"$SSE_CFLAGS\"" >>configure.lua
-echo "HAVE_DLOPEN=$HAVE_DLOPEN" >>Makefile.config
-echo "mdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
-echo "HAVE_MYSQL=$HAVE_MYSQL" >>Makefile.config
-echo "mdefs[\"HAVE_MYSQL\"] = \"$HAVE_MYSQL\"" >>configure.lua
-echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
-echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
-echo "HAVE_VASPRINTF=$HAVE_VASPRINTF" >>Makefile.config
-echo "mdefs[\"HAVE_VASPRINTF\"] = \"$HAVE_VASPRINTF\"" >>configure.lua
-echo "SDL_LIBS=$SDL_LIBS" >>Makefile.config
-echo "mdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
-echo "SSE3_CFLAGS=$SSE3_CFLAGS" >>Makefile.config
-echo "mdefs[\"SSE3_CFLAGS\"] = \"$SSE3_CFLAGS\"" >>configure.lua
-echo "HAVE_MATH_C99=$HAVE_MATH_C99" >>Makefile.config
-echo "mdefs[\"HAVE_MATH_C99\"] = \"$HAVE_MATH_C99\"" >>configure.lua
-echo "HAVE_CSIDL=$HAVE_CSIDL" >>Makefile.config
-echo "mdefs[\"HAVE_CSIDL\"] = \"$HAVE_CSIDL\"" >>configure.lua
+echo "MATH_LIBS=$MATH_LIBS" >>Makefile.config
+echo "mdefs[\"MATH_LIBS\"] = \"$MATH_LIBS\"" >>configure.lua
+echo "PNG_CFLAGS=$PNG_CFLAGS" >>Makefile.config
+echo "mdefs[\"PNG_CFLAGS\"] = \"$PNG_CFLAGS\"" >>configure.lua
+echo "HAVE_PTHREAD_MUTEX_RECURSIVE_NP=$HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >>Makefile.config
+echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
+echo "LIBTOOLOPTS_SHARED=$LIBTOOLOPTS_SHARED" >>Makefile.config
+echo "mdefs[\"LIBTOOLOPTS_SHARED\"] = \"$LIBTOOLOPTS_SHARED\"" >>configure.lua
+echo "GLX_CFLAGS=$GLX_CFLAGS" >>Makefile.config
+echo "mdefs[\"GLX_CFLAGS\"] = \"$GLX_CFLAGS\"" >>configure.lua
+echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
+echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
+echo "HAVE_ICONV=$HAVE_ICONV" >>Makefile.config
+echo "mdefs[\"HAVE_ICONV\"] = \"$HAVE_ICONV\"" >>configure.lua
+echo "HAVE_FORMAT_ATTRIBUTE=$HAVE_FORMAT_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
+echo "HAVE_LIBPNG14=$HAVE_LIBPNG14" >>Makefile.config
+echo "mdefs[\"HAVE_LIBPNG14\"] = \"$HAVE_LIBPNG14\"" >>configure.lua
+echo "SRCS_AU=$SRCS_AU" >>Makefile.config
+echo "mdefs[\"SRCS_AU\"] = \"$SRCS_AU\"" >>configure.lua
+echo "MATH_C99_LIBS=$MATH_C99_LIBS" >>Makefile.config
+echo "mdefs[\"MATH_C99_LIBS\"] = \"$MATH_C99_LIBS\"" >>configure.lua
echo "HAVE_UNUSED_VARIABLE_ATTRIBUTE=$HAVE_UNUSED_VARIABLE_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_UNUSED_VARIABLE_ATTRIBUTE\"] = \"$HAVE_UNUSED_VARIABLE_ATTRIBUTE\"" >>configure.lua
-echo "SRCS_GUI=$SRCS_GUI" >>Makefile.config
-echo "mdefs[\"SRCS_GUI\"] = \"$SRCS_GUI\"" >>configure.lua
+echo "PTHREADS_XOPEN_LIBS=$PTHREADS_XOPEN_LIBS" >>Makefile.config
+echo "mdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
+echo "_MK_HAVE_LIMITS_H=$_MK_HAVE_LIMITS_H" >>Makefile.config
+echo "mdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
+echo "SNDFILE_LIBS=$SNDFILE_LIBS" >>Makefile.config
+echo "mdefs[\"SNDFILE_LIBS\"] = \"$SNDFILE_LIBS\"" >>configure.lua
+echo "_MK_HAVE_SYS_TYPES_H=$_MK_HAVE_SYS_TYPES_H" >>Makefile.config
+echo "mdefs[\"_MK_HAVE_SYS_TYPES_H\"] = \"$_MK_HAVE_SYS_TYPES_H\"" >>configure.lua
echo "HAVE_SSE3=$HAVE_SSE3" >>Makefile.config
echo "mdefs[\"HAVE_SSE3\"] = \"$HAVE_SSE3\"" >>configure.lua
-echo "_MK_HAVE_STDLIB_H=$_MK_HAVE_STDLIB_H" >>Makefile.config
-echo "mdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
-echo "SUBDIR_gui=$SUBDIR_gui" >>Makefile.config
-echo "mdefs[\"SUBDIR_gui\"] = \"$SUBDIR_gui\"" >>configure.lua
-echo "MANDIR=$MANDIR" >>Makefile.config
-echo "mdefs[\"MANDIR\"] = \"$MANDIR\"" >>configure.lua
-echo "HAVE_UIM=$HAVE_UIM" >>Makefile.config
-echo "mdefs[\"HAVE_UIM\"] = \"$HAVE_UIM\"" >>configure.lua
-echo "SNDFILE_LIBS=$SNDFILE_LIBS" >>Makefile.config
-echo "mdefs[\"SNDFILE_LIBS\"] = \"$SNDFILE_LIBS\"" >>configure.lua
+echo "X11_LIBS=$X11_LIBS" >>Makefile.config
+echo "mdefs[\"X11_LIBS\"] = \"$X11_LIBS\"" >>configure.lua
+echo "X11_CFLAGS=$X11_CFLAGS" >>Makefile.config
+echo "mdefs[\"X11_CFLAGS\"] = \"$X11_CFLAGS\"" >>configure.lua
+echo "HAVE_BOUNDED_ATTRIBUTE=$HAVE_BOUNDED_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
+echo "SUBDIR_vg=$SUBDIR_vg" >>Makefile.config
+echo "mdefs[\"SUBDIR_vg\"] = \"$SUBDIR_vg\"" >>configure.lua
+echo "HAVE_CONST_ATTRIBUTE=$HAVE_CONST_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
echo "HAVE_WGL=$HAVE_WGL" >>Makefile.config
echo "mdefs[\"HAVE_WGL\"] = \"$HAVE_WGL\"" >>configure.lua
-echo "HAVE_PTHREAD_MUTEX_RECURSIVE=$HAVE_PTHREAD_MUTEX_RECURSIVE" >>Makefile.config
-echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
-echo "HAVE_PNG=$HAVE_PNG" >>Makefile.config
-echo "mdefs[\"HAVE_PNG\"] = \"$HAVE_PNG\"" >>configure.lua
-echo "HAVE_PURE_ATTRIBUTE=$HAVE_PURE_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
-echo "HAVE_SHL_LOAD=$HAVE_SHL_LOAD" >>Makefile.config
-echo "mdefs[\"HAVE_SHL_LOAD\"] = \"$HAVE_SHL_LOAD\"" >>configure.lua
+echo "HAVE_CC_MWINDOWS=$HAVE_CC_MWINDOWS" >>Makefile.config
+echo "mdefs[\"HAVE_CC_MWINDOWS\"] = \"$HAVE_CC_MWINDOWS\"" >>configure..lua
+echo "RELEASE=$RELEASE" >>Makefile.config
+echo "mdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
+echo "CLOCK_LIBS=$CLOCK_LIBS" >>Makefile.config
+echo "mdefs[\"CLOCK_LIBS\"] = \"$CLOCK_LIBS\"" >>configure.lua
+echo "LIBEXECDIR=$LIBEXECDIR" >>Makefile.config
+echo "mdefs[\"LIBEXECDIR\"] = \"$LIBEXECDIR\"" >>configure.lua
+echo "HAVE_DB4=$HAVE_DB4" >>Makefile.config
+echo "mdefs[\"HAVE_DB4\"] = \"$HAVE_DB4\"" >>configure.lua
+echo "HAVE_ICONV_CONST=$HAVE_ICONV_CONST" >>Makefile.config
+echo "mdefs[\"HAVE_ICONV_CONST\"] = \"$HAVE_ICONV_CONST\"" >>configure..lua
+echo "HAVE_CYGWIN=$HAVE_CYGWIN" >>Makefile.config
+echo "mdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
+echo "FREETYPE_LIBS=$FREETYPE_LIBS" >>Makefile.config
+echo "mdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
+echo "HAVE_LIBOPENGL32=$HAVE_LIBOPENGL32" >>Makefile.config
+echo "mdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure..lua
+echo "HAVE_DLOPEN=$HAVE_DLOPEN" >>Makefile.config
+echo "mdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
echo "SRCS_CORE=$SRCS_CORE" >>Makefile.config
echo "mdefs[\"SRCS_CORE\"] = \"$SRCS_CORE\"" >>configure.lua
-echo "HAVE_GLX=$HAVE_GLX" >>Makefile.config
-echo "mdefs[\"HAVE_GLX\"] = \"$HAVE_GLX\"" >>configure.lua
-echo "HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
+echo "HAVE_CLOCK_GETTIME=$HAVE_CLOCK_GETTIME" >>Makefile.config
+echo "mdefs[\"HAVE_CLOCK_GETTIME\"] = \"$HAVE_CLOCK_GETTIME\"" >>configure.lua
+echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
+echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
+echo "MATH_C99_CFLAGS=$MATH_C99_CFLAGS" >>Makefile.config
+echo "mdefs[\"MATH_C99_CFLAGS\"] = \"$MATH_C99_CFLAGS\"" >>configure.lua
+echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
+echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
+echo "SRCS_GUI=$SRCS_GUI" >>Makefile.config
+echo "mdefs[\"SRCS_GUI\"] = \"$SRCS_GUI\"" >>configure.lua
+echo "HAVE_FREETYPE=$HAVE_FREETYPE" >>Makefile.config
+echo "mdefs[\"HAVE_FREETYPE\"] = \"$HAVE_FREETYPE\"" >>configure.lua
+echo "HAVE_CLOCK_WIN32=$HAVE_CLOCK_WIN32" >>Makefile.config
+echo "mdefs[\"HAVE_CLOCK_WIN32\"] = \"$HAVE_CLOCK_WIN32\"" >>configure..lua
echo "INCLDIR=$INCLDIR" >>Makefile.config
echo "mdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
-echo "BINDIR=$BINDIR" >>Makefile.config
-echo "mdefs[\"BINDIR\"] = \"$BINDIR\"" >>configure.lua
-echo "HAVE_XKB=$HAVE_XKB" >>Makefile.config
-echo "mdefs[\"HAVE_XKB\"] = \"$HAVE_XKB\"" >>configure.lua
-echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
-echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
-echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
-echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
-echo "HAVE_FONTCONFIG=$HAVE_FONTCONFIG" >>Makefile.config
-echo "mdefs[\"HAVE_FONTCONFIG\"] = \"$HAVE_FONTCONFIG\"" >>configure.lua
+echo "HAVE_CC_WARNINGS=$HAVE_CC_WARNINGS" >>Makefile.config
+echo "mdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure..lua
+echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
+echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
+echo "COCOA_CFLAGS=$COCOA_CFLAGS" >>Makefile.config
+echo "mdefs[\"COCOA_CFLAGS\"] = \"$COCOA_CFLAGS\"" >>configure.lua
echo "SUBDIR_math=$SUBDIR_math" >>Makefile.config
echo "mdefs[\"SUBDIR_math\"] = \"$SUBDIR_math\"" >>configure.lua
-echo "HAVE_LD_STATIC_LIBGCC=$HAVE_LD_STATIC_LIBGCC" >>Makefile.config
-echo "mdefs[\"HAVE_LD_STATIC_LIBGCC\"] = \"$HAVE_LD_STATIC_LIBGCC\"" >>configure.lua
-echo "MYSQL_LIBS=$MYSQL_LIBS" >>Makefile.config
-echo "mdefs[\"MYSQL_LIBS\"] = \"$MYSQL_LIBS\"" >>configure.lua
-echo "HAVE_FORMAT_ATTRIBUTE=$HAVE_FORMAT_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
-echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
-echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
+echo "HAVE_SSE2=$HAVE_SSE2" >>Makefile.config
+echo "mdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
+echo "MATH_CFLAGS=$MATH_CFLAGS" >>Makefile.config
+echo "mdefs[\"MATH_CFLAGS\"] = \"$MATH_CFLAGS\"" >>configure.lua
+echo "DSO_LIBS=$DSO_LIBS" >>Makefile.config
+echo "mdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
echo "DATADIR=$DATADIR" >>Makefile.config
echo "mdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
-echo "HAVE_PACKED_ATTRIBUTE=$HAVE_PACKED_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
-echo "HAVE_CC_MWINDOWS=$HAVE_CC_MWINDOWS" >>Makefile.config
-echo "mdefs[\"HAVE_CC_MWINDOWS\"] = \"$HAVE_CC_MWINDOWS\"" >>configure..lua
-echo "MATH_C99_CFLAGS=$MATH_C99_CFLAGS" >>Makefile.config
-echo "mdefs[\"MATH_C99_CFLAGS\"] = \"$MATH_C99_CFLAGS\"" >>configure.lua
-echo "HAVE_SSE=$HAVE_SSE" >>Makefile.config
-echo "mdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
+echo "CC=$CC" >>Makefile.config
+echo "mdefs[\"CC\"] = \"$CC\"" >>configure.lua
+echo "FONTCONFIG_CFLAGS=$FONTCONFIG_CFLAGS" >>Makefile.config
+echo "mdefs[\"FONTCONFIG_CFLAGS\"] = \"$FONTCONFIG_CFLAGS\"" >>configure.lua
echo "FREETYPE_CFLAGS=$FREETYPE_CFLAGS" >>Makefile.config
echo "mdefs[\"FREETYPE_CFLAGS\"] = \"$FREETYPE_CFLAGS\"" >>configure.lua
-echo "SUBDIR_au=$SUBDIR_au" >>Makefile.config
-echo "mdefs[\"SUBDIR_au\"] = \"$SUBDIR_au\"" >>configure.lua
-echo "GETTEXT_LIBS=$GETTEXT_LIBS" >>Makefile.config
-echo "mdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
-echo "MATH_C99_LIBS=$MATH_C99_LIBS" >>Makefile.config
-echo "mdefs[\"MATH_C99_LIBS\"] = \"$MATH_C99_LIBS\"" >>configure.lua
-echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
-echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
-echo "HAVE_SSE2=$HAVE_SSE2" >>Makefile.config
-echo "mdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
+echo "HAVE_SNDFILE=$HAVE_SNDFILE" >>Makefile.config
+echo "mdefs[\"HAVE_SNDFILE\"] = \"$HAVE_SNDFILE\"" >>configure.lua
+echo "_MK_HAVE_STDLIB_H=$_MK_HAVE_STDLIB_H" >>Makefile.config
+echo "mdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
+echo "MANDIR=$MANDIR" >>Makefile.config
+echo "mdefs[\"MANDIR\"] = \"$MANDIR\"" >>configure.lua
+echo "HAVE_SHL_LOAD=$HAVE_SHL_LOAD" >>Makefile.config
+echo "mdefs[\"HAVE_SHL_LOAD\"] = \"$HAVE_SHL_LOAD\"" >>configure.lua
+echo "SSE2_CFLAGS=$SSE2_CFLAGS" >>Makefile.config
+echo "mdefs[\"SSE2_CFLAGS\"] = \"$SSE2_CFLAGS\"" >>configure.lua
+echo "HAVE_GLX=$HAVE_GLX" >>Makefile.config
+echo "mdefs[\"HAVE_GLX\"] = \"$HAVE_GLX\"" >>configure.lua
+echo "HAVE_XINERAMA=$HAVE_XINERAMA" >>Makefile.config
+echo "mdefs[\"HAVE_XINERAMA\"] = \"$HAVE_XINERAMA\"" >>configure.lua
+echo "HAVE_NONNULL_ATTRIBUTE=$HAVE_NONNULL_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = \"$HAVE_NONNULL_ATTRIBUTE\"" >>configure.lua
+echo "LIBDIR=$LIBDIR" >>Makefile.config
+echo "mdefs[\"LIBDIR\"] = \"$LIBDIR\"" >>configure.lua
+echo "TTFDIR=$TTFDIR" >>Makefile.config
+echo "mdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
+echo "DB4_CFLAGS=$DB4_CFLAGS" >>Makefile.config
+echo "mdefs[\"DB4_CFLAGS\"] = \"$DB4_CFLAGS\"" >>configure.lua
+echo "DB4_LIBS=$DB4_LIBS" >>Makefile.config
+echo "mdefs[\"DB4_LIBS\"] = \"$DB4_LIBS\"" >>configure.lua
+echo "SUBDIR_dev=$SUBDIR_dev" >>Makefile.config
+echo "mdefs[\"SUBDIR_dev\"] = \"$SUBDIR_dev\"" >>configure.lua
echo "HAVE_INT64_T=$HAVE_INT64_T" >>Makefile.config
echo "mdefs[\"HAVE_INT64_T\"] = \"$HAVE_INT64_T\"" >>configure.lua
-echo "HAVE_BOUNDED_ATTRIBUTE=$HAVE_BOUNDED_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
-echo "EXECSUFFIX=$EXECSUFFIX" >>Makefile.config
-echo "mdefs[\"EXECSUFFIX\"] = \"$EXECSUFFIX\"" >>configure.lua
-echo "PROG_CLI_FLAGS=$PROG_CLI_FLAGS" >>Makefile.config
-echo "mdefs[\"PROG_CLI_FLAGS\"] = \"$PROG_CLI_FLAGS\"" >>configure.lua
-echo "HAVE_MATH=$HAVE_MATH" >>Makefile.config
-echo "mdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
-echo "PNG_LIBS=$PNG_LIBS" >>Makefile.config
-echo "mdefs[\"PNG_LIBS\"] = \"$PNG_LIBS\"" >>configure.lua
-echo "ICONV_CFLAGS=$ICONV_CFLAGS" >>Makefile.config
-echo "mdefs[\"ICONV_CFLAGS\"] = \"$ICONV_CFLAGS\"" >>configure.lua
-echo "STATEDIR=$STATEDIR" >>Makefile.config
-echo "mdefs[\"STATEDIR\"] = \"$STATEDIR\"" >>configure.lua
-echo "HAVE_CONST_ATTRIBUTE=$HAVE_CONST_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
-echo "JPEG_CFLAGS=$JPEG_CFLAGS" >>Makefile.config
-echo "mdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
-echo "SRCS_AU=$SRCS_AU" >>Makefile.config
-echo "mdefs[\"SRCS_AU\"] = \"$SRCS_AU\"" >>configure.lua
-echo "HAVE_ICONV=$HAVE_ICONV" >>Makefile.config
-echo "mdefs[\"HAVE_ICONV\"] = \"$HAVE_ICONV\"" >>configure.lua
-echo "SSE2_CFLAGS=$SSE2_CFLAGS" >>Makefile.config
-echo "mdefs[\"SSE2_CFLAGS\"] = \"$SSE2_CFLAGS\"" >>configure.lua
-echo "HAVE_NORETURN_ATTRIBUTE=$HAVE_NORETURN_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
-echo "LIBEXECDIR=$LIBEXECDIR" >>Makefile.config
-echo "mdefs[\"LIBEXECDIR\"] = \"$LIBEXECDIR\"" >>configure.lua
-echo "PNG_CFLAGS=$PNG_CFLAGS" >>Makefile.config
-echo "mdefs[\"PNG_CFLAGS\"] = \"$PNG_CFLAGS\"" >>configure.lua
-echo "HAVE_CC_MCONSOLE=$HAVE_CC_MCONSOLE" >>Makefile.config
-echo "mdefs[\"HAVE_CC_MCONSOLE\"] = \"$HAVE_CC_MCONSOLE\"" >>configure..lua
-echo "X11_LIBS=$X11_LIBS" >>Makefile.config
-echo "mdefs[\"X11_LIBS\"] = \"$X11_LIBS\"" >>configure.lua
-echo "CLOCK_LIBS=$CLOCK_LIBS" >>Makefile.config
-echo "mdefs[\"CLOCK_LIBS\"] = \"$CLOCK_LIBS\"" >>configure.lua
-echo "DSO_LIBS=$DSO_LIBS" >>Makefile.config
-echo "mdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
-echo "XINERAMA_LIBS=$XINERAMA_LIBS" >>Makefile.config
-echo "mdefs[\"XINERAMA_LIBS\"] = \"$XINERAMA_LIBS\"" >>configure.lua
-echo "HAVE_OBJC_WARNINGS=$HAVE_OBJC_WARNINGS" >>Makefile.config
-echo "mdefs[\"HAVE_OBJC_WARNINGS\"] = \"$HAVE_OBJC_WARNINGS\"" >>configure.lua
+echo "SSE_CFLAGS=$SSE_CFLAGS" >>Makefile.config
+echo "mdefs[\"SSE_CFLAGS\"] = \"$SSE_CFLAGS\"" >>configure.lua
+echo "GETTEXT_CFLAGS=$GETTEXT_CFLAGS" >>Makefile.config
+echo "mdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
+echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
+echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
+echo "SUBDIR_gui=$SUBDIR_gui" >>Makefile.config
+echo "mdefs[\"SUBDIR_gui\"] = \"$SUBDIR_gui\"" >>configure.lua
+echo "HAVE_FONTCONFIG=$HAVE_FONTCONFIG" >>Makefile.config
+echo "mdefs[\"HAVE_FONTCONFIG\"] = \"$HAVE_FONTCONFIG\"" >>configure.lua
+echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
+echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
+echo "HAVE_PURE_ATTRIBUTE=$HAVE_PURE_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
+echo "OBJCFLAGS=$OBJCFLAGS" >>Makefile.config
+echo "mdefs[\"OBJCFLAGS\"] = \"$OBJCFLAGS\"" >>configure.lua
+echo "MODULEDIR=$MODULEDIR" >>Makefile.config
+echo "mdefs[\"MODULEDIR\"] = \"$MODULEDIR\"" >>configure.lua
+echo "HAVE_VASPRINTF=$HAVE_VASPRINTF" >>Makefile.config
+echo "mdefs[\"HAVE_VASPRINTF\"] = \"$HAVE_VASPRINTF\"" >>configure.lua
+echo "HAVE_PTHREAD_MUTEX_RECURSIVE=$HAVE_PTHREAD_MUTEX_RECURSIVE" >>Makefile.config
+echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
+echo "HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
+echo "HAVE_UIM=$HAVE_UIM" >>Makefile.config
+echo "mdefs[\"HAVE_UIM\"] = \"$HAVE_UIM\"" >>configure.lua
echo "PORTAUDIO_LIBS=$PORTAUDIO_LIBS" >>Makefile.config
echo "mdefs[\"PORTAUDIO_LIBS\"] = \"$PORTAUDIO_LIBS\"" >>configure.lua
-echo "MODULEDIR=$MODULEDIR" >>Makefile.config
-echo "mdefs[\"MODULEDIR\"] = \"$MODULEDIR\"" >>configure.lua
-echo "GLX_CFLAGS=$GLX_CFLAGS" >>Makefile.config
-echo "mdefs[\"GLX_CFLAGS\"] = \"$GLX_CFLAGS\"" >>configure.lua
-echo "CFLAGS=$CFLAGS" >>Makefile.config
-echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
-echo "MYSQL_CFLAGS=$MYSQL_CFLAGS" >>Makefile.config
-echo "mdefs[\"MYSQL_CFLAGS\"] = \"$MYSQL_CFLAGS\"" >>configure.lua
-echo "_MK_HAVE_LIMITS_H=$_MK_HAVE_LIMITS_H" >>Makefile.config
-echo "mdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
-echo "COCOA_LIBS=$COCOA_LIBS" >>Makefile.config
-echo "mdefs[\"COCOA_LIBS\"] = \"$COCOA_LIBS\"" >>configure.lua
-echo "FREETYPE_LIBS=$FREETYPE_LIBS" >>Makefile.config
-echo "mdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
-echo "HAVE_DEPRECATED_ATTRIBUTE=$HAVE_DEPRECATED_ATTRIBUTE" >>Makefile..config
-echo "mdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
-echo "ENABLE_NLS=$ENABLE_NLS" >>Makefile.config
-echo "mdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
-echo "PORTAUDIO_CFLAGS=$PORTAUDIO_CFLAGS" >>Makefile.config
-echo "mdefs[\"PORTAUDIO_CFLAGS\"] = \"$PORTAUDIO_CFLAGS\"" >>configure..lua
-echo "HAVE_CC_WARNINGS=$HAVE_CC_WARNINGS" >>Makefile.config
-echo "mdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure..lua
-echo "HAVE_ICONV_CONST=$HAVE_ICONV_CONST" >>Makefile.config
-echo "mdefs[\"HAVE_ICONV_CONST\"] = \"$HAVE_ICONV_CONST\"" >>configure..lua
-echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
-echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
+echo "PACKAGE=$PACKAGE" >>Makefile.config
+echo "mdefs[\"PACKAGE\"] = \"$PACKAGE\"" >>configure.lua
echo "CLOCK_CFLAGS=$CLOCK_CFLAGS" >>Makefile.config
echo "mdefs[\"CLOCK_CFLAGS\"] = \"$CLOCK_CFLAGS\"" >>configure.lua
-echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
-echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "DSO_CFLAGS=$DSO_CFLAGS" >>Makefile.config
echo "mdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
-echo "SYSCONFDIR=$SYSCONFDIR" >>Makefile.config
-echo "mdefs[\"SYSCONFDIR\"] = \"$SYSCONFDIR\"" >>configure.lua
-echo "PTHREADS_XOPEN_LIBS=$PTHREADS_XOPEN_LIBS" >>Makefile.config
-echo "mdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
+echo "HAVE_XKB=$HAVE_XKB" >>Makefile.config
+echo "mdefs[\"HAVE_XKB\"] = \"$HAVE_XKB\"" >>configure.lua
+echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
+echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
+echo "HAVE_NORETURN_ATTRIBUTE=$HAVE_NORETURN_ATTRIBUTE" >>Makefile.config
+echo "mdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
+echo "FONTCONFIG_LIBS=$FONTCONFIG_LIBS" >>Makefile.config
+echo "mdefs[\"FONTCONFIG_LIBS\"] = \"$FONTCONFIG_LIBS\"" >>configure.lua
echo "HAVE_X11=$HAVE_X11" >>Makefile.config
echo "mdefs[\"HAVE_X11\"] = \"$HAVE_X11\"" >>configure.lua
-echo "HAVE_CLOCK_WIN32=$HAVE_CLOCK_WIN32" >>Makefile.config
-echo "mdefs[\"HAVE_CLOCK_WIN32\"] = \"$HAVE_CLOCK_WIN32\"" >>configure..lua
+echo "HAVE_OBJC_WARNINGS=$HAVE_OBJC_WARNINGS" >>Makefile.config
+echo "mdefs[\"HAVE_OBJC_WARNINGS\"] = \"$HAVE_OBJC_WARNINGS\"" >>configure.lua
+echo "HAVE_PNG=$HAVE_PNG" >>Makefile.config
+echo "mdefs[\"HAVE_PNG\"] = \"$HAVE_PNG\"" >>configure.lua
+echo "PROG_CLI_FLAGS=$PROG_CLI_FLAGS" >>Makefile.config
+echo "mdefs[\"PROG_CLI_FLAGS\"] = \"$PROG_CLI_FLAGS\"" >>configure.lua
+echo "HAVE_MATH=$HAVE_MATH" >>Makefile.config
+echo "mdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
+echo "ICONV_LIBS=$ICONV_LIBS" >>Makefile.config
+echo "mdefs[\"ICONV_LIBS\"] = \"$ICONV_LIBS\"" >>configure.lua
echo "LOCALEDIR=$LOCALEDIR" >>Makefile.config
echo "mdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
-echo "HAVE_DB4=$HAVE_DB4" >>Makefile.config
-echo "mdefs[\"HAVE_DB4\"] = \"$HAVE_DB4\"" >>configure.lua
-echo "HAVE_FREETYPE=$HAVE_FREETYPE" >>Makefile.config
-echo "mdefs[\"HAVE_FREETYPE\"] = \"$HAVE_FREETYPE\"" >>configure.lua
+echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
+echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
+echo "SDL_LIBS=$SDL_LIBS" >>Makefile.config
+echo "mdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
+echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
+echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
+echo "HAVE_CSIDL=$HAVE_CSIDL" >>Makefile.config
+echo "mdefs[\"HAVE_CSIDL\"] = \"$HAVE_CSIDL\"" >>configure.lua
+echo "XINERAMA_LIBS=$XINERAMA_LIBS" >>Makefile.config
+echo "mdefs[\"XINERAMA_LIBS\"] = \"$XINERAMA_LIBS\"" >>configure.lua
+echo "MYSQL_CFLAGS=$MYSQL_CFLAGS" >>Makefile.config
+echo "mdefs[\"MYSQL_CFLAGS\"] = \"$MYSQL_CFLAGS\"" >>configure.lua
+echo "SSE3_CFLAGS=$SSE3_CFLAGS" >>Makefile.config
+echo "mdefs[\"SSE3_CFLAGS\"] = \"$SSE3_CFLAGS\"" >>configure.lua
+echo "GLX_LIBS=$GLX_LIBS" >>Makefile.config
+echo "mdefs[\"GLX_LIBS\"] = \"$GLX_LIBS\"" >>configure.lua
echo "HAVE_ALIGNED_ATTRIBUTE=$HAVE_ALIGNED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
-echo "HAVE_COCOA=$HAVE_COCOA" >>Makefile.config
-echo "mdefs[\"HAVE_COCOA\"] = \"$HAVE_COCOA\"" >>configure.lua
-echo "HAVE_LIBOPENGL32=$HAVE_LIBOPENGL32" >>Makefile.config
-echo "mdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure..lua
-echo "ICONV_LIBS=$ICONV_LIBS" >>Makefile.config
-echo "mdefs[\"ICONV_LIBS\"] = \"$ICONV_LIBS\"" >>configure.lua
-echo "UIM_CFLAGS=$UIM_CFLAGS" >>Makefile.config
-echo "mdefs[\"UIM_CFLAGS\"] = \"$UIM_CFLAGS\"" >>configure.lua
-echo "VERSION=$VERSION" >>Makefile.config
-echo "mdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
-echo "HAVE_SNDFILE=$HAVE_SNDFILE" >>Makefile.config
-echo "mdefs[\"HAVE_SNDFILE\"] = \"$HAVE_SNDFILE\"" >>configure.lua
-echo "MATH_CFLAGS=$MATH_CFLAGS" >>Makefile.config
-echo "mdefs[\"MATH_CFLAGS\"] = \"$MATH_CFLAGS\"" >>configure.lua
-echo "HAVE_LIBPNG14=$HAVE_LIBPNG14" >>Makefile.config
-echo "mdefs[\"HAVE_LIBPNG14\"] = \"$HAVE_LIBPNG14\"" >>configure.lua
-echo "_MK_HAVE_FLOAT_H=$_MK_HAVE_FLOAT_H" >>Makefile.config
-echo "mdefs[\"_MK_HAVE_FLOAT_H\"] = \"$_MK_HAVE_FLOAT_H\"" >>configure..lua
-echo "DB4_LIBS=$DB4_LIBS" >>Makefile.config
-echo "mdefs[\"DB4_LIBS\"] = \"$DB4_LIBS\"" >>configure.lua
-echo "SDL_CFLAGS=$SDL_CFLAGS" >>Makefile.config
-echo "mdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
-echo "PROG_GUI_FLAGS=$PROG_GUI_FLAGS" >>Makefile.config
-echo "mdefs[\"PROG_GUI_FLAGS\"] = \"$PROG_GUI_FLAGS\"" >>configure.lua
-echo "HAVE_PTHREAD_MUTEX_RECURSIVE_NP=$HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >>Makefile.config
-echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
-echo "PTHREADS_XOPEN_CFLAGS=$PTHREADS_XOPEN_CFLAGS" >>Makefile.config
-echo "mdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
-echo "HAVE_NONNULL_ATTRIBUTE=$HAVE_NONNULL_ATTRIBUTE" >>Makefile.config
-echo "mdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = \"$HAVE_NONNULL_ATTRIBUTE\"" >>configure.lua
-echo "HAVE_LD_NO_UNDEFINED=$HAVE_LD_NO_UNDEFINED" >>Makefile.config
-echo "mdefs[\"HAVE_LD_NO_UNDEFINED\"] = \"$HAVE_LD_NO_UNDEFINED\"" >>configure.lua
-echo "HAVE_CLOCK_GETTIME=$HAVE_CLOCK_GETTIME" >>Makefile.config
-echo "mdefs[\"HAVE_CLOCK_GETTIME\"] = \"$HAVE_CLOCK_GETTIME\"" >>configure.lua
-echo "TTFDIR=$TTFDIR" >>Makefile.config
-echo "mdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
-echo "SUBDIR_dev=$SUBDIR_dev" >>Makefile.config
-echo "mdefs[\"SUBDIR_dev\"] = \"$SUBDIR_dev\"" >>configure.lua
-echo "HAVE_NETWORK=$HAVE_NETWORK" >>Makefile.config
-echo "mdefs[\"HAVE_NETWORK\"] = \"$HAVE_NETWORK\"" >>configure.lua
-echo "GETTEXT_CFLAGS=$GETTEXT_CFLAGS" >>Makefile.config
-echo "mdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
+echo "HAVE_MATH_C99=$HAVE_MATH_C99" >>Makefile.config
+echo "mdefs[\"HAVE_MATH_C99\"] = \"$HAVE_MATH_C99\"" >>configure.lua
+echo "OBJC=$OBJC" >>Makefile.config
+echo "mdefs[\"OBJC\"] = \"$OBJC\"" >>configure.lua
+echo "HAVE_SSE=$HAVE_SSE" >>Makefile.config
+echo "mdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
if [ "${srcdir}" != "" ]; then
$ECHO_N "* Source is in ${srcdir}. Generating Makefiles..."
${PERL} ${SRC}/mk/mkconcurrent.pl ${SRC}
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in2015-09-10 07:35:55 UTC (rev 9816)
+++ trunk/configure.in2015-09-10 07:37:03 UTC (rev 9817)
< at >< at > -20,8 +20,8 < at >< at >
REGISTER("--with-pthreads[=PREFIX]","POSIX Threads support [check]")
REGISTER_SECTION("Options specific to CORE library:")
+REGISTER("--enable-debug-core","Expensive AG_Object debugging [no]")
REGISTER("--enable-network","Network interface [check]")
-REGISTER("--enable-objdebug","Object system debugging [no]")
REGISTER("--with-db4[=PREFIX]","AG_Db: Berkeley DB backend [check]")
REGISTER("--with-mysql[=PREFIX]","AG_Db: MySQL backend [no]")
REGISTER("--with-iconv[=PREFIX]","Character set conversion [check]")
< at >< at > -39,6 +39,7 < at >< at >
REGISTER("--with-portaudio[=PREFIX]","Enable portaudio driver [check]")
REGISTER_SECTION("Options specific to GUI library:")
+REGISTER("--enable-debug-gui","Expensive GUI debugging [no]")
REGISTER("--with-freetype[=PREFIX]","Enable FreeType support [check]")
REGISTER("--with-fontconfig[=PREFIX]","Enable Fontconfig support [check]")
REGISTER("--with-gl[=PREFIX]","OpenGL rendering support [check]")
< at >< at > -128,11 +129,16 < at >< at >
else
HUNDEF(AG_DEBUG)
fi
-if [ "${enable_objdebug}" = "yes" ]; then
-HDEFINE(AG_OBJDEBUG, "yes")
+if [ "${enable_debug_core}" = "yes" ]; then
+HDEFINE(AG_DEBUG_CORE, "yes")
else
-HUNDEF(AG_OBJDEBUG)
+HUNDEF(AG_DEBUG_CORE)
fi
+if [ "${enable_debug_gui}" = "yes" ]; then
+HDEFINE(AG_DEBUG_GUI, "yes")
+else
+HUNDEF(AG_DEBUG_GUI)
+fi
if [ "${enable_legacy}" != "no" ]; then
HDEFINE(AG_LEGACY, "yes")
else
[Less]
|
Posted
over 9 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-10 03:35:55 -0400 (Thu, 10 Sep 2015)
New Revision: 9816
Modified:
trunk/core/AG_Object.3
trunk/core/class.c
trunk/core/data_source.c
trunk/core/db_bdb.c
trunk/core/error.c
trunk/core/object.c
... [More]
trunk/core/object.h
trunk/core/variable.h
Log:
- clean up debug code. fix object name formatting with DebugCallback.
- remove unneeded AG_Object member nevents.
Modified: trunk/core/AG_Object.3
===================================================================
--- trunk/core/AG_Object.32015-09-10 07:33:59 UTC (rev 9815)
trunk/core/AG_Object.32015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -491,9 491,6 < at >< at >
string exists, it specifies a comma-separated list of dynamically-linked
library (modules) accessible from
.Xr AG_DSO 3 .
-It is implied that
-.Ft AG_Object
-is the "root class", so there is no need to specify it in the string.
.Pp
The
.Va size
< at >< at > -1147,13 1144,13 < at >< at >
.It Ft size_t size
Size of instance structure (in bytes).
.It Ft AG_Version ver
-Version major and minor (see
Versioning information (see
.Xr AG_Version 3 ) .
-This field is only useful with object data archiving.
.It Ft void (*init)
-Object data initialization routine.
Initialization routine.
.It Ft void (*reinit)
-Object data re-initialization routine.
Cleanup routine (for
.Fn AG_ObjectFreeDataset ) .
.It Ft void (*destroy)
Final cleanup routine.
.It Ft int (*load)
< at >< at > -1161,7 1158,7 < at >< at >
.It Ft int (*save)
Dataset archiving function (serialization).
.It Ft void *(*edit)
-Optional GUI-specific edition call.
Interface-specific editor entry point.
.It Ft char *name
Short class name.
Set internally to the last element in inheritance hierarchy.
< at >< at > -1211,12 1208,13 < at >< at >
Object flags (see
.Sx FLAGS
section).
-.It Ft Uint nevents
-Count on the number of registered event handlers.
.It Ft TAILQ events
List of
.Xr AG_Event 3
-structure describing active event handlers.
items describing registered event handlers (as set by
.Fn AG_SetEvent ) ,
as well as virtual functions (as set by
.Fn AG_Set<Type>Fn ) .
.It Ft TAILQ timeouts
List of
.Xr AG_Timeout 3
Modified: trunk/core/class.c
===================================================================
--- trunk/core/class.c2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/class.c2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -1,5 1,5 < at >< at >
/*
- * Copyright (c) 2003-2011 Hypertriton, Inc. <http://hypertriton.com/>
* Copyright (c) 2003-2015 Hypertriton, Inc. <http://hypertriton.com/>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
< at >< at > -28,7 28,7 < at >< at >
*/
#include <agar/core/core.h>
-#include <agar/config/ag_objdebug.h>
#include <agar/config/ag_debug_core.h>
#include <string.h>
#include <ctype.h>
< at >< at > -228,7 228,7 < at >< at >
}
InitClass(cl, cs.hier, cs.libs);
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(NULL, "Registered class: %s: %s (%s)\n", cs.name, cs.hier,
cs.libs);
#endif
< at >< at > -263,7 263,7 < at >< at >
AG_MutexLock(&agClassLock);
if (AG_TblExistsHash(agClassTbl, h, cl->hier)) {
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(NULL, "Unregistering class: %s\n", cl->name);
#endif
/* Remove from the class tree. */
< at >< at > -379,9 379,11 < at >< at >
for (i = 0, s = cs.libs;
(lib = Strsep(&s, ", ")) != NULL;
i ) {
#ifdef AG_DEBUG_CORE
Debug(NULL, "<%s>: Linking %s...", classSpec, lib);
#endif
if ((dso = AG_LoadDSO(lib, 0)) == NULL) {
-AG_SetError("Loading <%s>: %s", classSpec,
- AG_GetError());
AG_SetError("Loading <%s>: %s", classSpec, AG_GetError());
goto fail;
}
/* Look up "pfxFooClass" in the first library. */
< at >< at > -395,6 397,9 < at >< at >
goto fail;
}
}
#ifdef AG_DEBUG_CORE
Debug(NULL, "OK\n");
#endif
}
if (pClass == NULL) {
AG_SetError("Loading <%s>: No library specified", classSpec);
< at >< at > -405,6 410,9 < at >< at >
AG_MutexUnlock(&agClassLock);
return (pClass);
fail:
#ifdef AG_DEBUG_CORE
Debug(NULL, "%s\n", AG_GetError());
#endif
AG_MutexUnlock(&agClassLock);
return (pClass);
}
Modified: trunk/core/data_source.c
===================================================================
--- trunk/core/data_source.c2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/data_source.c2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -73,7 73,7 < at >< at >
}
AG_ObjectLock(&errorMgr);
-AG_PostEvent(NULL, &errorMgr, ds->errorFn->name, "%s", msg);
AG_PostEventByPtr(NULL, &errorMgr, ds->errorFn, "%s", msg);
AG_ObjectUnlock(&errorMgr);
}
Modified: trunk/core/db_bdb.c
===================================================================
--- trunk/core/db_bdb.c2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/db_bdb.c2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -108,7 108,7 < at >< at >
int rv;
if ((rv = db->pDB->close(db->pDB, 0)) != 0)
-AG_Verbose("db_close: %s; ignoring", db_strerror(rv));
AG_Verbose("db_close: %s; ignoring\n", db_strerror(rv));
}
static int
Modified: trunk/core/error.c
===================================================================
--- trunk/core/error.c2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/error.c2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -198,6 198,16 < at >< at >
if (agDebugCallback != NULL) {
char *buf;
if (obj != NULL) {
if (obj->name[0] != '\0') {
Asprintf(&buf, "%s: ", obj->name);
} else {
Asprintf(&buf, "<%p>: ", obj);
}
agDebugCallback(buf);
free(buf);
}
va_start(args, fmt);
Vasprintf(&buf, fmt, args);
va_end(args);
< at >< at > -207,7 217,7 < at >< at >
}
free(buf);
}
-if (agDebugLvl >= 1 || (obj != NULL && OBJECT_DEBUG(obj))) {
if (agDebugLvl >= 1) {
va_start(args, fmt);
# if defined(DEBUG_TO_FILE)
/* Redirect output to foo-debug.txt */
< at >< at > -223,8 233,8 < at >< at >
}
if ((f = fopen(path, "a")) != NULL) {
if (obj != NULL) {
-if (OBJECT(obj)->name[0] != '\0') {
-fprintf(f, "%s: ", OBJECT(obj)->name);
if (obj->name[0] != '\0') {
fprintf(f, "%s: ", obj->name);
} else {
fprintf(f, "<%p>: ", obj);
}
< at >< at > -240,10 250,8 < at >< at >
cons = GetStdHandle(STD_ERROR_HANDLE);
if (cons != NULL && cons != INVALID_HANDLE_VALUE) {
-if (obj != NULL &&
- OBJECT(obj)->name[0] != '\0') {
-WriteConsole(cons, OBJECT(obj)->name,
- strlen(OBJECT(obj)->name), NULL, NULL);
if (obj != NULL && obj->name[0] != '\0') {
WriteConsole(cons, obj->name, strlen(obj->name), NULL, NULL);
WriteConsole(cons, ": ", 2, NULL, NULL);
}
Vasprintf(&buf, fmt, args);
< at >< at > -253,8 261,8 < at >< at >
}
# else /* _WIN32 */
if (obj != NULL) {
-if (OBJECT(obj)->name[0] != '\0') {
-printf("%s: ", OBJECT(obj)->name);
if (obj->name[0] != '\0') {
printf("%s: ", obj->name);
} else {
printf("<%p>: ", obj);
}
Modified: trunk/core/object.c
===================================================================
--- trunk/core/object.c2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/object.c2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -1,5 1,5 < at >< at >
/*
- * Copyright (c) 2001-2012 Hypertriton, Inc. <http://hypertriton.com/>
* Copyright (c) 2001-2015 Hypertriton, Inc. <http://hypertriton.com/>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
< at >< at > -37,7 37,7 < at >< at >
#include <ctype.h>
#include <string.h>
-#include <agar/config/ag_objdebug.h>
#include <agar/config/ag_debug_core.h>
AG_ObjectClass agObjectClass = {
"Agar(Object)",
< at >< at > -75,7 75,6 < at >< at >
ob->parent = NULL;
ob->root = ob;
ob->flags = 0;
-ob->nevents = 0;
ob->attachFn = NULL;
ob->detachFn = NULL;
< at >< at > -412,7 411,7 < at >< at >
/* Call the attach function if one is defined. */
if (chld->attachFn != NULL) {
-chld->attachFn->handler(chld->attachFn);
chld->attachFn->fn.fnVoid(chld->attachFn);
goto out;
}
< at >< at > -429,10 428,18 < at >< at >
AG_PostEvent(parent, chld, "attached", NULL);
AG_PostEvent(chld, parent, "child-attached", NULL);
-#ifdef AG_OBJDEBUG
-Debug(parent, "Attached child object: %s\n", chld->name);
-Debug(chld, "Attached to new parent: %s\n", parent->name);
-#endif
#ifdef AG_DEBUG_CORE
if (chld->name[0] != '\0') {
Debug(parent, "Attached child: %s\n", chld->name);
} else {
Debug(parent, "Attached child: <%p>\n", chld);
}
if (parent->name[0] != '\0') {
Debug(chld, "New parent: %s\n", parent->name);
} else {
Debug(chld, "New parent: <%p>\n", parent);
}
#endif /* AG_DEBUG_CORE */
out:
AG_ObjectUnlock(chld);
< at >< at > -497,7 504,7 < at >< at >
/* Call the detach function if one is defined. */
if (chld->detachFn != NULL) {
-chld->detachFn->handler(chld->detachFn);
chld->detachFn->fn.fnVoid(chld->detachFn);
goto out;
}
< at >< at > -518,10 525,16 < at >< at >
AG_PostEvent(parent, chld, "detached", NULL);
AG_PostEvent(chld, parent, "child-detached", NULL);
-#ifdef AG_OBJDEBUG
-Debug(parent, "Detached child object %s\n", chld->name);
-Debug(chld, "Detached from parent %s\n", parent->name);
-#endif
#ifdef AG_DEBUG_CORE
if (chld->name[0] != '\0') {
Debug(parent, "Detached child: %s\n", chld->name);
} else {
Debug(parent, "Detached child: <%p>\n", chld);
}
if (parent->name[0] != '\0') {
Debug(chld, "New parent: NULL\n");
}
#endif /* AG_DEBUG_CORE */
out:
AG_ObjectUnlock(chld);
< at >< at > -703,6 716,13 < at >< at >
}
AG_ObjectUnlock(obj);
#ifdef AG_DEBUG_CORE
if (obj->name[0] != '\0') {
Debug(NULL, "Freeing: %s\n", obj->name);
} else {
Debug(NULL, "Freeing: <%p>\n", obj);
}
#endif
AG_ObjectDetach(obj);
AG_ObjectDestroy(obj);
}
< at >< at > -771,7 791,7 < at >< at >
AG_Timer *to, *toNext;
int i, nHier;
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
if (ob->parent != NULL) {
AG_FatalError("AG_ObjectDestroy: %s still attached to %p",
ob->name, ob->parent);
< at >< at > -993,9 1013,6 < at >< at >
AG_ObjectLock(ob);
TAILQ_FOREACH(dep, &ob->deps, deps) {
-#ifdef AG_OBJDEBUG
-Debug(ob, "Resolving dependency: %s\n", dep->path);
-#endif
if (dep->obj != NULL) {
continue;
}
< at >< at > -1004,9 1021,8 < at >< at >
ob->name, dep->path);
goto fail;
}
-#ifdef AG_OBJDEBUG
-Debug(ob, "Dependency resolves to %p (%s)\n", dep->obj,
- dep->obj->name);
#ifdef AG_DEBUG_CORE
Debug(ob, "Dependency: %p (%s)\n", dep->obj, dep->obj->name);
#endif
free(dep->path); dep->path = NULL;
}
< at >< at > -1093,9 1109,6 < at >< at >
dep->count = 0;
dep->persistent = 1;
TAILQ_INSERT_TAIL(&ob->deps, dep, deps);
-#ifdef AG_OBJDEBUG
-Debug(ob, "Dependency: %s\n", dep->path);
-#endif
}
return (0);
fail:
< at >< at > -1219,7 1232,7 < at >< at >
AG_LockVariable(V);
if (V->fn.fnVoid != NULL &&
AG_EvalVariable(ob, V) == -1) {
-Verbose("Save: eval %s failed (%s); ignoring", V->name,
Verbose("Save: eval %s failed (%s); ignoring\n", V->name,
AG_GetError());
AG_UnlockVariable(V);
continue;
< at >< at > -1288,7 1301,7 < at >< at >
if (GetDatafile(path, ob) == -1)
goto fail_unlock;
}
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Loading generic data from %s\n", path);
#endif
if ((ds = AG_OpenFile(path, "rb")) == NULL)
< at >< at > -1347,7 1360,7 < at >< at >
if ((cl = AG_LoadClass(hier)) == NULL) {
AG_SetError("%s: %s", ob->name, AG_GetError());
if (agObjectIgnoreUnknownObjs) {
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "%s; ignoring\n", AG_GetError());
#endif
continue;
< at >< at > -1409,7 1422,7 < at >< at >
goto fail_unlock;
}
}
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Loading dataset from %s\n", path);
#endif
if ((ds = AG_OpenFile(path, "rb")) == NULL) {
< at >< at > -1432,7 1445,7 < at >< at >
AG_ObjectFreeDataset(ob);
for (i = 0; i < nHier; i ) {
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Loading as %s\n", hier[i]->name);
#endif
if (hier[i]->load == NULL)
< at >< at > -1577,7 1590,7 < at >< at >
goto fail;
}
for (i = 0; i < nHier; i ) {
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Saving as %s\n", hier[i]->name);
#endif
if (hier[i]->save == NULL)
< at >< at > -1647,7 1660,7 < at >< at >
goto fail;
}
for (i = 0; i < nHier; i ) {
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Loading as %s\n", hier[i]->name);
#endif
if (hier[i]->load == NULL)
< at >< at > -1720,7 1733,7 < at >< at >
Strlcat(path, ob->cls->name, sizeof(path));
}
}
-#ifdef AG_OBJDEBUG
#ifdef AG_DEBUG_CORE
Debug(ob, "Saving object to %s\n", path);
#endif
if (agObjectBackups) {
Modified: trunk/core/object.h
===================================================================
--- trunk/core/object.h2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/object.h2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -73,10 73,8 < at >< at >
AG_OBJECT_REOPEN_ONLOAD|\
AG_OBJECT_REMAIN_DATA)
-Uint nevents;/* Event handler count */
-AG_TAILQ_HEAD_(ag_event) events;/* Event handlers */
AG_TAILQ_HEAD_(ag_event) events;/* Event handlers / virtual fns */
AG_TAILQ_HEAD_(ag_timer) timers;/* Running timers */
-AG_TAILQ_HEAD_(ag_timer) timersChg;/* Timers to change */
AG_TAILQ_HEAD_(ag_variable) vars;/* Named variables / bindings */
AG_TAILQ_HEAD_(ag_object_dep) deps;/* Object dependencies */
struct ag_objectq children;/* Child objects */
Modified: trunk/core/variable.h
===================================================================
--- trunk/core/variable.h2015-09-10 07:33:59 UTC (rev 9815)
trunk/core/variable.h2015-09-10 07:35:55 UTC (rev 9816)
< at >< at > -85,29 85,29 < at >< at >
typedef const void *(*AG_ConstPointerFn)(struct ag_event *);
typedef AG_Text *(*AG_TextFn)(struct ag_event *);
-union ag_variable_fn {
-void (*fnVoid)(struct ag_event *);
-Uint (*fnUint)(struct ag_event *);
-int (*fnInt)(struct ag_event *);
-Uint8 (*fnUint8)(struct ag_event *);
-Sint8 (*fnSint8)(struct ag_event *);
-Uint16 (*fnUint16)(struct ag_event *);
-Sint16 (*fnSint16)(struct ag_event *);
-Uint32 (*fnUint32)(struct ag_event *);
-Sint32 (*fnSint32)(struct ag_event *);
union ag_function {
AG_VoidFnfnVoid;
AG_UintFnfnUint;
AG_IntFnfnInt;
AG_Uint8FnfnUint8;
AG_Sint8FnfnSint8;
AG_Uint16FnfnUint16;
AG_Sint16FnfnSint16;
AG_Uint32FnfnUint32;
AG_Sint32FnfnSint32;
#ifdef AG_HAVE_64BIT
-Uint64 (*fnUint64)(struct ag_event *);
-Sint64 (*fnSint64)(struct ag_event *);
AG_Uint64FnfnUint64;
AG_Sint64FnfnSint64;
#endif
-float (*fnFloat)(struct ag_event *);
-double (*fnDouble)(struct ag_event *);
AG_FloatFnfnFloat;
AG_DoubleFnfnDouble;
#ifdef AG_HAVE_LONG_DOUBLE
-long double (*fnLongDouble)(struct ag_event *);
AG_LongDoubleFnfnLongDouble;
#endif
-size_t (*fnString)(struct ag_event *, char *, size_t);
-void *(*fnPointer)(struct ag_event *);
-const void *(*fnConstPointer)(struct ag_event *);
-AG_Text *(*fnText)(struct ag_event *);
AG_StringFnfnString;
AG_PointerFnfnPointer;
AG_ConstPointerFn fnConstPointer;
AG_TextFnfnText;
};
union ag_variable_data {
< at >< at > -146,7 146,7 < at >< at >
struct ag_variable *var;
} ref;
} info;
-union ag_variable_fn fn;/* Eval function */
union ag_function fn;/* Eval function */
union ag_variable_data data;/* Variable-stored data */
AG_TAILQ_ENTRY(ag_variable) vars;
} AG_Variable;
[Less]
|
Posted
over 9 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-10 03:33:59 -0400 (Thu, 10 Sep 2015)
New Revision: 9815
Modified:
trunk/core/AG_Event.3
trunk/core/event.c
trunk/core/event.h
Log:
- add typed virtual function constructors: AG_Set<Type>Fn().
- better
... [More]
handling of anonymous event handlers: instead of using generated
names, let object implementations refer to the AG_Event * pointer.
introduce AG_PostEventByPtr() variant.
Modified: trunk/core/AG_Event.3
===================================================================
--- trunk/core/AG_Event.32015-09-10 07:22:51 UTC (rev 9814)
trunk/core/AG_Event.32015-09-10 07:33:59 UTC (rev 9815)
< at >< at > -1,4 1,4 < at >< at >
-.\" Copyright (c) 2002-2014 Hypertriton, Inc. <http://hypertriton.com/>
.\" Copyright (c) 2002-2015 Hypertriton, Inc. <http://hypertriton.com/>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
< at >< at > -79,6 79,57 < at >< at >
.Ft "AG_Event *"
.Fn AG_AddEvent "AG_Object *obj" "const char *event_name" "void (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetVoidFn "AG_Object *obj" "void (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetIntFn "AG_Object *obj" "int (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetUint8Fn "AG_Object *obj" "Uint8 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetSint8Fn "AG_Object *obj" "Sint8 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetUint16Fn "AG_Object *obj" "Uint16 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetSint16Fn "AG_Object *obj" "Sint16 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetUint32Fn "AG_Object *obj" "Uint32 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetSint32Fn "AG_Object *obj" "Sint32 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetUint64Fn "AG_Object *obj" "Uint64 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetSint64Fn "AG_Object *obj" "Sint64 (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetFloatFn "AG_Object *obj" "float (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetDoubleFn "AG_Object *obj" "double (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetLongDoubleFn "AG_Object *obj" "long double (*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetStringFn "AG_Object *obj" "size_t (*fn)(AG_Event *event, char *buf, size_f buf_size)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetPointerFn "AG_Object *obj" "void *(*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetConstPointerFn "AG_Object *obj" "const void *(*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Function *"
.Fn AG_SetTextFn "AG_Object *obj" "AG_Text *(*fn)(AG_Event *event)" "const char *fnArgs" "..."
.Pp
.Ft "AG_Event *"
.Fn AG_FindEventHandler "AG_Object *obj" "const char *name"
.Pp
< at >< at > -89,6 140,9 < at >< at >
.Fn AG_PostEvent "AG_Object *sndr" "AG_Object *rcvr" "const char *event_name" "const char *fmt" "..."
.Pp
.Ft "int"
.Fn AG_PostEventByPtr "AG_Object *sndr" "AG_Object *rcvr" "AG_Event *event" "const char *fmt" "..."
.Pp
.Ft "int"
.Fn AG_SchedEvent "AG_Object *sndr" "AG_Object *rcvr" "Uint32 ticks" "const char *event_name" "const char *fmt" "..."
.Pp
.Ft "void"
< at >< at > -115,25 169,27 < at >< at >
.Sx EVENT ARGUMENTS
below for details.
.Pp
-In some circumstances it is useful to pass a NULL
-.Fa name
-argument to
-.Fn AG_SetEvent
-or
-.Fn AG_AddEvent
-and instead reference the event handler using the returned
-.Ft "AG_Event *"
-pointer returned by the function.
-This is useful when implementing custom interfaces accepting
-.Fa fnArgs
-style arguments.
The
.Fn AG_Set<TYPE>Fn
family of functions create a virtual function with a return value of the
specified TYPE.
By default, virtual functions are unnamed (and referenced by the returned
.Fn AG_Function
handle).
Names can still be assigned to virtual functions by setting the
.Va name
field.
Since event handlers and virtual functions are implemented
identically, the
.Fn AG_Function
type is just an alias for
.Fn AG_Event .
.Pp
The
.Fn AG_FindEventHandler
-function returns the
function searches for an event handler by name, returning a pointer to the
.Nm
-structure for the specified event, or NULL if there are no handlers associated
-with it.
element on success or NULL if there is no match.
.Pp
The
.Fn AG_UnsetEvent
< at >< at > -168,6 224,12 < at >< at >
registered event handler for the specified event.
.Pp
The
.Fn AG_PostEventByPtr
variant accepts a pointer to an
.Nm
element, as opposed to looking up the event handler by name.
.Pp
The
.Fn AG_SchedEvent
function provides an interface similar to
.Fn AG_PostEvent ,
Modified: trunk/core/event.c
===================================================================
--- trunk/core/event.c2015-09-10 07:22:51 UTC (rev 9814)
trunk/core/event.c2015-09-10 07:33:59 UTC (rev 9815)
< at >< at > -1,5 1,5 < at >< at >
/*
- * Copyright (c) 2001-2013 Hypertriton, Inc. <http://hypertriton.com/>
* Copyright (c) 2001-2015 Hypertriton, Inc. <http://hypertriton.com/>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
< at >< at > -24,7 24,8 < at >< at >
*/
/*
- * Implementation of the generic event system for AG_Object.
* Implementation of AG_Object events / virtual functions, as well as
* the generic AG_EventLoop(3) interface.
*/
#include <agar/core/core.h>
< at >< at > -35,7 36,7 < at >< at >
#include <agar/config/have_kqueue.h>
#include <agar/config/have_timerfd.h>
#include <agar/config/have_select.h>
-#include <agar/config/ag_objdebug.h>
#include <agar/config/ag_debug_core.h>
#if defined(HAVE_KQUEUE)
# ifdef __NetBSD__
< at >< at > -83,26 84,6 < at >< at >
# define AG_EV_SET(kevp,a,b,c,d,e,f) EV_SET((kevp),(a),(b),(c),(d),(e),(f))
#endif
-/* Generate a unique event handler name. */
-static void
-GenEventName(AG_Event *ev, AG_Object *ob, const char *name)
-{
-AG_Event *evOther;
-int i = ob->nevents;
-
-for (;;) {
-ev->name[0] = '_';
-StrlcpyUint(&ev->name[1], i , sizeof(ev->name));
-
-TAILQ_FOREACH(evOther, &ob->events, events) {
-if (strcmp(evOther->name, ev->name) == 0)
-break;
-}
-if (evOther == NULL)
-break;
-}
-}
-
/* Initialize a pointer argument. */
static __inline__ void
InitPointerArg(AG_Variable *V, void *p)
< at >< at > -120,7 101,7 < at >< at >
ev->flags = 0;
ev->argc = 1;
ev->argc0 = 1;
-ev->handler = NULL;
ev->fn.fnVoid = NULL;
InitPointerArg(&ev->argv[0], ob);
}
< at >< at > -140,7 121,10 < at >< at >
ev->argc0 = ev->argc;
}
-/* Set (or change) the event handler function for the named event. */
/*
* Configure an event handler routine for a given event.
* If a handler routine already exists, replace it.
*/
AG_Event *
AG_SetEvent(void *p, const char *name, AG_EventFn fn, const char *fmt, ....)
{
< at >< at > -162,16 146,15 < at >< at >
if (name != NULL) {
Strlcpy(ev->name, name, sizeof(ev->name));
} else {
-GenEventName(ev, ob, name);
ev->name[0] = '\0';
}
TAILQ_INSERT_TAIL(&ob->events, ev, events);
-ob->nevents ;
-} else {/* Preserve flags */
} else {
ev->argc = 1;
ev->argc0 = 1;
}
InitPointerArg(&ev->argv[0], ob);
-ev->handler = fn;
ev->fn.fnVoid = fn;
AG_EVENT_GET_ARGS(ev, fmt);
ev->argc0 = ev->argc;
< at >< at > -179,7 162,10 < at >< at >
return (ev);
}
-/* Append an event handler function for the named event. */
/*
* Configure an event handler routine for a given event.
* If a handler routine already exists, don't replace it.
*/
AG_Event *
AG_AddEvent(void *p, const char *name, AG_EventFn fn, const char *fmt, ....)
{
< at >< at > -201,21 187,64 < at >< at >
}
Strlcpy(ev->name, name, sizeof(ev->name));
} else {
-GenEventName(ev, ob, name);
ev->name[0] = '\0';
}
-ev->handler = fn;
ev->fn.fnVoid = fn;
AG_EVENT_GET_ARGS(ev, fmt);
ev->argc0 = ev->argc;
TAILQ_INSERT_TAIL(&ob->events, ev, events);
-ob->nevents ;
-
AG_ObjectUnlock(ob);
return (ev);
}
-/* Remove the named event handler. */
/*
* Anonymous Function Constructors
*/
#undef AG_SET_TYPED_FN
#define AG_SET_TYPED_FN(memb)\
AG_Object *ob = p;\
AG_Event *ev;\
\
ev = Malloc(sizeof(AG_Event));\
InitEvent(ev, ob);\
ev->name[0] = '\0';\
ev->fn.memb = fn;\
InitPointerArg(&ev->argv[0], ob);\
AG_EVENT_GET_ARGS(ev, fmt);\
\
AG_ObjectLock(ob);\
TAILQ_INSERT_TAIL(&ob->events, ev, events);\
ev->argc0 = ev->argc;\
AG_ObjectUnlock(ob);\
return (AG_Function *)ev
AG_Function *AG_SetVoidFn(void *p, AG_VoidFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnVoid);}
AG_Function *AG_SetIntFn(void *p, AG_IntFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnInt);}
AG_Function *AG_SetUint8Fn(void *p, AG_Uint8Fn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnUint8);}
AG_Function *AG_SetSint8Fn(void *p, AG_Sint8Fn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnSint8);}
AG_Function *AG_SetUint16Fn(void *p, AG_Uint16Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnUint16);}
AG_Function *AG_SetSint16Fn(void *p, AG_Sint16Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnSint16);}
AG_Function *AG_SetUint32Fn(void *p, AG_Uint32Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnUint32);}
AG_Function *AG_SetSint32Fn(void *p, AG_Sint32Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnSint32);}
#ifdef AG_HAVE_64BIT
AG_Function *AG_SetUint64Fn(void *p, AG_Uint64Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnUint64);}
AG_Function *AG_SetSint64Fn(void *p, AG_Sint64Fn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnSint64);}
#endif
AG_Function *AG_SetFloatFn(void *p, AG_FloatFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnFloat);}
AG_Function *AG_SetDoubleFn(void *p, AG_DoubleFn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnDouble);}
#ifdef AG_HAVE_LONG_DOUBLE
AG_Function *AG_SetLongDoubleFn(void *p, AG_LongDoubleFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnLongDouble); }
#endif
AG_Function *AG_SetStringFn(void *p, AG_StringFn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnString);}
AG_Function *AG_SetPointerFn(void *p, AG_PointerFn fn, const char *fmt, ....){ AG_SET_TYPED_FN(fnPointer);}
AG_Function *AG_SetConstPointerFn(void *p, AG_ConstPointerFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnConstPointer); }
AG_Function *AG_SetTextFn(void *p, AG_TextFn fn, const char *fmt, ...){ AG_SET_TYPED_FN(fnText);}
#undef AG_SET_TYPED_FN
/* Delete an event handler by name. */
void
AG_UnsetEvent(void *p, const char *name)
{
< at >< at > -231,13 260,12 < at >< at >
goto out;
}
TAILQ_REMOVE(&ob->events, ev, events);
-ob->nevents--;
-Free(ev);
free(ev);
out:
AG_ObjectUnlock(ob);
}
-/* Return the Event structure for the named event. */
/* Look up an AG_Event by name. */
AG_Event *
AG_FindEventHandler(void *p, const char *name)
{
< at >< at > -274,10 302,9 < at >< at >
char *eventName = AG_STRING(2);
AG_Event *ev;
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
-Debug(ob, "Event <%s> timeout (%u ticks)\n", eventName,
- (Uint)to->ival);
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(ob, "Event <%s> timeout (%u ticks)\n", eventName, (Uint)to->ival);
#endif
TAILQ_FOREACH(ev, &ob->events, events) {
if (strcmp(eventName, ev->name) == 0)
< at >< at > -291,8 318,8 < at >< at >
/* Propagate event to children. */
if (ev->flags & AG_EVENT_PROPAGATE) {
AG_Object *child;
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(ob, "Propagate <%s> (timeout)\n", ev->name);
#endif
AG_LockVFS(ob);
< at >< at > -303,8 330,8 < at >< at >
}
/* Invoke the event handler routine. */
-if (ev->handler != NULL) {
-ev->handler(ev);
if (ev->fn.fnVoid != NULL) {
ev->fn.fnVoid(ev);
}
return (0);
}
< at >< at > -320,8 347,8 < at >< at >
AG_Object *chld;
if (eev->flags & AG_EVENT_PROPAGATE) {
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Propagate <%s> (async)\n", eev->name);
#endif
AG_LockVFS(rcvr);
< at >< at > -330,18 357,18 < at >< at >
}
AG_UnlockVFS(rcvr);
}
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "BEGIN event thread for <%s>\n", eev->name);
#endif
-if (eev->handler != NULL) {
-eev->handler(eev);
if (eev->fn.fnVoid != NULL) {
eev->fn.fnVoid(eev);
}
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "CLOSE event thread for <%s>\n", eev->name);
#endif
-Free(eev);
free(eev);
return (NULL);
}
#endif /* AG_THREADS */
< at >< at > -392,10 419,9 < at >< at >
AG_Object *chld;
int propagated = 0;
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
-Debug(rcvr, "Event <%s> posted from %s\n", evname,
- sndr?sndr->name:"NULL");
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Event <%s> posted from %s\n", evname, sndr ? sndr->name : "NULL");
#endif
AG_ObjectLock(rcvr);
TAILQ_FOREACH(ev, &rcvr->events, events) {
< at >< at > -406,7 432,6 < at >< at >
AG_Thread th;
AG_Event *evNew;
-/* TODO allocate from an per-object pool */
evNew = Malloc(sizeof(AG_Event));
memcpy(evNew, ev, sizeof(AG_Event));
AG_EVENT_GET_ARGS(evNew, fmt);
< at >< at > -425,10 450,9 < at >< at >
AG_EVENT_GET_ARGS(&tmpev, fmt);
InitPointerArg(&tmpev.argv[tmpev.argc], sndr);
if ((tmpev.flags & AG_EVENT_PROPAGATE) && !propagated) {
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
-Debug(rcvr, "Propagate <%s> (post)\n",
- evname);
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Propagate <%s>\n", evname);
#endif
AG_LockVFS(rcvr);
OBJECT_FOREACH_CHILD(chld, rcvr, ag_object) {
< at >< at > -437,8 461,8 < at >< at >
AG_UnlockVFS(rcvr);
propagated = 1;
}
-if (tmpev.handler != NULL)
-tmpev.handler(&tmpev);
if (tmpev.fn.fnVoid != NULL)
tmpev.fn.fnVoid(&tmpev);
}
}
AG_ObjectUnlock(rcvr);
< at >< at > -445,6 469,63 < at >< at >
}
/*
* Variant of AG_PostEvent() which accepts an AG_Event argument instead
* of looking up the event handler by name.
*/
void
AG_PostEventByPtr(void *sp, void *rp, AG_Event *ev, const char *fmt, ...)
{
AG_Object *sndr = sp;
AG_Object *rcvr = rp;
AG_Object *chld;
int propagated = 0;
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Event %p posted from %s\n", ev, sndr ? sndr->name : "NULL");
#endif
AG_ObjectLock(rcvr);
#ifdef AG_THREADS
if (ev->flags & AG_EVENT_ASYNC) {
AG_Thread th;
AG_Event *evNew;
evNew = Malloc(sizeof(AG_Event));
memcpy(evNew, ev, sizeof(AG_Event));
AG_EVENT_GET_ARGS(evNew, fmt);
InitPointerArg(&evNew->argv[evNew->argc], sndr);
if (evNew->flags & AG_EVENT_PROPAGATE) { propagated = 1; }
if (propagated) {
evNew->flags &= ~(AG_EVENT_PROPAGATE);
}
AG_ThreadCreate(&th, EventThread, evNew);
} else
#endif /* AG_THREADS */
{
AG_Event evTmp;
memcpy(&evTmp, ev, sizeof(AG_Event));
AG_EVENT_GET_ARGS(&evTmp, fmt);
InitPointerArg(&evTmp.argv[evTmp.argc], sndr);
if ((evTmp.flags & AG_EVENT_PROPAGATE) && !propagated) {
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Propagate event %p (post)\n", ev);
#endif
AG_LockVFS(rcvr);
OBJECT_FOREACH_CHILD(chld, rcvr, ag_object) {
PropagateEvent(rcvr, chld, &evTmp);
}
AG_UnlockVFS(rcvr);
propagated = 1;
}
if (evTmp.fn.fnVoid != NULL)
evTmp.fn.fnVoid(&evTmp);
}
AG_ObjectUnlock(rcvr);
}
/*
* Schedule the execution of the named event in the given number
* of AG_Time(3) ticks.
*
< at >< at > -501,10 582,9 < at >< at >
AG_Object *chld;
AG_Event *ev;
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
-Debug(rcvr, "Event <%s> forwarded from %s\n", event->name,
- sndr?sndr->name:"NULL");
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Event <%s> forwarded from %s\n", event->name, sndr ? sndr->name : "NULL");
#endif
AG_ObjectLock(rcvr);
TAILQ_FOREACH(ev, &rcvr->events, events) {
< at >< at > -515,7 595,6 < at >< at >
AG_Thread th;
AG_Event *evNew;
-/* TODO allocate from an per-object pool */
evNew = Malloc(sizeof(AG_Event));
memcpy(evNew, ev, sizeof(AG_Event));
InitPointerArg(&evNew->argv[0], rcvr);
< at >< at > -531,10 610,9 < at >< at >
InitPointerArg(&tmpev.argv[tmpev.argc], sndr);
if (ev->flags & AG_EVENT_PROPAGATE) {
-#ifdef AG_OBJDEBUG
-if (agDebugLvl >= 5)
-Debug(rcvr, "Propagate <%s> (forward)\n",
- event->name);
#ifdef AG_DEBUG_CORE
if (agDebugLvl >= 2)
Debug(rcvr, "Propagate <%s> (forward)\n", event->name);
#endif
AG_LockVFS(rcvr);
OBJECT_FOREACH_CHILD(chld, rcvr, ag_object) {
< at >< at > -543,8 621,8 < at >< at >
AG_UnlockVFS(rcvr);
}
/* XXX AG_EVENT_ASYNC.. */
-if (ev->handler != NULL)
-ev->handler(&tmpev);
if (ev->fn.fnVoid != NULL)
ev->fn.fnVoid(&tmpev);
}
}
AG_ObjectUnlock(rcvr);
< at >< at > -1244,7 1322,7 < at >< at >
its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = 0L;
if (timerfd_settime(to->id, 0, &its, NULL) == -1) {
-Verbose("timerfd_settime: %s", AG_Strerror(errno));
Verbose("timerfd_settime: %s\n", AG_Strerror(errno));
FD_CLR(to->id, &rdFds);
AG_DelTimer(ob, to);
}
Modified: trunk/core/event.h
===================================================================
--- trunk/core/event.h2015-09-10 07:22:51 UTC (rev 9814)
trunk/core/event.h2015-09-10 07:33:59 UTC (rev 9815)
< at >< at > -43,18 43,17 < at >< at >
struct ag_timer;
struct ag_event_sink;
-/* Event structure */
/* Event handler / virtual function */
typedef struct ag_event {
char name[AG_EVENT_NAME_MAX];/* String identifier */
Uint flags;
#defineAG_EVENT_ASYNC 0x01/* Service in separate thread */
#define AG_EVENT_PROPAGATE 0x02/* Forward to child objs */
-void (*handler)(struct ag_event *);
-int argc;/* Argument count */
-int argc0;/* Arg. count (by SetEvent) */
union ag_function fn;/* Callback function */
int argc, argc0;/* Argument count & offset */
AG_Variable argv[AG_EVENT_ARGS_MAX];/* Argument values */
AG_TAILQ_ENTRY(ag_event) events;/* Entry in Object */
-} AG_Event;
} AG_Event, AG_Function;
/* Low-level event sink */
enum ag_event_sink_type {
< at >< at > -249,10 248,36 < at >< at >
void AG_DestroyEventSubsystem(void);
void AG_EventInit(AG_Event *);
void AG_EventArgs(AG_Event *, const char *, ...);
AG_Event *AG_SetEvent(void *, const char *, AG_EventFn, const char *, ....);
AG_Event *AG_AddEvent(void *, const char *, AG_EventFn, const char *, ....);
AG_Function *AG_SetVoidFn(void *, AG_VoidFn, const char *, ...);
AG_Function *AG_SetIntFn(void *, AG_IntFn, const char *, ...);
AG_Function *AG_SetUintFn(void *, AG_UintFn, const char *, ...);
AG_Function *AG_SetUint8Fn(void *, AG_Uint8Fn, const char *, ...);
AG_Function *AG_SetSint8Fn(void *, AG_Sint8Fn, const char *, ...);
AG_Function *AG_SetUint16Fn(void *, AG_Uint16Fn, const char *, ...);
AG_Function *AG_SetSint16Fn(void *, AG_Sint16Fn, const char *, ...);
AG_Function *AG_SetUint32Fn(void *, AG_Uint32Fn, const char *, ...);
AG_Function *AG_SetSint32Fn(void *, AG_Sint32Fn, const char *, ...);
#ifdef AG_HAVE_64BIT
AG_Function *AG_SetUint64Fn(void *, AG_Uint64Fn, const char *, ...);
AG_Function *AG_SetSint64Fn(void *, AG_Sint64Fn, const char *, ...);
#endif
AG_Function *AG_SetFloatFn(void *, AG_FloatFn, const char *, ...);
AG_Function *AG_SetDoubleFn(void *, AG_DoubleFn, const char *, ...);
#ifdef AG_HAVE_LONG_DOUBLE
AG_Function *AG_SetLongDoubleFn(void *, AG_LongDoubleFn, const char *, ....);
#endif
AG_Function *AG_SetStringFn(void *, AG_StringFn, const char *, ...);
AG_Function *AG_SetPointerFn(void *, AG_PointerFn, const char *, ...);
AG_Function *AG_SetConstPointerFn(void *, AG_ConstPointerFn, const char *, ...);
AG_Function *AG_SetTextFn(void *, AG_TextFn, const char *, ...);
void AG_UnsetEvent(void *, const char *);
void AG_PostEvent(void *, void *, const char *, const char *, ...);
void AG_PostEventByPtr(void *, void *, AG_Event *, const char *, ....);
AG_Event *AG_FindEventHandler(void *, const char *);
void AG_InitEventQ(AG_EventQ *);
< at >< at > -288,14 313,6 < at >< at >
int AG_EventSinkSELECT(void);
int AG_EventSinkSPINNER(void);
-/* Execute an event handler routine without processing any arguments. */
-static __inline__ void
-AG_ExecEventFn(void *obj, AG_Event *ev)
-{
-if (ev->handler != NULL)
-AG_PostEvent(NULL, obj, ev->name, NULL);
-}
-
/* Push arguments onto an Event structure. */
static __inline__ void AG_EventPushPointer(AG_Event *ev, const char *key, void *val) { AG_EVENT_INS_VAL(ev, AG_VARIABLE_POINTER, key, p, val); }
static __inline__ void AG_EventPushString(AG_Event *ev, const char *key, char *val) { AG_EVENT_INS_VAL(ev, AG_VARIABLE_STRING, key, s, val); }
[Less]
|
Posted
over 9 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-10 03:22:51 -0400 (Thu, 10 Sep 2015)
New Revision: 9814
Modified:
trunk/tests/agartest.c
Log:
- handle non line-buffered Console callbacks.
- properly detach console on shutdown.
Modified: trunk/tests/agartest.c
... [More]
===================================================================
--- trunk/tests/agartest.c2015-09-07 03:12:52 UTC (rev 9813)
+++ trunk/tests/agartest.c2015-09-10 07:22:51 UTC (rev 9814)
< at >< at > -97,6 +97,7 < at >< at >
AG_Label *status;
AG_Console *console = NULL;
AG_Button *btnTest, *btnBench;
+char consoleBuf[2048];
static void
SelectedTest(AG_Event *event)
< at >< at > -442,22 +443,34 < at >< at >
}
#endif
+/* Redirect AG_Debug() and AG_Verbose() to the AG_Console. */
static int
-VerboseCallback(const char *msg)
+ConsoleWrite(const char *msg)
{
-if (console != NULL) {
-AG_ConsoleMsgS(console, msg);
+if (console == NULL) {
+return (0);
}
+AG_Strlcat(consoleBuf, msg, sizeof(consoleBuf));
+if (strchr(msg, '\n') != NULL) {
+char *line, *pBuf = consoleBuf;
+
+while ((line = AG_Strsep(&pBuf, "\n")) != NULL) {
+if (line[0] == '\0') {
+continue;
+}
+AG_ConsoleMsgS(console, line);
+}
+consoleBuf[0] = '\0';
+}
return (1);
}
-static int
-DebugCallback(const char *msg)
+static void
+ConsoleWindowDetached(AG_Event *event)
{
-if (console != NULL) {
-AG_ConsoleMsgS(console, msg);
-}
-return (1);
+AG_SetVerboseCallback(NULL);
+AG_SetDebugCallback(NULL);
+console = NULL;
}
int
< at >< at > -504,8 +517,9 < at >< at >
}
/* Redirect AG_Verbose() and AG_Debug() output to the AG_Console. */
-AG_SetVerboseCallback(VerboseCallback);
-AG_SetDebugCallback(DebugCallback);
+consoleBuf[0] = '\0';
+AG_SetVerboseCallback(ConsoleWrite);
+AG_SetDebugCallback(ConsoleWrite);
/* Set up the standard shortcuts + debugger and screenshot functions */
AG_BindStdGlobalKeys();
< at >< at > -598,8 +612,10 < at >< at >
statusBar = AG_StatusbarNew(win, AG_STATUSBAR_HFILL);
status = AG_StatusbarAddLabel(statusBar, _("Please select a test"));
+
+AG_SetEvent(win, "window-detached", ConsoleWindowDetached, NULL);
-AG_WindowSetGeometryAlignedPct(win, AG_WINDOW_MC, 50, 50);
+AG_WindowSetGeometryAligned(win, AG_WINDOW_MC, 800, 300);
AG_WindowShow(win);
for (i = optInd; i < argc; i++) {
[Less]
|
Posted
almost 10 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-06 23:12:52 -0400 (Sun, 06 Sep 2015)
New Revision: 9813
Modified:
trunk/tools/bundlecss/bundlecss.c
Log:
bundle using string representation and minify
Modified: trunk/tools/bundlecss/bundlecss.c
... [More]
===================================================================
--- trunk/tools/bundlecss/bundlecss.c2015-09-02 01:41:10 UTC (rev 9812)
trunk/tools/bundlecss/bundlecss.c2015-09-07 03:12:52 UTC (rev 9813)
< at >< at > -46,10 46,11 < at >< at >
const char *outfile, *cssName = "myCSS", *infile;
extern char *optarg;
extern int optind;
-int c, cnt;
int c;
FILE *f, *fin;
-long i, size;
long i, sizeIn, sizeOut, offs, inComment = 0;
int append = 0;
char ch;
while ((c = getopt(argc, argv, "?ao:n:")) != -1) {
switch (c) {
< at >< at > -89,28 90,47 < at >< at >
}
fseek(fin, 0, SEEK_END);
-size = ftell(fin);
sizeIn = ftell(fin);
fseek(fin, 0, SEEK_SET);
-fprintf(f, "/* File generated by bundlecss */\n");
fprintf(f, "/* File generated by agar bundlecss */\n");
-fprintf(f, "const Uint8 %s_Data[%ld] = {\n", cssName, size);
-for (i = 0, cnt = 0; i < size; i ) {
-unsigned char d;
-
-fread(&d, 1, 1, fin);
-fprintf(f, "%d,", d);
-if ( cnt > 10000) {
-fprintf(f, "\n");
-cnt = 0;
fprintf(f, "const char *%s_Data = \n\t\"", cssName);
for (i = 0, offs = 0, sizeOut = 0;
i < sizeIn;
i ) {
fread(&ch, 1, 1, fin);
if (offs == 0 && ch == '#') {
inComment = 1;
} else if (ch == '\n') {
if (!inComment && offs > 0) {
fputs("\\n\"\n\t\"", f);
sizeOut ;
}
offs = 0;
inComment = 0;
continue;
}
if (inComment || (ch == '\t' && offs == 0)) {
offs ;
continue;
}
if (ch == '"') {
fputs("\\\"", f);
sizeOut =2;
} else {
fputc(ch, f);
sizeOut ;
}
offs ;
}
-fprintf(f, "};\n");
fprintf(f, "\";\n\n");
fprintf(f, "AG_StaticCSS %s = {\n", cssName);
-fprintf(f, "\"%s\",\n", cssName);
-fprintf(f, "%ld,\n", size);
-fprintf(f, "%s_Data,\n", cssName);
-fprintf(f, "};\n");
fprintf(f, "\t\"%s\",\n", cssName);
fprintf(f, "\t%ld,\n", sizeOut);
fprintf(f, "\t&%s_Data,\n", cssName);
fprintf(f, "\tNULL\n};\n");
fclose(f);
fclose(fin);
[Less]
|
Posted
almost 10 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-01 06:43:20 -0400 (Tue, 01 Sep 2015)
New Revision: 9811
Modified:
trunk/dev/browser.c
trunk/dev/object.c
trunk/tests/agartest.c
trunk/tests/math.c
Log:
plug more memleaks in test suite
Modified:
... [More]
trunk/dev/browser.c
===================================================================
--- trunk/dev/browser.c2015-09-01 10:43:00 UTC (rev 9810)
trunk/dev/browser.c2015-09-01 10:43:20 UTC (rev 9811)
< at >< at > -543,7 543,7 < at >< at >
if (OBJECT_RESIDENT(pob)) {
Strlcat(label, _(" (resident)"), sizeof(label));
}
-it = AG_TlistAddPtr(tl, AG_ObjectIcon(pob), label, pob);
it = AG_TlistAddPtr(tl, NULL, label, pob);
it->depth = depth;
it->cat = "object";
Modified: trunk/dev/object.c
===================================================================
--- trunk/dev/object.c2015-09-01 10:43:00 UTC (rev 9810)
trunk/dev/object.c2015-09-01 10:43:20 UTC (rev 9811)
< at >< at > -82,7 82,7 < at >< at >
Snprintf(label, sizeof(label), "%s (%u)", path,
(Uint)dep->count);
}
-AG_TlistAddPtr(tl, AG_ObjectIcon(dep->obj), label, dep);
AG_TlistAddPtr(tl, NULL, label, dep);
}
AG_UnlockVFS(ob);
AG_TlistRestore(tl);
Modified: trunk/tests/agartest.c
===================================================================
--- trunk/tests/agartest.c2015-09-01 10:43:00 UTC (rev 9810)
trunk/tests/agartest.c2015-09-01 10:43:20 UTC (rev 9811)
< at >< at > -126,9 126,9 < at >< at >
if (ti->tc->bench(ti) == 0) {
AG_ConsoleMsg(console, _("%s: Success"), ti->tc->name);
} else {
-AG_ConsoleMsg(console, _("%s: Failed (%s)"), ti->tc->name,
- AG_GetError());
AG_ConsoleMsg(console, _("%s: Failed (%s)"), ti->tc->name, AG_GetError());
}
free(ti);
return (NULL);
}
#endif
< at >< at > -244,11 244,13 < at >< at >
AG_ObjectDetach(win);
goto fail;
}
TAILQ_INSERT_TAIL(&tests, ti, instances);
} else {
free(ti);
}
-TAILQ_INSERT_TAIL(&tests, ti, instances);
return;
fail:
-Free(ti);
free(ti);
}
static void
< at >< at > -267,21 269,18 < at >< at >
{
#ifdef AG_THREADS
AG_Thread th;
AG_ThreadCreate(&th, RunBenchmarks, ti);
#else
if (tc->bench(ti) == 0) {
AG_ConsoleMsg(console, _("%s: Success"), tc->name);
} else {
-AG_ConsoleMsg(console, _("%s: Failed (%s)"), tc->name,
- AG_GetError());
AG_ConsoleMsg(console, _("%s: Failed (%s)"), tc->name, AG_GetError());
AG_LabelTextS(status, AG_GetError());
-free(ti);
-return;
}
free(ti);
#endif
}
-TAILQ_INSERT_TAIL(&tests, ti, instances);
-return;
}
static void
< at >< at > -303,8 302,8 < at >< at >
AG_TestInstance *ti = AG_PTR(1);
AG_ConsoleMsg(console, _("Test %s: terminated"), ti->name);
AG_SetEvent(ti->win, "window-detached", TestWindowDetached, "%p", ti);
AG_ObjectDetach(ti->win);
-AG_SetEvent(ti->win, "window-detached", TestWindowDetached, "%p", ti);
}
/* Write a message to the test console (format string). */
Modified: trunk/tests/math.c
===================================================================
--- trunk/tests/math.c2015-09-01 10:43:00 UTC (rev 9810)
trunk/tests/math.c2015-09-01 10:43:20 UTC (rev 9811)
< at >< at > -187,8 187,8 < at >< at >
M_VecFree(a);M_VecFree(b);
M_VecFree(a2);M_VecFree(b2);
M_VecFree(AplusB);M_VecFree(AsubB);
M_VecFree(aNorm);M_VecFree(bNorm);
-M_VecFree(AplusB);
M_VecFree(aLERP);
M_VecFree(aPow2);
}
[Less]
|
Posted
almost 10 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-01 06:43:00 -0400 (Tue, 01 Sep 2015)
New Revision: 9810
Modified:
trunk/math/m_vector_fpu.h
Log:
fix memleak in M_VectorDistance_FPU()
Modified: trunk/math/m_vector_fpu.h
... [More]
===================================================================
--- trunk/math/m_vector_fpu.h2015-09-01 10:42:22 UTC (rev 9809)
+++ trunk/math/m_vector_fpu.h2015-09-01 10:43:00 UTC (rev 9810)
< at >< at > -175,7 +175,11 < at >< at >
static __inline__ M_Real
M_VectorDistance_FPU(const M_Vector *a, const M_Vector *b)
{
-return M_VectorLen_FPU( M_VectorSub_FPU(a,b) );
+M_Real len;
+M_Vector *d = M_VectorSub_FPU(a,b);
+len = M_VectorLen_FPU(d);
+M_VectorFree_FPU(d);
+return (len);
}
static __inline__ M_Vector *
[Less]
|
Posted
almost 10 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-01 06:42:22 -0400 (Tue, 01 Sep 2015)
New Revision: 9809
Modified:
trunk/gui/global_keys.c
trunk/gui/gui.c
trunk/gui/iconmgr.c
trunk/gui/iconmgr.h
trunk/gui/icons_data.h
trunk/gui/objsel.c
... [More]
trunk/gui/stylesheet.c
trunk/gui/ttf.c
Log:
- unregister all GUI-specific agConfig options in GUI shutdown.
- fix memleaks: CSS elements, agDefaultCSS, &agInputDevices, &agDrivers,
static icons (agIcon), AppMenu.
fix memleaks: globalkeys
Modified: trunk/gui/global_keys.c
===================================================================
--- trunk/gui/global_keys.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/global_keys.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -124,8 124,8 < at >< at >
SLIST_FOREACH(gk, &agGlobalKeys, gkeys) {
if (gk->keysym == keysym && gk->keymod == keymod) {
SLIST_REMOVE(&agGlobalKeys, gk, ag_global_key, gkeys);
free(gk);
AG_MutexUnlock(&agGlobalKeysLock);
-Free(gk);
return (0);
}
}
< at >< at > -145,7 145,7 < at >< at >
gk != SLIST_END(&agGlobalKeys);
gk = gkNext) {
gkNext = SLIST_NEXT(gk, gkeys);
-Free(gk);
free(gk);
}
SLIST_INIT(&agGlobalKeys);
AG_MutexUnlock(&agGlobalKeysLock);
Modified: trunk/gui/gui.c
===================================================================
--- trunk/gui/gui.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/gui.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -1,5 1,5 < at >< at >
/*
- * Copyright (c) 2009-2013 Hypertriton, Inc. <http://hypertriton.com/>
* Copyright (c) 2009-2015 Hypertriton, Inc. <http://hypertriton.com/>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
< at >< at > -84,7 84,38 < at >< at >
#include <agar/gui/icons_data.h>
#include <agar/gui/text.h>
-void *agGUIClasses[] = {
static struct {
const char *key;
int *p;
} agGUIOptions[] = {
{ "ag_kbd_delay",&agKbdDelay},
{ "ag_kbd_repeat",&agKbdRepeat},
{ "ag_mouse_dblclick_delay",&agMouseDblclickDelay},
{ "ag_mouse_spin_delay",&agMouseSpinDelay},
{ "ag_mouse_spin_interval",&agMouseSpinIval},
{ "ag_text_composition",&agTextComposition},
{ "ag_text_bidi",&agTextBidi},
{ "ag_text_cache",&agTextCache},
{ "ag_text_tab_width",&agTextTabWidth},
{ "ag_text_blink_rate",&agTextBlinkRate},
{ "ag_text_symbols",&agTextSymbols},
{ "ag_page_increment",&agPageIncrement},
{ "ag_idle_threshold",&agIdleThresh},
{ "ag_screenshot_quality",&agScreenshotQuality},
{ "ag_msg_delay",&agMsgDelay}
};
const Uint agGUIOptionCount = sizeof(agGUIOptions) / sizeof(agGUIOptions[0]);
void *agStdClasses[] = {
&agDriverClass,
&agDriverSwClass,
&agDriverMwClass,
&agInputDeviceClass,
&agMouseClass,
&agKeyboardClass,
NULL
};
void *agStdWidgets[] = {
&agWidgetClass,
&agWindowClass,
&agFontClass,
< at >< at > -174,6 205,7 < at >< at >
AG_InitGUIGlobals(void)
{
AG_Config *cfg;
void **cl;
Uint i;
if (initedGlobals > 0) {
< at >< at > -180,14 212,9 < at >< at >
return (0);
}
agGUI = 1;
-
-AG_RegisterClass(&agDriverClass);
-AG_RegisterClass(&agDriverSwClass);
-AG_RegisterClass(&agDriverMwClass);
-AG_RegisterClass(&agInputDeviceClass);
-AG_RegisterClass(&agMouseClass);
-AG_RegisterClass(&agKeyboardClass);
-
for (cl = &agStdClasses[0]; *cl != NULL; cl )
AG_RegisterClass(*cl);
for (i = 0; i < agDriverListSize; i )
AG_RegisterClass(agDriverList[i]);
< at >< at > -206,31 233,11 < at >< at >
AG_ObjectInitStatic(&agDrivers, &agObjectClass);
AG_ObjectInitStatic(&agInputDevices, &agObjectClass);
-/* Save GUI globals in agConfig. */
cfg = AG_ConfigObject();
-AG_BindInt(cfg, "ag_kbd_delay", &agKbdDelay);
-AG_BindInt(cfg, "ag_kbd_repeat", &agKbdRepeat);
-AG_BindInt(cfg, "ag_mouse_dblclick_delay", &agMouseDblclickDelay);
-AG_BindInt(cfg, "ag_mouse_spin_delay", &agMouseSpinDelay);
-AG_BindInt(cfg, "ag_mouse_spin_interval", &agMouseSpinIval);
-AG_BindInt(cfg, "ag_text_composition", &agTextComposition);
-AG_BindInt(cfg, "ag_text_bidi", &agTextBidi);
-AG_BindInt(cfg, "ag_text_cache", &agTextCache);
-AG_BindInt(cfg, "ag_text_tab_width", &agTextTabWidth);
-AG_BindInt(cfg, "ag_text_blink_rate", &agTextBlinkRate);
-AG_BindInt(cfg, "ag_text_symbols", &agTextSymbols);
-AG_BindInt(cfg, "ag_page_increment", &agPageIncrement);
-AG_BindInt(cfg, "ag_idle_threshold", &agIdleThresh);
-AG_BindInt(cfg, "ag_screenshot_quality", &agScreenshotQuality);
-AG_BindInt(cfg, "ag_msg_delay", &agMsgDelay);
for (i = 0; i < agGUIOptionCount; i )
AG_BindInt(cfg, agGUIOptions[i].key, agGUIOptions[i].p);
-/*
- * Load the default style sheet (statically compiled from
- * gui/style.css in the Agar sources).
- */
-if (AG_LoadStyleSheet(NULL, "_agStyleDefault") == NULL) {
-Verbose("_agStyleDefault: %s\n", AG_GetError());
-}
AG_LoadStyleSheet(NULL, "_agStyleDefault");
return (0);
}
< at >< at > -241,27 248,31 < at >< at >
void
AG_DestroyGUIGlobals(void)
{
AG_Config *cfg;
void **cl;
Uint i;
if (--initedGlobals > 0)
return;
-AG_PixelFormatFree(agSurfaceFmt);
-agSurfaceFmt = NULL;
AG_DestroyStyleSheet(&agDefaultCSS);
cfg = AG_ConfigObject();
for (i = 0; i < agGUIOptionCount; i )
AG_Unset(cfg, agGUIOptions[i].key);
AG_ObjectDestroy(&agInputDevices);
AG_ObjectDestroy(&agDrivers);
AG_PixelFormatFree(agSurfaceFmt); agSurfaceFmt = NULL;
AG_EditableDestroyClipboards();
AG_DestroyGlobalKeys();
-AG_EditableDestroyClipboards();
-AG_UnregisterClass(&agDriverClass);
-AG_UnregisterClass(&agDriverSwClass);
-AG_UnregisterClass(&agDriverMwClass);
-AG_UnregisterClass(&agInputDeviceClass);
-AG_UnregisterClass(&agMouseClass);
-AG_UnregisterClass(&agKeyboardClass);
-
for (i = 0; i < agDriverListSize; i )
AG_UnregisterClass(agDriverList[i]);
-
for (cl = &agStdClasses[0]; *cl != NULL; cl )
AG_UnregisterClass(*cl);
agRenderingContext = 0;
agGUI = 0;
}
< at >< at > -276,28 287,16 < at >< at >
int
AG_InitGUI(Uint flags)
{
-/*char path[AG_PATHNAME_MAX]; */
void **ops;
-/* Register the built-in widget classes. */
-for (ops = &agGUIClasses[0]; *ops != NULL; ops )
for (ops = &agStdWidgets[0]; *ops != NULL; ops ) {
AG_RegisterClass(*ops);
-
-/* Initialize the GUI subsystems. */
}
agIcon_Init();
-#if 0
-/* Try to load a color scheme from the default path. */
-AG_GetString(AG_ConfigObject(), "save-path", path, sizeof(path));
-Strlcat(path, AG_PATHSEP, sizeof(path));
-Strlcat(path, "gui-colors.acs", sizeof(path));
-(void)AG_ColorsLoad(path);
-#endif
-
-/* Initialize the font engine. */
-if (AG_InitTextSubsystem() == -1)
if (AG_InitTextSubsystem() == -1) {
return (-1);
-
-/* Initialize the Window system. */
}
AG_InitWindowSystem();
AG_InitAppMenu();
return (0);
< at >< at > -327,13 326,15 < at >< at >
agDriverOps = NULL;
AG_UnlockVFS(&agDrivers);
-/* Destroy the GUI subsystems. */
AG_DestroyAppMenu();
AG_DestroyWindowSystem();
AG_DestroyTextSubsystem();
agIcon_Destroy();
-/* Unregister the built-in widget classes. */
-for (ops = &agGUIClasses[0]; *ops != NULL; ops )
for (ops = &agStdWidgets[0]; *ops != NULL; ops )
AG_UnregisterClass(*ops);
AG_DestroyGUIGlobals();
}
/* Break out of the event loop. */
Modified: trunk/gui/iconmgr.c
===================================================================
--- trunk/gui/iconmgr.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/iconmgr.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -30,7 30,6 < at >< at >
#include <agar/core/core.h>
#include <agar/gui/gui.h>
#include <agar/gui/surface.h>
-#include <agar/gui/load_xcf.h>
#include <agar/gui/iconmgr.h>
/* Compile surfaces/textures for the given static icon. */
< at >< at > -58,10 57,9 < at >< at >
}
}
-/* Return the icon associated with an object class, if any. */
-AG_Surface *
-AG_ObjectIcon(void *p)
void
AG_FreeStaticIcon(AG_StaticIcon *icon)
{
-/* TODO */
-return (NULL);
AG_SurfaceFree(icon->s);
icon->s = NULL;
}
Modified: trunk/gui/iconmgr.h
===================================================================
--- trunk/gui/iconmgr.h2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/iconmgr.h2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -17,7 17,7 < at >< at >
__BEGIN_DECLS
void AG_InitStaticIcon(AG_StaticIcon *);
-AG_Surface *AG_ObjectIcon(void *);
void AG_FreeStaticIcon(AG_StaticIcon *);
__END_DECLS
#include <agar/gui/close.h>
Modified: trunk/gui/icons_data.h
===================================================================
--- trunk/gui/icons_data.h2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/icons_data.h2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -69,3 69,29 < at >< at >
AG_InitStaticIcon(&agIconDocImport);
AG_InitStaticIcon(&agIconWindow);
}
static __inline__ void
agIcon_Destroy(void)
{
AG_FreeStaticIcon(&agIconLeftButton);
AG_FreeStaticIcon(&agIconMidButton);
AG_FreeStaticIcon(&agIconRightButton);
AG_FreeStaticIcon(&agIconCtrlKey);
AG_FreeStaticIcon(&agIconLoad);
AG_FreeStaticIcon(&agIconSave);
AG_FreeStaticIcon(&agIconUp);
AG_FreeStaticIcon(&agIconDown);
AG_FreeStaticIcon(&agIconTrash);
AG_FreeStaticIcon(&agIconClose);
AG_FreeStaticIcon(&agIconDoc);
AG_FreeStaticIcon(&agIconSymLink);
AG_FreeStaticIcon(&agIconDirectory);
AG_FreeStaticIcon(&agIconSmallArrowRight);
AG_FreeStaticIcon(&agIconWinClose);
AG_FreeStaticIcon(&agIconWinMinimize);
AG_FreeStaticIcon(&agIconWinMaximize);
AG_FreeStaticIcon(&agIconMagnifier);
AG_FreeStaticIcon(&agIconGear);
AG_FreeStaticIcon(&agIconDocImport);
AG_FreeStaticIcon(&agIconWindow);
}
Modified: trunk/gui/objsel.c
===================================================================
--- trunk/gui/objsel.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/objsel.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -80,7 80,7 < at >< at >
}
}
-it = AG_TlistAddS(tl, AG_ObjectIcon(pob), pob->name);
it = AG_TlistAddS(tl, NULL, pob->name);
it->depth = depth;
it->cat = "object";
it->p1 = pob;
Modified: trunk/gui/stylesheet.c
===================================================================
--- trunk/gui/stylesheet.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/stylesheet.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -47,11 47,18 < at >< at >
AG_DestroyStyleSheet(AG_StyleSheet *css)
{
AG_StyleBlock *blk, *blkNext;
AG_StyleEntry *ent, *entNext;
for (blk = TAILQ_FIRST(&css->blks);
blk != TAILQ_END(&css->blks);
blk = blkNext) {
blkNext = TAILQ_NEXT(blk, blks);
for (ent = TAILQ_FIRST(&blk->ents);
ent != TAILQ_END(&blk->ents);
ent = entNext) {
entNext = TAILQ_NEXT(ent, ents);
free(ent);
}
free(blk);
}
TAILQ_INIT(&css->blks);
Modified: trunk/gui/ttf.c
===================================================================
--- trunk/gui/ttf.c2015-09-01 10:36:32 UTC (rev 9808)
trunk/gui/ttf.c2015-09-01 10:42:22 UTC (rev 9809)
< at >< at > -79,10 79,8 < at >< at >
{
glyph->stored = 0;
glyph->index = 0;
-Free(glyph->bitmap.buffer);
-glyph->bitmap.buffer = NULL;
-Free(glyph->pixmap.buffer);
-glyph->pixmap.buffer = NULL;
Free(glyph->bitmap.buffer);glyph->bitmap.buffer = NULL;
Free(glyph->pixmap.buffer);glyph->pixmap.buffer = NULL;
glyph->cached = 0;
}
[Less]
|
Posted
almost 10 years
ago
by
Agar-SVN
Author: vedge
Date: 2015-09-01 06:36:32 -0400 (Tue, 01 Sep 2015)
New Revision: 9808
Modified:
trunk/core/class.c
trunk/core/core.c
trunk/core/object.c
trunk/core/tbl.c
Log:
fix memleaks: agModuleDirs[], agUserOps, agRecursiveMutexAttr
... [More]
, agDSOLock.
Modified: trunk/core/class.c
===================================================================
--- trunk/core/class.c2015-09-01 07:32:13 UTC (rev 9807)
trunk/core/class.c2015-09-01 10:36:32 UTC (rev 9808)
< at >< at > -60,7 60,10 < at >< at >
TAILQ_INIT(&cl->sub);
}
-/* Initialize the object class description table. */
/*
* Initialize the object class description table.
* Invoked internally by AG_InitCore().
*/
void
AG_InitClassTbl(void)
{
< at >< at > -86,13 89,23 < at >< at >
AG_MutexInitRecursive(&agClassLock);
}
-/* Release the object class description table. */
/*
* Release the object class description table.
* Invoked internally by AG_Destroy().
*/
void
AG_DestroyClassTbl(void)
{
int i;
free(agNamespaceTbl); agNamespaceTbl = NULL;
agNamespaceCount = 0;
-
for (i = 0; i < agModuleDirCount; i ) { free(agModuleDirs[i]); }
free(agModuleDirs);
agModuleDirs = NULL;
agModuleDirCount = 0;
agClassTree = NULL;
AG_TblDestroy(agClassTbl);
Modified: trunk/core/core.c
===================================================================
--- trunk/core/core.c2015-09-01 07:32:13 UTC (rev 9807)
trunk/core/core.c2015-09-01 10:36:32 UTC (rev 9808)
< at >< at > -209,13 209,23 < at >< at >
AG_ObjectDestroy(agConfig);
AG_DataSourceDestroySubsystem();
-
AG_DestroyTimers();
if (agUserOps != NULL && agUserOps->destroy != NULL) {
agUserOps->destroy();
agUserOps = NULL;
}
#ifdef AG_NETWORK
AG_DestroyNetworkSubsystem();
#endif
AG_DestroyClassTbl();
#ifdef AG_THREADS
pthread_mutexattr_destroy(&agRecursiveMutexAttr);
AG_MutexDestroy(&agDSOLock);
#endif
AG_DestroyEventSubsystem();
AG_DestroyStringSubsystem();
AG_DestroyErrorSubsystem();
-AG_DestroyClassTbl();
-Free(agProgName);
Free(agProgName); agProgName = NULL;
}
void
Modified: trunk/core/object.c
===================================================================
--- trunk/core/object.c2015-09-01 07:32:13 UTC (rev 9807)
trunk/core/object.c2015-09-01 10:36:32 UTC (rev 9808)
< at >< at > -92,7 92,7 < at >< at >
if (hier[i]->init != NULL)
hier[i]->init(ob);
}
-Free(hier);
free(hier);
} else {
AG_FatalError("AG_ObjectInit: %s", AG_GetError());
}
< at >< at > -185,7 185,7 < at >< at >
if (hier[i]->reinit != NULL)
hier[i]->reinit(ob);
}
-Free(hier);
free(hier);
} else {
AG_FatalError("AG_ObjectFreeDataset: %s: %s", ob->name,
AG_GetError());
< at >< at > -656,7 656,7 < at >< at >
dep != TAILQ_END(&ob->deps);
dep = ndep) {
ndep = TAILQ_NEXT(dep, deps);
-Free(dep);
free(dep);
}
TAILQ_INIT(&ob->deps);
AG_ObjectUnlock(ob);
< at >< at > -679,7 679,7 < at >< at >
ndep = TAILQ_NEXT(dep, deps);
if (dep->count == 0) {
TAILQ_REMOVE(&ob->deps, dep, deps);
-Free(dep);
free(dep);
}
}
TAILQ_FOREACH(cob, &ob->children, cobjs) {
< at >< at > -797,7 797,7 < at >< at >
if (hier[i]->destroy != NULL)
hier[i]->destroy(ob);
}
-Free(hier);
free(hier);
} else {
AG_FatalError("%s: %s", ob->name, AG_GetError());
}
< at >< at > -808,7 808,7 < at >< at >
Free(ob->archivePath);
if ((ob->flags & AG_OBJECT_STATIC) == 0)
-Free(ob);
free(ob);
}
/*
< at >< at > -1008,8 1008,7 < at >< at >
Debug(ob, "Dependency resolves to %p (%s)\n", dep->obj,
dep->obj->name);
#endif
-Free(dep->path);
-dep->path = NULL;
free(dep->path); dep->path = NULL;
}
TAILQ_FOREACH(cob, &ob->children, cobjs) {
< at >< at > -1087,7 1086,7 < at >< at >
goto fail;
}
if ((dep->path = AG_ReadString(ds)) == NULL) {
-Free(dep);
free(dep);
goto fail;
}
dep->obj = NULL;
< at >< at > -1441,11 1440,11 < at >< at >
if (hier[i]->load(ob, ds, &ver) == -1) {
AG_SetError("<0x%x>:%s", (Uint)AG_Tell(ds),
AG_GetError());
-Free(hier);
free(hier);
goto fail;
}
}
-Free(hier);
free(hier);
AG_CloseFile(ds);
AG_PostEvent(ob, ob->root, "object-post-load-data", "%s", path);
< at >< at > -1584,11 1583,11 < at >< at >
if (hier[i]->save == NULL)
continue;
if (hier[i]->save(ob, ds) == -1) {
-Free(hier);
free(hier);
goto fail;
}
}
-Free(hier);
free(hier);
if (ob->flags & AG_OBJECT_DEBUG_DATA) {
AG_SetSourceDebug(ds, 0);
< at >< at > -1655,11 1654,11 < at >< at >
continue;
if (hier[i]->load(ob, ds, &ver) == -1) {
AG_SetError("<0x%x>:%s", (Uint)AG_Tell(ds), AG_GetError());
-Free(hier);
free(hier);
goto fail;
}
}
-Free(hier);
free(hier);
if (ob->flags & AG_OBJECT_DEBUG_DATA) {
AG_SetSourceDebug(ds, 0);
< at >< at > -1999,7 1998,7 < at >< at >
if ((dep->count-1) == 0) {
if ((ob->flags & AG_OBJECT_PRESERVE_DEPS) == 0) {
TAILQ_REMOVE(&ob->deps, dep, deps);
-Free(dep);
free(dep);
} else {
dep->count = 0;
}
Modified: trunk/core/tbl.c
===================================================================
--- trunk/core/tbl.c2015-09-01 07:32:13 UTC (rev 9807)
trunk/core/tbl.c2015-09-01 10:36:32 UTC (rev 9808)
< at >< at > -39,7 39,7 < at >< at >
return (NULL);
}
if (AG_TblInit(t, nBuckets, flags) == -1) {
-Free(t);
free(t);
return (NULL);
}
return (t);
< at >< at > -75,13 75,11 < at >< at >
AG_TblBucket *buck = &t->buckets[i];
for (j = 0; j < buck->nEnts; j ) {
-Free(buck->keys[j]);
free(buck->keys[j]);
AG_FreeVariable(&buck->ents[j]);
}
-Free(buck->keys);
-Free(buck->ents);
-buck->keys = NULL;
-buck->ents = NULL;
free(buck->keys);
free(buck->ents);
}
free(t->buckets);
}
< at >< at > -145,7 143,7 < at >< at >
}
if ((keysNew = TryRealloc(buck->keys,
(buck->nEnts 1)*sizeof(char *))) == NULL) {
-Free(entsNew);
free(entsNew);
return (-1);
}
buck->ents = entsNew;
< at >< at > -172,7 170,7 < at >< at >
return (-1);
}
-Free(buck->keys[i]);
free(buck->keys[i]);
AG_FreeVariable(&buck->ents[i]);
if (i < buck->nEnts-1) {
[Less]
|