main(int argc, char ᑍᑍargv)
{
typedef struct attrib_struct {
int attrib_count;
Qus_Vlen_Rec_3_t keyinfo;
char key_value;
} attrib_struct;
Qus_EC_t error_code; /ᑍ Error code parameter ᑍ/
attrib_struct attrib_info; /ᑍ Attribute to change ᑍ/
char user_space[21]; /ᑍ User space and library ᑍ/
char descr[5]; /ᑍ Text description ᑍ/
char initial_value = x; /ᑍ Initial value for user spaceᑍ/
char return_lib[1]; /ᑍ Return library ᑍ/
char ret_file_lib[2]; /ᑍ Returned file and library ᑍ/
char file_and_lib[21]; /ᑍ File and library ᑍ/
char record_fmt[11]; /ᑍ Record format name ᑍ/
char ᑍspace_ptr; /ᑍ Pointer to user space objectᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
/ᑍ Start of executable code. ᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
if (argc != 4) {
printf("This program requires 3 parameters:\n");
printf(" 1) User space name and library\n");
printf(" 2) File name and library\n");
printf(" 3) Record format name\n");
printf("Please retry with those parameters.\n");
exit(1);
}
memcpy(user_space, ᑍ++argv, 2);
memcpy(file_and_lib, ᑍ++argv, 2);
memcpy(record_fmt, ᑍ++argv, 1);
memset(desc,' ',5);
memcpy(descr,"RTVFD User Space",16);
signal(SIGALL,error_handler); /ᑍ Enable the error handler ᑍ/
error_code.Bytes_Provided=; /ᑍ Have APIs return exceptions ᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
/ᑍ Create the user space. ᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
QUSCRTUS(user_space, /ᑍ User space ᑍ/
" ", /ᑍ Extended attribute ᑍ/
124, /ᑍ Initial size ᑍ/
&initial_value, /ᑍ Initial value ᑍ/
"ᑍCHANGE ", /ᑍ Public authority ᑍ/
descr, /ᑍ Text description ᑍ/
"ᑍYES ", /ᑍ Replace if it exists ᑍ/
&error_code, /ᑍ Error code ᑍ/
"ᑍUSER "); /ᑍ Domain = USER ᑍ/
if (error_flag) {
exit(1);
}
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
Appendix A. Performing Tasks Using APIs—Examples A-13