OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-16
Example 1 in C—Updating a Remote File (in Nowait
Mode)
154 /**********************************************************************/
155
156 #define NOCEPI -1 /* Indicates no valid CEPI */
157 #define NOWAIT 0 /* Indicates nowait mode */
158 #define WAIT_FOREVER -1 /* MFM_AWAITIOX_ wait value */
159 #define FALSE 0 /* Boolean value for FALSE */
160 #define TRUE 1 /* Boolean value for TRUE */
161 #define MAX_RECORDS 5 /* Maximum number of records */
162 #define BASE 10 /* Used with NUMOUT as base */
163 #define WIDTH 5 /* Width of NUMOUT field */
164 #define MAX_BUF 250 /* Maximum bytes to send */
165 #define MAX_READ_COUNT 132 /* Maximum bytes to read */
166 #define OPEN_FLAGS 1 /* Open for nowait read */
167
168 /**********************************************************************/
169 /* Miscellaneous variables */
170 /**********************************************************************/
171
172 int event_code; /* FTAM event code */
173 long tag; /* Tag value for nowait I/O operation */
174 int records = 0; /* Number of records sent */
175 int local_filenum; /* Local file number */
176 int cepi = NOCEPI; /* Connection endpoint ID */
177 int wait_mode; /* Wait or nowait mode */
178 int condition_code; /* Condition code */
179
180 /***********************************************************************/
181 /* Local and remote buffer pointers */
182 /**********************************************************************/
183
184 char local_buffer[MAX_READ_COUNT]; /* Used for Guardian read */
185 char remote_buffer[MAX_BUF]; /* Used for FTM data request */
186 char *data_ptr; /* Points into remote_buffer */
187
188 /**********************************************************************/
189 /* Variables used by the MFM_AWAITIOX_ procedure */
190 /**********************************************************************/
191
192 int filenum; /* Returned from MFM_AWAITIOX_ */