From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,2afd440a210c7fb0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,df8a3dc583bf1f5f X-Google-Attributes: gid1164f8,public From: thomasgd@omc.bt.co.uk (Greg Thomas) Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Date: 1998/08/28 Message-ID: <35fbd212.2154018254@news.axion.bt.co.uk>#1/1 X-Deja-AN: 385666898 Content-Transfer-Encoding: 7bit References: <0095000017115526000002L062*@MHS> <6rukse$3q0$1@usenet01.srv.cis.pitt.edu> <6s17hi$2g8@post.gsfc.nasa.gov> <6s4o0o$q31@news1.panix.com> <6s6i11$jla$1@vixen.cso.uiuc.edu> Content-Type: text/plain; charset=us-ascii Organization: BT Labs, Martlesham Heath, Ipswich, UK Mime-Version: 1.0 Newsgroups: comp.os.vms,comp.sys.dec On 28 Aug 1998 15:23:13 GMT, tsmurphy@cs.uiuc.edu (TERENCE MURPHY) wrote in article <6s6i11$jla$1@vixen.cso.uiuc.edu>: >How do you propose I do this? Say I write a program: > >main() { char *hello = "Hello"; pascal_format_puts(hello); } > >How do I get the compiler to generate the hello string as a pascal >string? Think of OpenVMS descriptors, and have a pascal_strings.h which contains ... typedef struct { unsigned int length; void *string_ptr; } pascal_string_t; #define pascal_string( variable, value )\ pascal_string_t variable = { strlen( value ), (void *)value }; void pascal_format_puts( pascal_string_t string ); Then you can have ... #include "pascal_string.h" main() { pascal_string( hello, "Hello" ); pascal_format_puts( hello ); } Greg -- This post represents the views of the author and does not necessarily accurately represent the views of BT.