Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!kth.se!cyklop.nada.kth.se!news From: d88-jwa@byse.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Is there a defacto standard for 'drop ins'? Message-ID: Date: 24 Mar 91 20:39:31 GMT References: <1CE00001.aolmdnz@tbomb.ice.com> <13094@adobe.UUCP> Sender: news@nada.kth.se (Mr News) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 48 In-reply-to: hawley@adobe.COM's message of 22 Mar 91 18:14:17 GMT In article <13094@adobe.UUCP> hawley@adobe.COM (Steve Hawley) writes: typedef struct { /* stream operations. These would probably follow Pascal calling conventions */ boolean (*EndOfStreamFunc)(); char (*GetCharFunc)(); OSErr (*PutCharFunc)(); OSErr (*UngetCharFunc)(); /* maybe Seek, and Length too */ } StreamOps, *StreamOpsPtr; You would rather want to get blocks at a time - like, typedef struct { long amountToRead ; long flags ; /* bit 0 == SetPosition supported &c */ pascal OSErr ( * ReadBlock ) ( char * , long ) ; pascal OSErr ( * PeekBlock ) ( char * , long ) ; pascal OSErr ( * WriteBlock ) ( char * , long ) ; pascal OSErr ( * SetPosition ) ( char * , long ) ; pascal OSErr ( * TellUser ) ( char * ) ; } filterParam ; pascal OSErr MyFilterFunc ( filterParam * p , char * userData ) { } Or should it be handle-based ? Maybe bit 1 == Handles instead of pointers ? Who should be responsible for allocating memory ? Should operations in site be allowed ? (more flags :-) userData could be filter-dependent, like "awk" command lines, or it could be app-dependent. More ideas ! Maybe the Net is strong enough to actually support a de-facto standard. But we'd have to talk a few major players into using this standard. Happy hacking, h+@nada.kth.se Jon W{tte -- "The IM-IV file manager chapter documents zillions of calls, all of which seem to do almost the same thing and none of which seem to do what I want them to do." -- Juri Munkki in comp.sys.mac.programmer