Title: | "ASK THE WIZARDS" |
Moderator: | QUARK::LIONEL |
Created: | Mon Oct 30 1995 |
Last Modified: | Mon May 12 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1857 |
Total number of notes: | 3728 |
Return-Path: "VMS001::WWW"@vms001.das-x.dec.com Received: by vmsmkt.zko.dec.com (UCX V4.1-12, OpenVMS V6.2 VAX); Wed, 5 Feb 1997 17:05:06 -0500 Received: from vms001 by mail11.digital.com (8.7.5/UNX 1.5/1.0/WV) id QAA00757; Wed, 5 Feb 1997 16:57:22 -0500 (EST) Date: Wed, 5 Feb 1997 16:57:48 -0500 Message-Id: <[email protected]> From: "VMS001::WWW"@vms001.das-x.dec.com (05-Feb-1997 1657) To: [email protected], [email protected], [email protected] Subject: Ask the Wizard: '[email protected]' X-VMS-To: [email protected] Remote Host: (null) Browser Type: Mozilla/3.01Gold (X11; U; HP-UX A.09.05 9000/725) Remote Info: <null> Name: Saul Zavala Email Address: [email protected] CPU Architecture: VAX Version: v 5.5-2 Questions: USING PREPROCESSOR $descriptor MACRO, I DECLARED THE FOLLOWING STRUCTURE WITHIN A C SOURCE PROGRAM: $DESCRIPTOR (line1, "ABCDEFGHIJ"); WHAT "C" METHOD CAN I USE TO DETERMINE THE STRING LENGTH FOR THE descriptor IDENTIFIER (i.e., line1) ? THE RESULT AS DEFINED IN THE ABOVE EXAMPLE SHOULD BE 10, OF COURSE.
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1542.1 | line1.dsc$w_length | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Tue Feb 11 1997 11:39 | 22 |
:USING PREPROCESSOR $descriptor MACRO, I DECLARED THE FOLLOWING :STRUCTURE WITHIN A C SOURCE PROGRAM: : :$DESCRIPTOR (line1, "ABCDEFGHIJ"); : :WHAT "C" METHOD CAN I USE TO DETERMINE THE STRING LENGTH FOR THE :descriptor IDENTIFIER (i.e., line1) ? THE RESULT AS DEFINED IN THE :ABOVE EXAMPLE SHOULD BE 10, OF COURSE. length = line1.dsc$w_length; A descriptor is a structure that contains the length, the descriptor type, the descriptor class (stick with `static' for now), and the descriptor buffer address -- the buffer referenced by the string descriptor is not necessarily null-terminated, unless specifically created that way. Also be aware that string constants are usually in read-only storage in recent DEC C compiler releases. Also -- please take a look at the OpenVMS Programming Concepts Manual, as well as the DEC C documentation for OpenVMS. |