/\

 

 

 

 

\/

/\

APIs Used:

QUSLSPL

- List Spooled Files

\/

/\

 

QUSCRTUS

-

Create User Space

\/

/\

 

QUSPTRUS

-

Retrieve Pointer to User Space

\/

/\

 

 

 

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

#include <stdio.h>

 

 

#include <string.h>

 

 

#include <quslspl.h>

/\ QUSLSPL API header

\/

#include <quscrtus.h>

/\ QUSCRTUS API header

\/

#include <qusptrus.h>

/\ QUSPTRUS API header

\/

#include <qusgen.h>

/\ Format Structures for User Space .11/ \/

#include <qusec.h>

/\ Error Code parameter include for APIs \/

#include <qliept.h>

/\ Entry Point Table include for APIs

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Global variables\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

char

spc_name[2ð] = "SPCNAME

QTEMP

";

 

int

spc_size =

2ððð;

 

 

 

 

char

spc_init =

ðxðð;

 

 

 

 

char

\spcptr, \lstptr,

\lstptr2;

 

 

int

pages;

 

 

 

 

 

struct

keys { int

key1;

 

 

 

.7/

 

int

key2;

 

 

 

 

 

int

key3;} keys = {2ð1, 211, 216};

.8/

int

number_of_keys =

3;

 

 

 

char

ext_attr[1ð] = "QUSLSPL

";

 

 

char

spc_aut[1ð] = "\ALL

";

 

 

char

spc_text[5ð] = "

 

 

 

";

char

spc_replac[1ð] =

"\YES

";

 

 

char

spc_domain[1ð] = "\USER

";

 

 

char

format[8] = "SPLFð2ðð";

 

.4/

 

char

usr_prf[1ð] = "\CURRENT

";

 

 

char

outq[2ð] =

"\ALL

 

";

 

 

char

formtyp[1ð] = "\ALL

";

 

 

char

usrdta[1ð]

= "\ALL

";

 

 

char

jobnam[26]

= "

 

 

";

 

char

prtfil[1ð];

 

 

 

 

 

char

opndat[7];

 

 

 

 

 

typedef

struct {

 

 

 

 

 

 

Qus_LSPL_Key_Info_t Key_Info;

 

 

 

char

 

Data_Field[1ðð];

 

 

}var_record_t;

Qus_EC_t error_code;

int

i, j;

char

prtlin[1ðð];

FILE

\record;

main()

{

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Open print file for report\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

if((record = fopen("QPRINT", "wb, lrecl=132, type=record")) == NUL￿L) { printf("File QPRINT could not be opened\n");

B-34System API Programming V4R1

Page 312
Image 312
IBM Version 4 manual Quslspl, Qtemp