81 lines
1.6 KiB
C
81 lines
1.6 KiB
C
#include <stdio.h>
|
|
//#include <stdlib.h>
|
|
//#include <string.h>
|
|
#include <stdarg.h>
|
|
|
|
#pragma pack(1)
|
|
struct wsWorkareas
|
|
{
|
|
// int *ipt1;
|
|
// int *ipt2;
|
|
// int *ipt3;
|
|
short i0;
|
|
char pt[10];
|
|
int i1;
|
|
};
|
|
#pragma pack()
|
|
|
|
//void STEST1901(char *s, ...)
|
|
void STEST1901(int j, ...)
|
|
{
|
|
// char buf[1024];
|
|
int i;
|
|
char buf1[512];
|
|
char buf2[512];
|
|
va_list arg_ptr;
|
|
|
|
fprintf(stdout, "sub (test15l) C1901: debug 1\n");
|
|
|
|
/* Build the string list */
|
|
strcpy(buf2, "");
|
|
va_start(arg_ptr, j);
|
|
// va_start(argptr,s);
|
|
// fprintf(stdout, "sub (test15l) C1901: after va_start\n");
|
|
// vsprintf (buf, s, argptr);
|
|
for(i=1; i<=j; i++) {
|
|
// sprintf(buf1, "%d ", va_arg(arg_ptr, int));
|
|
sprintf(buf1, "%s:", va_arg(arg_ptr, char*));
|
|
strcat(buf2, buf1);
|
|
}
|
|
va_end (argptr);
|
|
fprintf(stdout, "sub (test15l) C1901: debug 3: str=%s;\n", buf2);
|
|
|
|
fprintf(stdout, "sub (test15l) C1901: debug 5\n");
|
|
|
|
}
|
|
|
|
void STEST1902(char *s)
|
|
{
|
|
char buf1[512] = "void STEST1902(void) 1";
|
|
char buf2[512] = "void STEST1902(void) 2";
|
|
|
|
// fprintf(stdout, "sub (test15l) C1902: s=%s;\n", s);
|
|
|
|
// fprintf(stdout, "sub (test15l) C1902: before call\n");
|
|
|
|
STEST1901(2, buf2, buf1);
|
|
|
|
// fprintf(stdout, "sub (test15l) C1902: after call\n");
|
|
|
|
}
|
|
|
|
void STEST1903(char *s)
|
|
{
|
|
// char buf[512] = "void STEST19032(void) 1";
|
|
|
|
fprintf(stdout, "sub (test15l) C1903: s=%s;\n", s);
|
|
|
|
}
|
|
|
|
void STEST1904(char *s)
|
|
{
|
|
// char buf[512] = "void STEST19032(void) 1";
|
|
struct wsWorkareas *wa;
|
|
wa = (struct wsWorkareas*)s;
|
|
// wa = s;
|
|
|
|
fprintf(stdout, "sub (test15l) C1904: wa->pt=%s; wa->i0=%d; wa->i1=%d;\n", wa->pt, wa->i0, wa->i1);
|
|
wa->i0 = 65;
|
|
}
|
|
|