[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl shared lib?



I was thinking about how nice it would be to have little perl plug-ins to
a number of programs that I use (BBEdit, Eudora, the new Navigator Gold
editor), and I started thinking about what kind of effort this would take.
It doesn't seem that it would be all that much.

I have a dream... A dream of a MacPerl shared library.  It would have a
really simple API, and not require much effort on the part of the app
programmer, and I have no idea if it would be easy to do on the MacPerl
end.  I see the API as follows:


void MacPerl(char *script,
             char *stdin,    // Available as STDIN.  The selected text, or
                             //   the whole window if there's no selection...
             int *len,       // Called with length of stdin buffer
                             //   returns as length of stdout
             char **stdout,  // Text put on STDOUT

             int (*open)(char *, char *, int)
                  // Callback to open a new output channel (window or file)
                  //   Arguments: char *windowTitle,    /* or fileName */
                  //              char *windowData,     /* or file data */
                  //              int dataLength        /* length of above */
                  // Replaces open(), if non-null.  Or maybe there should
                  // be another function MacPerl'ToolOpen()...
            );


I'm not sure exactly if this is very good Mac programming (I suspect that
script, stdin, stdout, and windowData should all be Handles or something),
but you get the general idea.

This (IMHO) would provide a *really* useful little module that would make
lots of Mac apps a lot more powerful, without much effort (on their part,
at least).


Comments?

Peter Folk

--
How DOES one solve a linear Ordinary Differential Equation?

pfolk@uni.uiuc.edu