On Tue, 19 Dec 2006 08:49:27 -0700, Steve Comstock
<[EMAIL PROTECTED]> wrote:
>
> address link pgm parm_string
>
>C does not like this. I cannot seem to find a
>combination of code and compiler options that
>let me access and printf the parm string and
>the length. Does anyone have an example of
>doing this, or see how to do it?
Hi Steve,
How about something like this...
#define MAX(a,b) (((a)>(b))?(a):(b))
#pragma environment(RXCLINK)
#pragma runopts(PLIST(OS))
struct argtable_entry {
void *argstring_ptr; /* Address of the argument string */
int argstring_length; /* Length of the argument string */
};
int RXCLINK(struct argtable_entry * argp) {
char * ts[256];
strncpy(ts, argp->argstring_ptr, MAX(argp->argstring_length,sizeof(ts-1)));
ts[255] = 0;
printf(ts);
return(0);
}
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html