put_blob



Summary

#include <dataman/dataman.h>

int put_blob(field, blob, size) else ...

char *field;
void *blob;
int size;

Description

Since there is no blob data, and thus no analagous verb in EDITOR, this can not follow any EDITOR calling sequence.

This procedure will put a blob into a data field. The field argument is the field entry that you want to replace ie, mfld[n]. The blob argument is a void pointer to the blob you want to replace that field with, and size is the size of data contained in the blob. If the field is not a member of either the master or work record, the field wasn't defined to contain a blob, or memory to contain the blob could not be allocated, 0 is returned. Otherwise the old contents of the field is replaced with the new blob, the record is marked to be flushed, and 1 is returned. A data record that contains blob data is limited to 2Gb.

Example

    #include <dataman/dataman.h>

    main(int argc, char *argv[])
    {
        key k_buff;
        some_struct val;
          ...
        move(k_buff,stat_key,strlen(stat_key));
        get(idx1,k_buff) else
            fatal("Statistic record key not found","");
        if (!put_blob(mfld[4], (void *)&val), size)
            fatal("Error saving statistics blob!","");
          ...
    }

«previous  next»