OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
store_handle_t store_h, /* Store handle. */
unsigned32 buf_size, /* Number of bytes to write. */
store_buf_t buffer, /* Data to be written. */
unsigned32 *data_size, /* To return number of bytes written. */
error_status_t *status
)
{
store_spec_t *spec; /* Our pointer to store handle. */
store_hdr_t *hdr; /* Pointer to a storelet. */
/* Do an access check on IDL_handle here... */
/* [--ORIGINAL NOTE] -- I don’t know what the above means. */
spec = (store_spec_t *)store_h; /* Get the storelet spec. */
hdr = headers + spec->number; /* Point to the correct storelet. */
/* If the amount of unused room left in the storelet is greater */
/* than what we’re supposed to write in it, write it... */
if ((hdr->size - spec->offset) > buf_size)
{
/* Copy bytes from the buffer into the storelet storage, */
/* beginning at the current read/write position... */
memcpy(hdr->storage + spec->offset, buffer, buf_size);
/* Update the storelet buffer pointer to point past what */
/* we’ve just written... */
spec->offset += buf_size;
/* Add a null in case we want to read the store as a */
/* string... */
*(hdr->storage + spec->offset) = 0;
/* Show return size of data written... */
*data_size = buf_size;
*status = error_status_ok;
return;
}
/* If we don’t have room to write the whole buffer, don’t write */
/* anything... */
*data_size = 0;
*status = error_status_ok;
}
/******
*
* print_manager_error-- Manager version. Prints text associated with
* bad status code.
*
*
******/
void
print_manager_error(
char *caller, /* String identifying routine that received the error. */
16 20 Tandem Computers Incorporated 124245