IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2009, 1:32:48 PM (17 years ago)
Author:
jhoblitt
Message:

stub out nebThereCanBeOnlyOne()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/nebclient.c

    r24923 r24931  
    883883}
    884884
     885int nebThereCanBeOnlyOne(nebServer *server, const char *key, const char *volume)
     886{
     887    REQUIRE_SERVER;
     888
     889    if (!key) {
     890        nebSetErr(server, "parameter 'key' may not be NULL");
     891
     892        return -1;
     893    }
     894
     895    if (nebPrune(server, key) < 0 ) {
     896    }
     897
     898    nebObjectInstances *locations = NULL;
     899    if (volume) {
     900        locations = nebFindInstances(server, key, NULL);
     901    }
     902
     903    if (locations && locations->n) {
     904        nebObjectInstances *instances = nebFindInstances(server, key, NULL);
     905        for (long i = 0; i < instances->n; i++) {
     906            if (strcmp(locations->URI[0], instances->URI[i])) {
     907                nebDeleteInstance(server, key, instances->URI[i]);
     908            }
     909        }
     910        nebObjectInstancesFree(instances);
     911    }
     912    nebObjectInstancesFree(locations);
     913
     914
     915    return 0;
     916}
     917
    885918
    886919char *nebErr(nebServer *server)
Note: See TracChangeset for help on using the changeset viewer.