Path: utzoo!mnetor!uunet!husc6!bbn!bbn.com!levin From: levin@bbn.com (Joel B Levin) Newsgroups: comp.sys.mac Subject: Re: sprintf() bug? Message-ID: <20455@bbn.COM> Date: 3 Feb 88 17:58:03 GMT References: Sender: news@bbn.COM Reply-To: levin@powell.BBN.COM (Joel B Levin) Organization: BBN Communications Corporation Lines: 41 In article rs4u+@andrew.cmu.edu (Richard Siegel) writes: :MPW and Aztec, on the other hand, allow you to pass C strings to ROM calls; :they *do* have glue. For EVERY SINGLE trap that takes a string, they have :glue. :Icky. As of MPW 2.0, you can avoid the glue in most cases, because two things have been added: 1. In the #include files, for each trap where the only differences between the "glued" version and the trap are string type and calling sequence, a definition has been added which invokes the trap directly, e.g., SetWTitle (theWindow, cString); gets you some glue, but SETWTITLE (theWindow, PStringPtr); gets you the trap without glue. This doesn't work for OS calls which don't use the stack; there you always need glue, I imagine even in LSC. 2. The compiler recognizes the "special" character \p at the head of a string constant and translates it to a length byte, so you can now say SETWTITLE (theWindow, "\pNew title"); I have been playing in my spare time with the problem of translating LSC into MPW (I don't have LSC or a manual, so I'm half blind) -- specifically, TransSkel, TransDisplay, and TransEdit and their demos. It has been most educational. Before I learned of these new features of MPW 2.0, it was a lot of work; this has made it much easier. When I have done, I'll probably write up the lessons I've learned so it is easier for someone else to do this. (Unless, of course, someone has written a translator?) /JBL UUCP: {harvard, husc6, etc.}!bbn!levin ARPA: levin@bbn.com