static int
testNameSpace(const char *ns, CMPIStatus *st)
{
  char          **nsp = nsTab;

  if (interOpProvInfoPtr == forceNoProvInfoPtr) {
    if (strcasecmp(ns, interopNs) == 0) {
      st->msg =
          sfcb_native_new_CMPIString("Interop namespace disabled", NULL,
                                     0);
      st->rc = CMPI_RC_ERR_FAILED;
      return 0;
    }
  }

  while (nsTabLen && *nsp) {
    if (strcasecmp(*nsp, ns) == 0)
      return 1;
    nsp++;
  }
  if (existingNameSpace(ns)) {
    nsTab = nsp = realloc(nsTab, sizeof(nsp) * (nsTabLen + 2));
    nsp[nsTabLen++] = strdup(ns);
    nsp[nsTabLen] = NULL;
    return 1;
  }

  st->rc = CMPI_RC_ERR_INVALID_NAMESPACE;
  return 0;
}
示例#2
0
int
main()
{
  if (existingNameSpace(ns) == 0) {
    printf("--- namspace %s does not exist\n", ns);
    exit(1);
  }
  addBlob(ns, "class1", o1, o1, strlen(o1));
  addBlob(ns, "class1", o2, o2, strlen(o2));
  addBlob(ns, "class1", o3, o3, strlen(o3));
  addBlob(ns, "class1", o4, o4, strlen(o4));
  addBlob(ns, "class1", o2, o2, strlen(o2));
  deleteBlob(ns, "class1", o2);
  deleteBlob(ns, "class1", o1);
  deleteBlob(ns, "class1", o4);
  printf("--- %s\n", (char *) getBlob(ns, "class1", o3, NULL));
  deleteBlob(ns, "class1", o3);
}