[comp.sys.mac] strings

MJSCHMEL@pucc.Princeton.EDU (Michael J. Schmelzer) (02/13/88)

Time for a simple question:
I'm used to the way LSC handles C to Pascal string conversions.
How do the string conversion functions work (p2cstr and c2psstr) in MPW?
 
Reply by mail if you think this is too simple to post a reply,
and thanks.
=========================================================================
comes around             Mike Schmelzer                  what goes around
=========================================================================
"Born with the dead just south of Heaven, you'd better touch me not."
                                                 -Divine Horsemen

MJSCHMEL@pucc.Princeton.EDU (Michael J. Schmelzer) (02/28/88)

Hello again, everybody.
 
The MPW manual was no help concerning the conversion of C to Pascal
strings. The manual also cryptically states that the function
"c2psstr" always returns an "s" (or 's'), whatever that's supposed
to mean.
 
The function prototype is as follows:
/*
   strings.h -- string conversions
 
   C Interface to the Macintosh Libraries
   Copyright (c) 1985, 1986 Apple Computer, Inc.  All rights reserved.
*/
 
#ifndef __STRINGS__
#define __STRINGS__
 
char *p2cstr();
char *c2psstr();
#endif
 
I have written some applications in LSC and would like to become
competent in MPW before I enter the job market (!)
If someone could please provide a working example of C to Pascal string
conversion in MPW I would be eternally grateful.
(By the way, I remember reading here that someone was completely
disgusted with the way LSC handled these conversions. I'd like to know
why.)
 
Again, eternal thanks.
=========================================================================
comes around             Mike Schmelzer                  what goes around
=========================================================================
"Come on baby, worship me. I'm the god of fertility."
                                                 -Zodiac Mindwarp