Exemple #1
0
QLStatement    *
newQLStatement(int fcm, int mode)
{
  QLStatement    *qs;
  int             x;

  qs = calloc(1, sizeof(*qs));
  if (mode == MEM_TRACKED) {
    qs->allocList = NULL;
    memAdd(qs, &x);
  } else {
    qs->allocList = malloc(16 * sizeof(void *));
    qs->allocMax = 16;
    qs->allocList[qs->allocNext++] = qs;
  }
  qs->allocMode = mode;
  qs->ft = &stmtFt;

  qs->spMax = qs->fcMax = fcm;
  qs->fClasses = (char **) qsAlloc(qs, fcm * sizeof(char *));
  qs->fClasses[0] = NULL;
  qs->spNames = (char **) qsAlloc(qs, fcm * sizeof(char *));
  qs->spNames[0] = NULL;

  return qs;
}
Exemple #2
0
char           *
sfcQueryStrcpy(char *txt, int n)
{
  int             dummy;
  char           *str = malloc(n + 1);
  memAdd(str, &dummy);
  memcpy(str, txt, n);
  str[n] = 0;
  return str;
}
static CMPIInstance *
instifyBlob(void *blob)
{
  CMPIInstance   *inst;
  int             id;

  if (blob == NULL) {
    return NULL;
  } else {
    inst = relocateSerializedInstance(blob);
    memAdd(blob, &id);
    return inst;
  }
}