aboutsummaryrefslogtreecommitdiff
path: root/pd/src/m_glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/m_glob.c')
-rw-r--r--pd/src/m_glob.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/pd/src/m_glob.c b/pd/src/m_glob.c
index c3a70e53..ca3b5d1a 100644
--- a/pd/src/m_glob.c
+++ b/pd/src/m_glob.c
@@ -8,6 +8,8 @@
t_class *glob_pdobject;
static t_class *maxclass;
+int sys_perf; /* true if we should query user on close and quit */
+
/* These "glob" routines, which implement messages to Pd, are from all
over. Some others are prototyped in m_imp.h as well. */
@@ -55,6 +57,11 @@ static void glob_version(t_pd *dummy, float f)
error("file format newer than this version of Pd (trying anyway...)");
}
+static void glob_perf(t_pd *dummy, float f)
+{
+ sys_perf = (f != 0);
+}
+
void max_default(t_pd *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
@@ -121,6 +128,8 @@ void glob_init(void)
gensym("save-preferences"), 0);
class_addmethod(glob_pdobject, (t_method)glob_version,
gensym("version"), A_FLOAT, 0);
+ class_addmethod(glob_pdobject, (t_method)glob_perf,
+ gensym("perf"), A_FLOAT, 0);
#ifdef UNIX
class_addmethod(glob_pdobject, (t_method)glob_watchdog,
gensym("watchdog"), 0);
@@ -128,3 +137,16 @@ void glob_init(void)
class_addanything(glob_pdobject, max_default);
pd_bind(&glob_pdobject, gensym("pd"));
}
+
+ /* function to return version number at run time. Any of the
+ calling pointers may be zero in case you don't need all of them. */
+void sys_getversion(int *major, int *minor, int *bugfix)
+{
+ if (major)
+ *major = PD_MAJOR_VERSION;
+ if (minor)
+ *minor = PD_MINOR_VERSION;
+ if (bugfix)
+ *bugfix = PD_BUGFIX_VERSION;
+}
+