OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-46
Example 1 in C—Updating a Remote File (in Nowait
Mode)
1325 /***************************************************************/
1326 /* Initialize a pointer to the data-element header. Then set */
1327 /* the length of the data to be transferred and the type of */
1328 /* data to be transferred. The data length is returned from */
1329 /* the local file-system read. The data type is set to text */
1330 /* in this example. */
1331 /***************************************************************/
1332
1333 element_hdr_ptr=(zaps_ddl_data_element_hdr_def *)((char*)data_hdr_ptr +
1334 sizeof (zaps_ddl_data_hdr_def));
1335 element_hdr_ptr->zlen = (long) buf_count_transferred;
1336 element_hdr_ptr->ztype = ZFTM_VAL_DE_TEXT;
1337
1338 /***************************************************************/
1339 /* Initialize a pointer to the data portion of the buffer */
1340 /* that follows the data header and data-element header. Copy */
1341 /* the data from the local read buffer into the data buffer. */
1342 /***************************************************************/
1343
1344 data_ptr = (char *) element_hdr_ptr +
1345 sizeof (zaps_ddl_data_element_hdr_def);
1346 memcpy (data_ptr, local_buffer, buf_count_transferred);
1347
1348 /***************************************************************/
1349 /* Issue the FTM data-request primitive. */
1350 /***************************************************************/
1351
1352 status = FTM_DATA_REQ_ ( cepi
1353 , (char *) &remote_buffer
1354 , (long) DATA_TAG );
1355
1356 check_status ();
1357
1358 /***************************************************************/
1359 /* Indicate that an FTM data request is in progress. */
1360 /***************************************************************/
1361
1362 remote_io_cmplt = FALSE;
1363