>From: Brendan Bispham <midrangel@black-and-blue.com>
>Date: Wed, 28 Nov 2001 19:03:06 +0000
>struct _varBind{ struct _varBind * next;
>char *oid; /* Null Terminated */
>unsigned char asn_type;
>int val_len;
>union { int * int_val; char * str_val; } val; };
>0010.00 D pdu_ds          DS                   based(pdu_ptr_s)
>0011.00 D  next                           *
>0012.00 D  oid                            *
>0013.00 D  asn_type                       *
>0014.00 D  val_len                      10I 0
>0015.00 D  result                         *

Brendan, after skimming through the rest of the I'm not sure
this is still relevant, but assuming the C struct is correct,
the asn_type is a character, not a pointer to character.  So
the RPG version should just be a 1A, not a *.  But C automatically
aligns structures, so you also have to add the ALIGN keyword
to your RPG DS.  If you don't do that, val_len will be in the
wrong position.  (

This site (Converting C prototypes to RPG) might help, if you are
still doing this in RPG: http://www.opensource400.org/callc.html
(or need to do this kind of translation in the future).

Barbara Morris

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].