Miller Puckette wrote:
I'm thinking the sys_pdexe is teh only way. I try to avoid adding junk to the Pd API but in this case I think it will be necessary.
speaking of adding things to the Pd API...
is it totally out of your ways to
- add a function that returns the version of Pd? something like "const char* pd_versionstring(void)" would be nice. this could be used to ensure that an external is running with a Pd version compatible to the one it was compiled against
- move the prototypes for using the loader-API from s_stuff.h to m_pd.h?
fmgsdr. IOhannes
On Dec 11, 2008, at 4:39 AM, IOhannes m zmoelnig wrote:
Miller Puckette wrote:
I'm thinking the sys_pdexe is teh only way. I try to avoid adding junk to the Pd API but in this case I think it will be necessary.
speaking of adding things to the Pd API...
is it totally out of your ways to
- add a function that returns the version of Pd?
something like "const char* pd_versionstring(void)" would be nice. this could be used to ensure that an external is running with a Pd version compatible to the one it was compiled against
Since the version will most likely be used for a numeric comparison, and it is stored as a number, perhaps it makes sense to return numeric types instead of a char*?
int pd_majorversion(void) int pd_minorversion(void) int pd_bugfixversion(void)
- move the prototypes for using the loader-API from s_stuff.h to
m_pd.h?
This stuff still needs to be exposed as well:
typedef int (*loader_t)(t_canvas *canvas, char *classname); EXTERN void sys_register_loader(loader_t loader);
.hc
fmgsdr. IOhannes
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------ ----
"[W]e have invented the technology to eliminate scarcity, but we are deliberately throwing it away to benefit those who profit from scarcity." -John Gilmore
Hans-Christoph Steiner wrote:
On Dec 11, 2008, at 4:39 AM, IOhannes m zmoelnig wrote:
Miller Puckette wrote:
I'm thinking the sys_pdexe is teh only way. I try to avoid adding junk to the Pd API but in this case I think it will be necessary.
speaking of adding things to the Pd API...
is it totally out of your ways to
- add a function that returns the version of Pd?
something like "const char* pd_versionstring(void)" would be nice. this could be used to ensure that an external is running with a Pd version compatible to the one it was compiled against
Since the version will most likely be used for a numeric comparison, and it is stored as a number, perhaps it makes sense to return numeric types instead of a char*?
int pd_majorversion(void) int pd_minorversion(void) int pd_bugfixversion(void)
personally i don't care so much for the details. i proposed the string as it outputs the full version number (with all "test" and whatnot). i think major/minor/bugfix-version might be the same for Pd and Pd-extended but i would like to distinguish between the two.
of course it would be best if we had all 4 versions of the version :-)
- move the prototypes for using the loader-API from s_stuff.h to m_pd.h?
This stuff still needs to be exposed as well:
typedef int (*loader_t)(t_canvas *canvas, char *classname); EXTERN void sys_register_loader(loader_t loader);
yes of course, that's what i meant. it was a quick reply without looking exactly where the missing prototypes are located right now.
mfdsft IOhannes
IOhannes m zmoelnig wrote:
Hans-Christoph Steiner wrote:
IOhannes m zmoelnig wrote:
speaking of adding things to the Pd API... is it totally out of your ways to
- add a function that returns the version of Pd?
something like "const char* pd_versionstring(void)" would be nice. this could be used to ensure that an external is running with a Pd version compatible to the one it was compiled against
Since the version will most likely be used for a numeric comparison, and it is stored as a number, perhaps it makes sense to return numeric types instead of a char*?
int pd_majorversion(void) int pd_minorversion(void) int pd_bugfixversion(void)
personally i don't care so much for the details. i proposed the string as it outputs the full version number (with all "test" and whatnot).
Why not add 4 global variables
EXTERN t_int pd_majorversion; EXTERN t_int pd_minorversion; EXTERN t_int pd_bugfixversion; EXTERN t_symbol pd_testversion;
...to m_pd.h, which would be initialized when pd starts up from the #defines PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION and PD_TEST_VERSION?
Or make it a struct:
typedef struct { t_int major_version; t_int minor_version; t_int bugfix_version; t_symbol test_version; } t_pd_version; EXTERN t_pd_version pd_version;
Martin
IOhannes m zmoelnig wrote:
Martin Peach wrote:
personally i don't care so much for the details. i proposed the string as it outputs the full version number (with all "test" and whatnot).
Why not add 4 global variables
because global variables suck
Oh. OK then. There seem to be quite a lot of them in pd though. Is there is a reason why they aren't all hidden behind accessor functions?
Martin
On Dec 11, 2008, at 1:54 PM, Martin Peach wrote:
IOhannes m zmoelnig wrote:
Hans-Christoph Steiner wrote:
IOhannes m zmoelnig wrote:
speaking of adding things to the Pd API... is it totally out of your ways to
- add a function that returns the version of Pd?
something like "const char* pd_versionstring(void)" would be nice. this could be used to ensure that an external is running with a Pd version compatible to the one it was compiled against
Since the version will most likely be used for a numeric comparison, and it is stored as a number, perhaps it makes sense to return numeric types instead of a char*?
int pd_majorversion(void) int pd_minorversion(void) int pd_bugfixversion(void)
personally i don't care so much for the details. i proposed the string as it outputs the full version number (with all "test" and whatnot).
Why not add 4 global variables
EXTERN t_int pd_majorversion; EXTERN t_int pd_minorversion; EXTERN t_int pd_bugfixversion; EXTERN t_symbol pd_testversion;
...to m_pd.h, which would be initialized when pd starts up from the #defines PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION and PD_TEST_VERSION?
Or make it a struct:
typedef struct { t_int major_version; t_int minor_version; t_int bugfix_version; t_symbol test_version; } t_pd_version; EXTERN t_pd_version pd_version;
I like both of these ideas.
.hc
Martin
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------ ----
I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers. - General Smedley Butler