Re: OS X Externals
I need to interact with an additional 3rd party tool for handling images in the database. Since that tool will need the images to be in pure binary form in the database, base64 encoding is not an option. On Nov 2, 2004, at 9:42 AM, K wrote: As good measure in daling with databases in general I base64 all binary prior to insert. This way I do not have to concern myself with utilities (or databases I my move to at a later time) supporting binary. It is a extra step but well worth the effort. -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Mon 11/01, Dar Scott < [EMAIL PROTECTED] > wrote: From: Dar Scott [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 1 Nov 2004 12:24:47 -0700 Subject: Re: OS X Externals On Nov 1, 2004, at 11:34 AM, Frank D. Engel, Jr. wrote:> Thank you everyone who looked at this for me, I finally convinced > myself that this is a bug in Rev and filed it in Bugzilla (#2308).>> I did manage to build by external under Windows, but have not tested > the faulty routine there yet. I suspect (from the below report) that > it is a Mac-specific bug, so until Rev gets this fixed, I will just > have to use the slow Transcript version, at least for the Mac. I will > test under Windows later, and if the external works there, I'll attach > a note to the bug report that it is OS X specific and then use the > external for Windows at least, both when it is fixed.I have heard rumors of a method for passing binary data as an arg, but I don't know how it works.My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.)How are you passing bi nary as an arg?Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services___ use-revolution mailing list[EMAIL PROTECTED]http://lists.runrev.com/ mailman/listinfo/use-revolution ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Forgot the mention I use the same convention with my externals. -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Mon 11/01, Frank D. Engel, Jr. < [EMAIL PROTECTED] > wrote: From: Frank D. Engel, Jr. [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 1 Nov 2004 15:02:50 -0500 Subject: Re: OS X Externals with a wrapper written in Transcript which basically dumps the arg into a variable, which in turn is read by the external; the code is posted as part of the bugzilla report (#2308)On Nov 1, 2004, at 2:24 PM, Dar Scott wrote:>> I have heard rumors of a method for passing binary data as an arg, but > I don't know how it works.>> My external SDK says data is a null terminated string. That means no > binary. (Without some method to avoid nulls.)>> How are you passing binary as an arg?>---Frank D. Engel, Jr. <[EMAIL PROTECTED]>$ ln -s /usr/share/kjvbible /usr/manual$ true | cat /usr/manual | grep "John 3:16"John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.$___$ 0 Web Hosting with up to 120MB web space, 1000 MB Transfer10 Personalized POP and Web E-mail Accounts, and much more.Signup at www.doteasy.com___use-revolution mailing list[EMAIL PROTECTED]http://lists.runrev.com/mailman/listinfo/use-revolution ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
As good measure in daling with databases in general I base64 all binary prior to insert. This way I do not have to concern myself with utilities (or databases I my move to at a later time) supporting binary. It is a extra step but well worth the effort. -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Mon 11/01, Dar Scott < [EMAIL PROTECTED] > wrote: From: Dar Scott [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 1 Nov 2004 12:24:47 -0700 Subject: Re: OS X Externals On Nov 1, 2004, at 11:34 AM, Frank D. Engel, Jr. wrote:> Thank you everyone who looked at this for me, I finally convinced > myself that this is a bug in Rev and filed it in Bugzilla (#2308).>> I did manage to build by external under Windows, but have not tested > the faulty routine there yet. I suspect (from the below report) that > it is a Mac-specific bug, so until Rev gets this fixed, I will just > have to use the slow Transcript version, at least for the Mac. I will > test under Windows later, and if the external works there, I'll attach > a note to the bug report that it is OS X specific and then use the > external for Windows at least, both when it is fixed.I have heard rumors of a method for passing binary data as an arg, but I don't know how it works.My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.)How are you passing bi nary as an arg?Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services___use-revolution mailing list[EMAIL PROTECTED]http://lists.runrev.com/mailman/listinfo/use-revolution ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
I can't find those functions; are you sure they are part of the Rev externals SDK? I can't seem to find them in the headers or in the documentation stack. The documentation stack seems to indicate that GetVariableEx and SetVariableEx should be used for binary data, which is what I am using, but GetVariableEx does not seem to work. On Nov 2, 2004, at 9:03 AM, Frank D. Engel, Jr. wrote: I'm not using the imageData; I'm using the text property. I need to store the original image format in the database. And by doing this, the byte ordering shouldn't be an issue. I'll see what I can find out about the GetXVariable/SetXVariable functions. Thank you. On Nov 2, 2004, at 12:46 AM, Brian Yennie wrote: FWIW, binary values can be passed in externals using the MCString structure and the GetXVariable / SetXVariable callbacks- there is an example in the SDK albeit non-obvious. You mentioned problems with binary data especially from images on Mac- any chance you haven't accounted for imageData coming in opposite order on Mac versus Windows (i.e. red-green-blue versus blue-green-red). Just a shot in the dark... - Brian with a wrapper written in Transcript which basically dumps the arg into a variable, which in turn is read by the external; the code is posted as part of the bugzilla report (#2308) On Nov 1, 2004, at 2:24 PM, Dar Scott wrote: I have heard rumors of a method for passing binary data as an arg, but I don't know how it works. My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.) How are you passing binary as an arg? --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
I'm not using the imageData; I'm using the text property. I need to store the original image format in the database. And by doing this, the byte ordering shouldn't be an issue. I'll see what I can find out about the GetXVariable/SetXVariable functions. Thank you. On Nov 2, 2004, at 12:46 AM, Brian Yennie wrote: FWIW, binary values can be passed in externals using the MCString structure and the GetXVariable / SetXVariable callbacks- there is an example in the SDK albeit non-obvious. You mentioned problems with binary data especially from images on Mac- any chance you haven't accounted for imageData coming in opposite order on Mac versus Windows (i.e. red-green-blue versus blue-green-red). Just a shot in the dark... - Brian with a wrapper written in Transcript which basically dumps the arg into a variable, which in turn is read by the external; the code is posted as part of the bugzilla report (#2308) On Nov 1, 2004, at 2:24 PM, Dar Scott wrote: I have heard rumors of a method for passing binary data as an arg, but I don't know how it works. My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.) How are you passing binary as an arg? --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
FWIW, binary values can be passed in externals using the MCString structure and the GetXVariable / SetXVariable callbacks- there is an example in the SDK albeit non-obvious. You mentioned problems with binary data especially from images on Mac- any chance you haven't accounted for imageData coming in opposite order on Mac versus Windows (i.e. red-green-blue versus blue-green-red). Just a shot in the dark... - Brian with a wrapper written in Transcript which basically dumps the arg into a variable, which in turn is read by the external; the code is posted as part of the bugzilla report (#2308) On Nov 1, 2004, at 2:24 PM, Dar Scott wrote: I have heard rumors of a method for passing binary data as an arg, but I don't know how it works. My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.) How are you passing binary as an arg? --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
with a wrapper written in Transcript which basically dumps the arg into a variable, which in turn is read by the external; the code is posted as part of the bugzilla report (#2308) On Nov 1, 2004, at 2:24 PM, Dar Scott wrote: I have heard rumors of a method for passing binary data as an arg, but I don't know how it works. My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.) How are you passing binary as an arg? --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Nov 1, 2004, at 11:34 AM, Frank D. Engel, Jr. wrote: Thank you everyone who looked at this for me, I finally convinced myself that this is a bug in Rev and filed it in Bugzilla (#2308). I did manage to build by external under Windows, but have not tested the faulty routine there yet. I suspect (from the below report) that it is a Mac-specific bug, so until Rev gets this fixed, I will just have to use the slow Transcript version, at least for the Mac. I will test under Windows later, and if the external works there, I'll attach a note to the bug report that it is OS X specific and then use the external for Windows at least, both when it is fixed. I have heard rumors of a method for passing binary data as an arg, but I don't know how it works. My external SDK says data is a null terminated string. That means no binary. (Without some method to avoid nulls.) How are you passing binary as an arg? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Thank you everyone who looked at this for me, I finally convinced myself that this is a bug in Rev and filed it in Bugzilla (#2308). I did manage to build by external under Windows, but have not tested the faulty routine there yet. I suspect (from the below report) that it is a Mac-specific bug, so until Rev gets this fixed, I will just have to use the slow Transcript version, at least for the Mac. I will test under Windows later, and if the external works there, I'll attach a note to the bug report that it is OS X specific and then use the external for Windows at least, both when it is fixed. On Oct 18, 2004, at 8:26 PM, Mark Wieder wrote: Frank- Monday, October 18, 2004, 4:16:06 PM, you wrote: FDEJ> Note that passing simple text strings into either function yields the FDEJ> same results, it is only when I use binary data, such as an image, that FDEJ> I am seeing the problem. !!! Are you sure you're passing the same data to each routine? I get the same results from the transcript code and the external even when I use the imageData of an image. FDEJ> Are you also using OS X, or are you working on another platform? I FDEJ> wonder if it is a Mac or OS X platform-specific thing, but I haven't FDEJ> been able to compile under Windows yet, so I can't confirm this. Well, admittedly I did the quick test in Win2k (I can hear Chipp laughing at me even now) - I'll try to give it a test under OSX tomorrow if I get a chance. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Frank- Monday, October 18, 2004, 4:16:06 PM, you wrote: FDEJ> Note that passing simple text strings into either function yields the FDEJ> same results, it is only when I use binary data, such as an image, that FDEJ> I am seeing the problem. !!! Are you sure you're passing the same data to each routine? I get the same results from the transcript code and the external even when I use the imageData of an image. FDEJ> Are you also using OS X, or are you working on another platform? I FDEJ> wonder if it is a Mac or OS X platform-specific thing, but I haven't FDEJ> been able to compile under Windows yet, so I can't confirm this. Well, admittedly I did the quick test in Win2k (I can hear Chipp laughing at me even now) - I'll try to give it a test under OSX tomorrow if I get a chance. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
My C function for dbBLOB is giving different results for some input values than is the Transcript function. I am handing image data to the function (dbBLOB(image "name")). My C function for dbUNBLOB gives the same results as the Transcript function; if I take the results from the C version of dbBLOB, run it through either dbUNBLOB, and try to put that into an image, it does not work. If I take the results of the Transcript dbBLOB and run them through either dbUNBLOB, then put those results into an image, it works perfectly (but getting the dbBLOB results is very very slow). Rev seems to replace certain values in the binary code of the image when it is accessed from an external, at least on my system. Note that passing simple text strings into either function yields the same results, it is only when I use binary data, such as an image, that I am seeing the problem. Are you also using OS X, or are you working on another platform? I wonder if it is a Mac or OS X platform-specific thing, but I haven't been able to compile under Windows yet, so I can't confirm this. On Oct 18, 2004, at 7:06 PM, Mark Wieder wrote: Frank- I got curious about your externals problem and cobbled together a test stack and external library from your sources. Works fine for me (at least once I get my head wrapped around reading octal again). I can't explain why you're seeing different results. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
OS X Externals
Frank- I got curious about your externals problem and cobbled together a test stack and external library from your sources. Works fine for me (at least once I get my head wrapped around reading octal again). I can't explain why you're seeing different results. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 14, 2004, at 7:30 AM, Frank D. Engel, Jr. wrote: Changing the type of buffer to unsigned char * has no obvious effect (same problem). Sorry. I was not thinking clearly. It's the type of the pointer. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Yes, though the remainder of these were all valid corrections, which I have made; this does not address the issue of the different results, however. I tried "put the useUnicode" --> result is false The MCstring struct is defined in XCmdGlue.h and is of type 'const char *' -- no indication of signed vs. unsigned Changing the type of buffer to unsigned char * has no obvious effect (same problem). On Oct 13, 2004, at 7:53 PM, Trevor DeVore wrote: On Oct 13, 2004, at 4:39 PM, Mark Wieder wrote: Second, you might try replacing *retstring = buffer; with *retstring = istrdup(buffer); free (buffer); I think you're OK on this one since you're mallocing memory and not freeing it, forcing the engine to do this for you, but I'm not sure. As long as the memory that *retstring is pointing to was created with malloc (or similar) then you are okay and don't need to free it. The engine will take care of it. So the original method is fine. -- Trevor DeVore Blue Mango Multimedia [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 13, 2004, at 4:39 PM, Mark Wieder wrote: Second, you might try replacing *retstring = buffer; with *retstring = istrdup(buffer); free (buffer); I think you're OK on this one since you're mallocing memory and not freeing it, forcing the engine to do this for you, but I'm not sure. As long as the memory that *retstring is pointing to was created with malloc (or similar) then you are okay and don't need to free it. The engine will take care of it. So the original method is fine. -- Trevor DeVore Blue Mango Multimedia [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Frank- A few things here: First off, the runrev engine needs to clean the stack when you return from an external call. This involves deleting the arguments and freeing up the allocated memory. Instead of *retstring = 0; you should be using *retstring = calloc(1,1); to avoid having the engine try to free up a null pointer. Freeing a null pointer is defined as a NOP by the standard, but it's a bad idea to rely on it. Second, you might try replacing *retstring = buffer; with *retstring = istrdup(buffer); free (buffer); I think you're OK on this one since you're mallocing memory and not freeing it, forcing the engine to do this for you, but I'm not sure. Third, it's generally good form to check the result value from a malloc() call to ensure that it worked. buffer = (char *)malloc(10 + (rdata.length * 5)); if (NULL == buffer) { *retstring = calloc(1,1); *pass = False; *error = True; return; } And lastly, you might also check rdata before using it. This is related to the malloc() call above. If your call to GetVariableEx fails then rdata.length and rdata.sptr will be undetermined. Your malloc() call may or may not return anything useful, and your buffer fills will be getting memory from somewhere else from where you expect them to. if (NULL != rdata.sptr) { // etc. I'm not sure any of these have any bearing on why you're seeing different results. Also... I found an error in the sdk where GetVariableEx is listed as one of the functions that allocates memory for a return variable. That's not the case, so you don't have to free up the return value - it's actually a void function. Just FYI. Wednesday, October 13, 2004, 2:02:29 PM, you wrote: FDEJ> This simply takes each character and yields a zero-padded, three-octet FDEJ> number preceded by two backslash '\' characters. My C equivalent FDEJ> reads: FDEJ> void dbBLOB(char *args[], int nargs, char **retstring, Bool *pass, Bool FDEJ> *error) FDEJ> { FDEJ> int retvalue; FDEJ> MCstring rdata; FDEJ> char *buffer; FDEJ> int i, j = 0; FDEJ> if(nargs != 1) FDEJ> { FDEJ> *retstring = 0; FDEJ> *pass = False; FDEJ> *error = True; FDEJ> return; FDEJ> } FDEJ> GetVariableEx(args[0], "", &rdata, &retvalue); FDEJ> buffer = (char *)malloc(10 + (rdata.length * 5)); FDEJ> *pass = False; FDEJ> *error = False; FDEJ> buffer[j++] = '\''; FDEJ> for(i = 0; i < rdata.length; i++) FDEJ> { FDEJ> buffer[j++] = '\\'; FDEJ> buffer[j++] = '\\'; FDEJ> sprintf(&(buffer[j]), "%03o", rdata.sptr[i]); FDEJ> j += 3; FDEJ> } FDEJ> buffer[j++] = '\''; FDEJ> buffer[j++] = ':'; FDEJ> buffer[j++] = ':'; FDEJ> buffer[j++] = 'b'; FDEJ> buffer[j++] = 'y'; FDEJ> buffer[j++] = 't'; FDEJ> buffer[j++] = 'e'; FDEJ> buffer[j++] = 'a'; FDEJ> buffer[j] = 0; FDEJ> *retstring = buffer; FDEJ> } -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 13, 2004, at 4:18 PM, Dar Scott wrote: Try unsigned char buffer. The more I think about it, this looks right. The formating minimum width is a minimum and you might be formatting a larger numeral but advancing your pointer only 3. The larger numeral may be because of the negative input. Note that the cases of a match are where the value is positive, 022, but not 330 or 341 where it is negative. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 13, 2004, at 3:02 PM, Frank D. Engel, Jr. wrote: Unfortunately, there is still a bug somewhere that I can't seem to figure out. Keeps happening... if programming were easy, why would anyone do it Good looking code. It is more efficient than what I would have done. I didn't see where the problem is, but here are some ideas. Check the useUnicode property. Check the type of sptr. Try unsigned char buffer. The 377 are all ones and might be the high end of a negative number. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Unfortunately, there is still a bug somewhere that I can't seem to figure out. Keeps happening... if programming were easy, why would anyone do it ;-) My original Transcript code for dbBLOB is as follows: function dbBLOB bdat put "'" into x set the cursor to watch repeat for each char c in bdat put format("%03o", charToNum(c)) after x end repeat return x & "'::bytea" end dbBLOB This simply takes each character and yields a zero-padded, three-octet number preceded by two backslash '\' characters. My C equivalent reads: void dbBLOB(char *args[], int nargs, char **retstring, Bool *pass, Bool *error) { int retvalue; MCstring rdata; char *buffer; int i, j = 0; if(nargs != 1) { *retstring = 0; *pass = False; *error = True; return; } GetVariableEx(args[0], "", &rdata, &retvalue); buffer = (char *)malloc(10 + (rdata.length * 5)); *pass = False; *error = False; buffer[j++] = '\''; for(i = 0; i < rdata.length; i++) { buffer[j++] = '\\'; buffer[j++] = '\\'; sprintf(&(buffer[j]), "%03o", rdata.sptr[i]); j += 3; } buffer[j++] = '\''; buffer[j++] = ':'; buffer[j++] = ':'; buffer[j++] = 'b'; buffer[j++] = 'y'; buffer[j++] = 't'; buffer[j++] = 'e'; buffer[j++] = 'a'; buffer[j] = 0; *retstring = buffer; } The same basic algorithm (except with better memory management to help boost the performance somewhat), right? So why does the output from the Transcript version start with: \\377\\330\\377\\341\\022\\277 While the output from the C version starts with: \\377\\377\\377\\377\\022\\377 For the exact same input? I can only guess that the data is being modified by Rev before it reaches the external C function. Of course, this means that the Transcript version works, but the C version does not -- even though the C version is *much* faster (of course). Any takers on how to handle this? Oh, and the C version is called by the Transcript wrapper: function dbBLOB adat put adat into res return dbxBLOB("res") end dbBLOB Which is designed to make the semantics of the call identical, so that I don't have to rework the rest of my code to use the external version (and because I like it better this way too). Thank You! On Oct 13, 2004, at 1:04 PM, Frank D. Engel, Jr. wrote: What I just finished doing is creating a small function in Transcript which acts as a wrapper for the C function. The C function returns the value to the local variable in the Transcript function, which returns the value to the caller in the program. Thank you everyone, this is working much better now. Excellent! On Oct 13, 2004, at 1:00 PM, Dar Scott wrote: On Oct 13, 2004, at 10:41 AM, Frank D. Engel, Jr. wrote: That looks doable, but I would have preferred to have the value returned by the function (as a return value). I guess I will use (the below) unless someone could tell me how to provide a binary return value? Because of this limitation (and others, such as the 64K limit), I now make my externals provide helper functions for a library that has the interface I want. Since externals are associated with a stack, this works OK. I have proposed a couple backward compatible binary interfaces for external interface inhancement, but I don't expect anything to happen along this line. (On the other hand, I have been Rip Van Winkle for a couple months, so what do I know?) Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
What I just finished doing is creating a small function in Transcript which acts as a wrapper for the C function. The C function returns the value to the local variable in the Transcript function, which returns the value to the caller in the program. Thank you everyone, this is working much better now. Excellent! On Oct 13, 2004, at 1:00 PM, Dar Scott wrote: On Oct 13, 2004, at 10:41 AM, Frank D. Engel, Jr. wrote: That looks doable, but I would have preferred to have the value returned by the function (as a return value). I guess I will use (the below) unless someone could tell me how to provide a binary return value? Because of this limitation (and others, such as the 64K limit), I now make my externals provide helper functions for a library that has the interface I want. Since externals are associated with a stack, this works OK. I have proposed a couple backward compatible binary interfaces for external interface inhancement, but I don't expect anything to happen along this line. (On the other hand, I have been Rip Van Winkle for a couple months, so what do I know?) Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 13, 2004, at 10:41 AM, Frank D. Engel, Jr. wrote: That looks doable, but I would have preferred to have the value returned by the function (as a return value). I guess I will use (the below) unless someone could tell me how to provide a binary return value? I have tried hex and have tried 01 quoting, but these complicate the interface and require work on the Transcript side. The db libraries have a method, but I don't like it and have purged it from my mind (I forgot how it goes). Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Oct 13, 2004, at 10:41 AM, Frank D. Engel, Jr. wrote: That looks doable, but I would have preferred to have the value returned by the function (as a return value). I guess I will use (the below) unless someone could tell me how to provide a binary return value? Because of this limitation (and others, such as the 64K limit), I now make my externals provide helper functions for a library that has the interface I want. Since externals are associated with a stack, this works OK. I have proposed a couple backward compatible binary interfaces for external interface inhancement, but I don't expect anything to happen along this line. (On the other hand, I have been Rip Van Winkle for a couple months, so what do I know?) Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
That looks doable, but I would have preferred to have the value returned by the function (as a return value). I guess I will use (the below) unless someone could tell me how to provide a binary return value? Thank you! On Oct 13, 2004, at 11:23 AM, Thierry Arbellot wrote: You can return binary data in argument: for example in transcript local thebinaryData theExternalCommand "theBinaryData" in C program { int retvalue; MCstringrdata; // put here your process rdata.sptr = pointerToBinaryData; rdata.length = sizeOfbinaryData; SetVariableEx(args[0],"",&rdata,&retvalue); } On Wednesday, Oct 13, 2004, at 16:49 Europe/Paris, Frank D. Engel, Jr. wrote: Aha! Got it built and working. It had something to do with the prefix header, whatever that is. However, I now have a slightly different question. Since one of these functions returns a string with binary image data, that string may contain null bytes -- not a problem for Rev, but as far as I can tell, the return value from an external function call is null-terminated. How can I return a string value from an external function and include embedded null characters in the string? Thank you! On Oct 13, 2004, at 9:22 AM, Frank D. Engel, Jr. wrote: I don't mind copying it when built; it should not need to be redone too often after I have it working; there are two functions which I translated to C from Transcript in order to improve performance (they are quite slow under Transcript, since they need to look at each byte in the text of an image). Toward the beginning of the C source code, I placed this line: char Xname[] = "PostgreSQL BLOB encoding functions external v0.0"; (I previously posted the Transcript versions of the functions) At the end of external.c, I placed this code: Xternal Xtable[] = { {"dbblob", XFUNCTION, 0, dbBLOB, dbabort}, {"dbunblob", XFUNCTION, 0, dbUNBLOB, dbabort}, {"", XNONE, 0, NULL, NULL} }; Note that the 'dbabort' function simply contains an fprintf function call (outputs to stderr). What else would be needed to get this working? I created an Xcode project using the "Carbon Bundle" template, and did simple changes to get the project to build with the following files listed when the project icon is selected in the left-hand pane: bytea-funcs.bundle (the target) Carbon.framework (from OS X) external.c (my code) InfoPList.strings (provided by Xcode, then modified) XCmdGlue.c (from the SDK) XCmdGlue.h (from the SDK) XCmdName.h (from the SDK) I also have XCmdFunc.c (from the SDK) copied into the project directory. Toward the end of XCmdGlue.c, there was a line: #include "XCmdFunc.c" I commented that line out because I could not get the project to build otherwise. After commenting out that line, the project now builds without errors or warnings, but does not work. Could this be related to the problem, and if so, how can I get the project to build with the line uncommented? My own code does not call any of the functions provided by the engine; I tried to keep it as simple as I could. On Oct 13, 2004, at 9:04 AM, Thierry Arbellot wrote: OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and s
Re: OS X Externals
You can return binary data in argument: for example in transcript local thebinaryData theExternalCommand "theBinaryData" in C program { int retvalue; MCstringrdata; // put here your process rdata.sptr = pointerToBinaryData; rdata.length = sizeOfbinaryData; SetVariableEx(args[0],"",&rdata,&retvalue); } On Wednesday, Oct 13, 2004, at 16:49 Europe/Paris, Frank D. Engel, Jr. wrote: Aha! Got it built and working. It had something to do with the prefix header, whatever that is. However, I now have a slightly different question. Since one of these functions returns a string with binary image data, that string may contain null bytes -- not a problem for Rev, but as far as I can tell, the return value from an external function call is null-terminated. How can I return a string value from an external function and include embedded null characters in the string? Thank you! On Oct 13, 2004, at 9:22 AM, Frank D. Engel, Jr. wrote: I don't mind copying it when built; it should not need to be redone too often after I have it working; there are two functions which I translated to C from Transcript in order to improve performance (they are quite slow under Transcript, since they need to look at each byte in the text of an image). Toward the beginning of the C source code, I placed this line: char Xname[] = "PostgreSQL BLOB encoding functions external v0.0"; (I previously posted the Transcript versions of the functions) At the end of external.c, I placed this code: Xternal Xtable[] = { {"dbblob", XFUNCTION, 0, dbBLOB, dbabort}, {"dbunblob", XFUNCTION, 0, dbUNBLOB, dbabort}, {"", XNONE, 0, NULL, NULL} }; Note that the 'dbabort' function simply contains an fprintf function call (outputs to stderr). What else would be needed to get this working? I created an Xcode project using the "Carbon Bundle" template, and did simple changes to get the project to build with the following files listed when the project icon is selected in the left-hand pane: bytea-funcs.bundle (the target) Carbon.framework (from OS X) external.c (my code) InfoPList.strings (provided by Xcode, then modified) XCmdGlue.c (from the SDK) XCmdGlue.h (from the SDK) XCmdName.h (from the SDK) I also have XCmdFunc.c (from the SDK) copied into the project directory. Toward the end of XCmdGlue.c, there was a line: #include "XCmdFunc.c" I commented that line out because I could not get the project to build otherwise. After commenting out that line, the project now builds without errors or warnings, but does not work. Could this be related to the problem, and if so, how can I get the project to build with the line uncommented? My own code does not call any of the functions provided by the engine; I tried to keep it as simple as I could. On Oct 13, 2004, at 9:04 AM, Thierry Arbellot wrote: OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank,
Re: OS X Externals
Aha! Got it built and working. It had something to do with the prefix header, whatever that is. However, I now have a slightly different question. Since one of these functions returns a string with binary image data, that string may contain null bytes -- not a problem for Rev, but as far as I can tell, the return value from an external function call is null-terminated. How can I return a string value from an external function and include embedded null characters in the string? Thank you! On Oct 13, 2004, at 9:22 AM, Frank D. Engel, Jr. wrote: I don't mind copying it when built; it should not need to be redone too often after I have it working; there are two functions which I translated to C from Transcript in order to improve performance (they are quite slow under Transcript, since they need to look at each byte in the text of an image). Toward the beginning of the C source code, I placed this line: char Xname[] = "PostgreSQL BLOB encoding functions external v0.0"; (I previously posted the Transcript versions of the functions) At the end of external.c, I placed this code: Xternal Xtable[] = { {"dbblob", XFUNCTION, 0, dbBLOB, dbabort}, {"dbunblob", XFUNCTION, 0, dbUNBLOB, dbabort}, {"", XNONE, 0, NULL, NULL} }; Note that the 'dbabort' function simply contains an fprintf function call (outputs to stderr). What else would be needed to get this working? I created an Xcode project using the "Carbon Bundle" template, and did simple changes to get the project to build with the following files listed when the project icon is selected in the left-hand pane: bytea-funcs.bundle (the target) Carbon.framework (from OS X) external.c (my code) InfoPList.strings (provided by Xcode, then modified) XCmdGlue.c (from the SDK) XCmdGlue.h (from the SDK) XCmdName.h (from the SDK) I also have XCmdFunc.c (from the SDK) copied into the project directory. Toward the end of XCmdGlue.c, there was a line: #include "XCmdFunc.c" I commented that line out because I could not get the project to build otherwise. After commenting out that line, the project now builds without errors or warnings, but does not work. Could this be related to the problem, and if so, how can I get the project to build with the line uncommented? My own code does not call any of the functions provided by the engine; I tried to keep it as simple as I could. On Oct 13, 2004, at 9:04 AM, Thierry Arbellot wrote: OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that
Re: OS X Externals
As an experiment, I put the full path to the external into "the externals of this stack", quit Rev, and reopened. Same results -- "the externalFunctions of this stack" is empty On Oct 13, 2004, at 9:04 AM, Thierry Arbellot wrote: OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
I don't mind copying it when built; it should not need to be redone too often after I have it working; there are two functions which I translated to C from Transcript in order to improve performance (they are quite slow under Transcript, since they need to look at each byte in the text of an image). Toward the beginning of the C source code, I placed this line: char Xname[] = "PostgreSQL BLOB encoding functions external v0.0"; (I previously posted the Transcript versions of the functions) At the end of external.c, I placed this code: Xternal Xtable[] = { {"dbblob", XFUNCTION, 0, dbBLOB, dbabort}, {"dbunblob", XFUNCTION, 0, dbUNBLOB, dbabort}, {"", XNONE, 0, NULL, NULL} }; Note that the 'dbabort' function simply contains an fprintf function call (outputs to stderr). What else would be needed to get this working? I created an Xcode project using the "Carbon Bundle" template, and did simple changes to get the project to build with the following files listed when the project icon is selected in the left-hand pane: bytea-funcs.bundle (the target) Carbon.framework (from OS X) external.c (my code) InfoPList.strings (provided by Xcode, then modified) XCmdGlue.c (from the SDK) XCmdGlue.h (from the SDK) XCmdName.h (from the SDK) I also have XCmdFunc.c (from the SDK) copied into the project directory. Toward the end of XCmdGlue.c, there was a line: #include "XCmdFunc.c" I commented that line out because I could not get the project to build otherwise. After commenting out that line, the project now builds without errors or warnings, but does not work. Could this be related to the problem, and if so, how can I get the project to build with the line uncommented? My own code does not call any of the functions provided by the engine; I tried to keep it as simple as I could. On Oct 13, 2004, at 9:04 AM, Thierry Arbellot wrote: OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED
Re: OS X Externals
OK If you don't want to copy the bundle every-time you rebuild it, use the full path to the folder where XCode build the bundle. And each time you rebuild the bundle, you should close the stack, remove it from memory then reopen it. Another thing to check: have you add the 2 functions in the Xtable array declared in the external.c source file ? On Wednesday, Oct 13, 2004, at 14:40 Europe/Paris, Frank D. Engel, Jr. wrote: No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
No, just the name. However, I have now tried using the EnhancedQT external, just to see how that one worked (place it where in order for it to work), and placing it in the Rev folder causes it to work, even w/o the full path in "the externals of this stack", and the externalFunctions does return a list of functions. I placed my external in the same place, but have an empty list of externalFunctions. Apparently something is wrong, either in my C source code, or in the build process. On Oct 13, 2004, at 5:10 AM, Thierry Arbellot wrote: On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
Yes, I get the name of my external printed into the msg box (bytea-funcs.bundle). On Oct 12, 2004, at 7:08 PM, Ken Ray wrote: On 10/12/04 4:44 PM, "Frank D. Engel, Jr." <[EMAIL PROTECTED]> wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! Frank, what happens when you say "put the externals of this stack"? Anything? Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On Tuesday, Oct 12, 2004, at 23:44 Europe/Paris, Frank D. Engel, Jr. wrote: I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> Frank, Have you set the full path to the bundle in the externals property of the main stack ? Thierry ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). Frank, I haven't tried making my own externals but I have had problems with Rev's externals which I added to bugzilla last week. One of the problems was that "the externalFunctions" and "the externalCommands" return nothing and the "Check for updates.." upgrades stopped "the externals" reporting anything as well. I recommend you try building your app using Rev 2.2 and see what happens there. Unfortunately, that is what I have been forced to do for any apps that use externals. Cheers, Sarah Bugzilla: http://support.runrev.com/bugdatabase/show_bug.cgi?id=2153 ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: OS X Externals
On 10/12/04 4:44 PM, "Frank D. Engel, Jr." <[EMAIL PROTECTED]> wrote: > I am trying to build an external for OS X (which I will eventually need > to get working under Windows as well). There should be no outside > dependencies from the external itself, other than the standard libc. > The external contains two functions. > > I tried various things, and finally ended up with a .bundle file, > courtesy of XCode. I tried several different placements of the file, > and have the name of the bundle in the externals property of my main > stack, but using 'answer the externalFunctions of this stack' from the > msgbox always results in an empty message box (just the ever-present OK > button). > > I cannot tell if Rev is not finding my external, if my external was not > built correctly (found but considered corrupt and silently ignored), or > if it is somehow being considered an 'empty' external (a valid external > with no functions). > > Could anyone help me to debug this problem? Thank you! Frank, what happens when you say "put the externals of this stack"? Anything? Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
OS X Externals
I am trying to build an external for OS X (which I will eventually need to get working under Windows as well). There should be no outside dependencies from the external itself, other than the standard libc. The external contains two functions. I tried various things, and finally ended up with a .bundle file, courtesy of XCode. I tried several different placements of the file, and have the name of the bundle in the externals property of my main stack, but using 'answer the externalFunctions of this stack' from the msgbox always results in an empty message box (just the ever-present OK button). I cannot tell if Rev is not finding my external, if my external was not built correctly (found but considered corrupt and silently ignored), or if it is somehow being considered an 'empty' external (a valid external with no functions). Could anyone help me to debug this problem? Thank you! --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution