clear



Summary

#include <dataman/dataman.h>

clear(idx_name);

char *idx_name;

Description
The clear function removes the protection from a data record, allowing the user to "check in" a record that has been protected. It references the named index's MFRP and operates on that record. This is an unconditional clear; it will clear any protected record, regardless of who initiated the protect. The server keeps track of records that the client has protected, and in case of an abnormal termination tries to clear any records the client had left protected.

Example

    #include <dataman/dataman.h>

    main(int argc, char *argv[])
    {

        key k_buff;
          ...
        get(idx1,k_buff) else {
            pause(10,10,"Can't find key");
            exit(0);
        }
        while(1) {
            protect(idx1) else {    /* protect rec */
                waste_time();       /* pend */
                continue;           /* try again */
            }
            break;                  /* got protection */
        }
          ...                       /* process record */
        clear(idx1);                /* clear protect */
    }

«previous  next»