char *whoami;
+#ifndef AFS_PTHREAD_ENV
extern struct ubik_client *pruclient;
+#endif
static int ignoreExist = 0;
static char line[256];
register afs_int32 code;
char op[8];
char name[PR_MAXNAMELEN];
- afs_int32 id, oid, gid;
+ afs_int32 id, oid = ANONYMOUSID, gid;
afs_int32 pos;
int i;
struct prentry entry;
/* use ubik_Call to do the work, finding an up server and handling
* the job of finding a sync site, if need be */
else
- code = ubik_Call(PR_INewEntry, pruclient, 0, name, id, oid);
+ code = ubik_PR_INewEntry(pruclient, 0, name, id, oid);
if (CodeOk(code))
com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
} else if (!strcmp(op, "sf")) {
code = PRBADARG;
else
code =
- ubik_Call(PR_SetFieldsEntry, pruclient, 0, id, mask,
+ ubik_PR_SetFieldsEntry(pruclient, 0, id, mask,
access, gq, uq, 0, 0);
if (CodeOk(code))
com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
code = PRBADARG;
else
code =
- ubik_Call(PR_ChangeEntry, pruclient, 0, id, newname, oid,
+ ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid,
newid);
if (CodeOk(code))
com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_WhereIsIt, pruclient, 0, id, &pos);
+ code = ubik_PR_WhereIsIt(pruclient, 0, id, &pos);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
else
if (GetInt32(&pos))
code = PRBADARG;
else
- code = ubik_Call(PR_DumpEntry, pruclient, 0, pos, &entry);
+ code = ubik_PR_DumpEntry(pruclient, 0, pos, &entry);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS) {
if (GetInt32(&id) || GetInt32(&gid))
code = PRBADARG;
else
- code = ubik_Call(PR_AddToGroup, pruclient, 0, id, gid);
+ code = ubik_PR_AddToGroup(pruclient, 0, id, gid);
if (CodeOk(code))
com_err(whoami, code, "on %s %d %d", op, id, gid);
} else if (!strcmp(op, "iton")) {
}
lnames.namelist_val = 0;
lnames.namelist_len = 0;
- code = ubik_Call(PR_IDToName, pruclient, 0, &lid, &lnames);
+ code = ubik_PR_IDToName(pruclient, 0, &lid, &lnames);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS) {
lnames.namelist_len = 0;
foo = line;
skip(&foo);
- for (i = 0;
- ((lnames.namelist_len < PR_MAXLIST)
- && (sscanf(foo, "%s", lnames.namelist_val[i]) != EOF));
- i++) {
+ for (i = 0; ((lnames.namelist_len < PR_MAXLIST)
+ && (sscanf(foo, "%s", lnames.namelist_val[i]) !=
+ EOF)); i++) {
lnames.namelist_len++;
skip(&foo);
}
}
lid.idlist_val = 0;
lid.idlist_len = 0;
- code = ubik_Call(PR_NameToID, pruclient, 0, &lnames, &lid);
+ code = ubik_PR_NameToID(pruclient, 0, &lnames, &lid);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS) {
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_Delete, pruclient, 0, id);
+ code = ubik_PR_Delete(pruclient, 0, id);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
} else if (!strcmp(op, "dg")) {
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_Delete, pruclient, 0, id);
+ code = ubik_PR_Delete(pruclient, 0, id);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
} else if (!strcmp(op, "rm")) {
if (GetInt32(&id) || GetInt32(&gid))
code = PRBADARG;
else
- code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, id, gid);
+ code = ubik_PR_RemoveFromGroup(pruclient, 0, id, gid);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
}
code = PRBADARG;
else
code =
- ubik_Call(PR_ListSuperGroups, pruclient, 0, id, &alist,
+ ubik_PR_ListSuperGroups(pruclient, 0, id, &alist,
&over);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_GetCPS, pruclient, 0, id, &alist, &over);
+ code = ubik_PR_GetCPS(pruclient, 0, id, &alist, &over);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS) {
hostaddr = hostinfo->h_addr_list[0];
id = ntohl(hostaddr->s_addr);
code =
- ubik_Call(PR_GetHostCPS, pruclient, 0, id, &alist, &over);
+ ubik_PR_GetHostCPS(pruclient, 0, id, &alist, &over);
}
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
code = PRBADARG;
else
code =
- ubik_Call(PR_ListElements, pruclient, 0, id, &alist,
+ ubik_PR_ListElements(pruclient, 0, id, &alist,
&over);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (GetString(name, sizeof(name)))
code = PRBADARG;
else
- code = ubik_Call(PR_NewEntry, pruclient, 0, name, 1, &id);
+ code = ubik_PR_NewEntry(pruclient, 0, name, 1, oid, &id);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS)
printf("Id is %d.\n", id);
} else if (!strcmp(op, "lm")) {
- code = ubik_Call(PR_ListMax, pruclient, 0, &id, &gid);
+ code = ubik_PR_ListMax(pruclient, 0, &id, &gid);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS)
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_SetMax, pruclient, 0, id, 0);
+ code = ubik_PR_SetMax(pruclient, 0, id, 0);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
} else if (!strcmp(op, "smg")) {
if (GetInt32(&id))
code = PRBADARG;
else
- code = ubik_Call(PR_SetMax, pruclient, 0, id, 1);
+ code = ubik_PR_SetMax(pruclient, 0, id, 1);
if (CodeOk(code))
printf("%s\n", pr_ErrorMsg(code));
} else if (!strcmp(op, "sin")) {
/* continue;*/
}
uentry.Mask = PRUPDATE_IDHASH;
- code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
+ code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
if (code) {
printf("Failed to update entry %s (err=%d)\n", name, code);
continue;
}
uentry.Mask = PRUPDATE_NAMEHASH;
code =
- ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
+ ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
if (code) {
printf("Failed to update entry with id %d (err=%d)\n", id,
code);
/* continue;*/
}
uentry.Mask = PRUPDATE_IDHASH;
- code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
+ code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
if (code) {
printf("Failed to update entry %s (err=%d)\n", name, code);
continue;
}
uentry.Mask = PRUPDATE_NAMEHASH;
code =
- ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
+ ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
if (code) {
printf("Failed to update entry with id %d (err=%d)\n", id,
code);