Oh ... with integer I meant 10I 0 and 10U 0.

-----Original Message-----
From: c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx
[mailto:c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx] On
Behalf Of Schmidt, Mihael
Sent: Wednesday, July 01, 2009 3:13 PM
To: C programming iSeries / AS400
Subject: Re: [C400-L] Porting ClearSilver

I have compiled the module again with the options and got:

CSTOKEN_TYPE Class = typedef, Length = 4, Type =
enum with no tag

31-94.3$ 31-111.3 31-146.3 0-897.3
0-906.3

0-1089.1 0-1102.32 0-1948.75
0-2040.72 0-2092.73

I assume that the enum CSTOKEN_TYPE is an integer (signed or unsigned,
but probably signed). Is that right?

Thanx in advance

Mihael Schmidt

-----Original Message-----
From: c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx
[mailto:c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx] On
Behalf Of Barbara Morris
Sent: Tuesday, June 30, 2009 8:02 PM
To: c400-l@xxxxxxxxxxxx
Subject: Re: [C400-L] Porting ClearSilver

Schmidt, Mihael wrote:
...
Also I am standing before the task of creating procedure prototypes
for RPG and am having some difficulties, especially with the data
structures.

typedef struct _neo_err
{
...
/* internal use only */
struct _neo_err *next;
} NEOERR;

Here the structure has a subfield with the type of itself ( struct
_neo_err *next). AFAIK this is not possible in RPG. Is there a
workaround?

RPG doesn't have typed pointers, so you would just define next as a
pointer.

D neoerr1 ds likeds(NEOERR)
D based(pNeoerr1)

pNeoerr1 = address of the first structure;
dow pNeoerr1 <> *null;
--- work with neoerr1 ---
pNeoerr1 = neoerr1.next;
enddo;


typedef enum
{
/* Unary operators */
CS_OP_NONE = (1<<0),
CS_OP_EXISTS = (1<<1),
CS_OP_NOT = (1<<2),
CS_OP_NUM = (1<<3),
...

} CSTOKEN_TYPE;

typedef struct _arg
{
CSTOKEN_TYPE op_type;
char *argexpr;
...
} CSARG;

How would I define the CSTOKEN_TYPE subfield in an RPG data structure?


The actual type of an C enum depends on your compile options (ENUM
parameter) and on the enum values. Compile the C version of the enum
and struct with OPTION(*AGR *XREF) and find out the size and type that C

is using for the enum and subfield. It will be either 1, 2, 4, 8 byte
integer or unsigned, that will map to one of RPG's 3i, 5i,10i, 20i, 3u,
5u, 10u or 20u.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.