本文整理汇总了C++中quotefmtinstall函数的典型用法代码示例。如果您正苦于以下问题:C++ quotefmtinstall函数的具体用法?C++ quotefmtinstall怎么用?C++ quotefmtinstall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quotefmtinstall函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
void
main(void)
{
memset(edata, 0, (ulong)end-(ulong)edata);
conf.nmach = 1;
machinit();
confinit();
xinit();
trapinit();
mmuinit();
plan9iniinit();
hwintrinit();
clockinit();
timerinit();
console();
quotefmtinstall();
printinit();
cpuidprint();
print("\nPlan 9 from Bell Labs\n");
procinit0();
initseg();
timersinit();
links();
chandevreset();
pageinit();
swapinit();
sharedseginit();
fpsave(&initfp);
initfp.fpscr = 0;
userinit();
schedinit();
}
开发者ID:99years,项目名称:plan9,代码行数:32,代码来源:main.c
示例2: threadmain
void
threadmain(int argc, char **argv)
{
char *net;
//extern long _threaddebuglevel;
//_threaddebuglevel = 1<<20; /* DBGNOTE */
rfork(RFNOTEG);
ARGBEGIN{
case 'D':
chatty9p++;
break;
case 'n':
setexecname(EARGF(usage()));
break;
}ARGEND
switch(argc){
default:
usage();
case 0:
net = "/net";
break;
case 1:
net = argv[0];
break;
}
quotefmtinstall();
initfs();
threadpostmountsrv(&fs, nil, net, MBEFORE);
threadexits(nil);
}
开发者ID:Requaos,项目名称:harvey,代码行数:35,代码来源:main.c
示例3: main
void
main(int argc, char **argv)
{
RSApriv *key;
Attr *a;
char *s;
fmtinstall('A', _attrfmt);
fmtinstall('B', mpfmt);
quotefmtinstall();
ARGBEGIN{
default:
usage();
}ARGEND
if(argc > 1)
usage();
if((key = getkey(argc, argv, 0, &a)) == nil)
sysfatal("%r");
s = smprint("key %A size=%d ek=%lB n=%lB\n",
a,
mpsignif(key->pub.n), key->pub.ek, key->pub.n);
if(s == nil)
sysfatal("smprint: %r");
write(1, s, strlen(s));
exits(nil);
}
开发者ID:00001,项目名称:plan9port,代码行数:30,代码来源:rsa2pub.c
示例4: main
void
main(int argc, char **argv)
{
char *patternpath;
ARGBEGIN {
case 'd':
debug++;
break;
} ARGEND;
quotefmtinstall();
if(argc < 3)
usage();
patternpath = argv[1];
readpatterns(patternpath);
if(strcmp(argv[0], "add") == 0)
exits(add(patternpath, argc-2, argv+2));
else if(strcmp(argv[0], "check") == 0)
exits(check(argc-2, argv+2));
else
usage();
}
开发者ID:AustenConrad,项目名称:plan-9,代码行数:25,代码来源:list.c
示例5: main
void
main(int argc, char **argv)
{
DSApriv *key;
Attr *a;
char *s;
fmtinstall('A', _attrfmt);
fmtinstall('B', mpfmt);
quotefmtinstall();
ARGBEGIN{
default:
usage();
}ARGEND
if(argc > 1)
usage();
if((key = getdsakey(argc, argv, 0, &a)) == nil)
sysfatal("%r");
s = smprint("key %A p=%lB q=%lB alpha=%lB key=%lB\n",
a,
key->pub.p, key->pub.q, key->pub.alpha, key->pub.key);
if(s == nil)
sysfatal("smprint: %r");
write(1, s, strlen(s));
exits(nil);
}
开发者ID:00001,项目名称:plan9port,代码行数:30,代码来源:dsa2pub.c
示例6: main
void
main(int argc, char **argv)
{
Avlwalk *w;
Biobuf bout;
Entry *e;
quotefmtinstall();
ARGBEGIN{
default:
usage();
}ARGEND
if(argc != 1)
usage();
Binit(&bout, 1, OWRITE);
db = opendb(argv[0]);
w = avlwalk(db->avl);
while(e = (Entry*)avlnext(w))
Bprint(&bout, "%q %q %luo %q %q %lud %lld\n",
e->name, strcmp(e->name, e->d.name)==0 ? "-" : e->d.name, e->d.mode,
e->d.uid, e->d.gid, e->d.mtime, e->d.length);
if(Bterm(&bout) < 0)
sysfatal("writing output: %r");
exits(nil);
}
开发者ID:99years,项目名称:plan9,代码行数:28,代码来源:compactdb.c
示例7: main
void
main(int argc, char *argv[])
{
char *opt, *p;
char *enva[20];
int envc;
if(coherence == nil)
coherence = nofence;
quotefmtinstall();
savestartup(argc, argv);
/* set default root now, so either $EMU or -r can override it later */
if((p = getenv("INFERNO")) != nil || (p = getenv("ROOT")) != nil)
strecpy(rootdir, rootdir+sizeof(rootdir), p);
opt = getenv("EMU");
if(opt != nil && *opt != '\0') {
enva[0] = "emu";
envc = tokenize(opt, &enva[1], sizeof(enva)-1) + 1;
enva[envc] = 0;
option(envc, enva, envusage);
}
option(argc, argv, usage);
eve = strdup("inferno");
opt = "interp";
if(cflag)
opt = "compile";
if(vflag)
print("Inferno %s main (pid=%d) %s\n", VERSION, getpid(), opt);
libinit(imod);
}
开发者ID:Mekapaedia,项目名称:inferno-rpi,代码行数:33,代码来源:main.c
示例8: auth_proxy
AuthInfo*
auth_proxy(int fd, AuthGetkey *getkey, char *fmt, ...)
{
int afd;
char *p;
va_list arg;
AuthInfo *ai;
AuthRpc *rpc;
quotefmtinstall(); /* just in case */
va_start(arg, fmt);
p = vsmprint(fmt, arg);
va_end(arg);
afd = open("/mnt/factotum/rpc", ORDWR);
if(afd < 0){
werrstr("opening /mnt/factotum/rpc: %r");
free(p);
return nil;
}
rpc = auth_allocrpc(afd);
if(rpc == nil){
free(p);
return nil;
}
ai = fauth_proxy(fd, rpc, getkey, p);
free(p);
auth_freerpc(rpc);
close(afd);
return ai;
}
开发者ID:99years,项目名称:plan9,代码行数:33,代码来源:auth_proxy.c
示例9: main
void
main(void)
{
cgapost(0);
mach0init();
options();
ioinit();
i8250console();
quotefmtinstall();
screeninit();
print("\nPlan 9\n");
trapinit0();
mmuinit0();
kbdinit();
i8253init();
cpuidentify();
meminit();
confinit();
archinit();
if(!isa20on())
panic("bootstrap didn't leave a20 address line enabled");
xinit();
if(i8237alloc != nil)
i8237alloc();
trapinit();
printinit();
cpuidprint();
mmuinit();
fpsavealloc();
if(arch->intrinit) /* launches other processors on an mp */
arch->intrinit();
timersinit();
mathinit();
kbdenable();
if(arch->clockenable)
arch->clockenable();
procinit0();
initseg();
if(delaylink){
bootlinks();
pcimatch(0, 0, 0);
}else
links();
conf.monitor = 1;
chandevreset();
cgapost(0xcd);
pageinit();
i8253link();
swapinit();
userinit();
active.thunderbirdsarego = 1;
cgapost(0x99);
schedinit();
}
开发者ID:carriercomm,项目名称:plan9-gpl,代码行数:59,代码来源:main.c
示例10: threadmain
void
threadmain(int argc, char *argv[])
{
int i, n;
unsigned char score[VtScoreSize];
unsigned char *buf;
VtConn *z;
char *host;
VtRoot root;
fmtinstall('F', vtfcallfmt);
fmtinstall('V', vtscorefmt);
quotefmtinstall();
host = nil;
ARGBEGIN{
case 'h':
host = EARGF(usage());
break;
default:
usage();
break;
}ARGEND
if(argc == 0)
usage();
buf = vtmallocz(VtMaxLumpSize);
z = vtdial(host);
if(z == nil)
sysfatal("could not connect to server: %r");
if(vtconnect(z) < 0)
sysfatal("vtconnect: %r");
for(i=0; i<argc; i++){
if(vtparsescore(argv[i], nil, score) < 0){
fprint(2, "cannot parse score '%s': %r\n", argv[i]);
continue;
}
n = vtread(z, score, VtRootType, buf, VtMaxLumpSize);
if(n < 0){
fprint(2, "could not read block %V: %r\n", score);
continue;
}
if(n != VtRootSize){
fprint(2, "block %V is wrong size %d != 300\n", score, n);
continue;
}
if(vtrootunpack(&root, buf) < 0){
fprint(2, "unpacking block %V: %r\n", score);
continue;
}
print("%V: %q %q %V %d %V\n", score, root.name, root.type, root.score, root.blocksize, root.prev);
}
vthangup(z);
threadexitsall(0);
}
开发者ID:aahud,项目名称:harvey,代码行数:59,代码来源:root.c
示例11: main
void
main(int argc, char *argv[]) {
int i;
quotefmtinstall();
for(i = 1; i < argc; i++) {
print("%q: %ud\n", argv[i], hash(argv[i]));
}
exits(nil);
}
开发者ID:captain-spanner,项目名称:rosetta-stoned,代码行数:10,代码来源:hashtest.c
示例12: formatinit
void
formatinit(void)
{
quotefmtinstall();
// fmtinstall('Y', Yfmt); /* print channels */
fmtinstall('Z', Zfmt); /* print devices */
fmtinstall('G', Gfmt); /* print tags */
fmtinstall('T', Tfmt); /* print times */
// fmtinstall('E', eipfmt); /* print ether addresses */
fmtinstall('I', eipfmt); /* print ip addresses */
}
开发者ID:npe9,项目名称:harvey,代码行数:11,代码来源:sub.c
示例13: main
void
main(int argc, char **argv)
{
int i, dostdin;
char *p;
Rune *r;
Rune buf[2];
Binit(&bout, 1, OWRITE);
fmtinstall('L', linefmt);
quotefmtinstall();
tmacdir = unsharp("#9/tmac");
dostdin = 0;
ARGBEGIN{
case 'i':
dostdin = 1;
break;
case 'm':
r = erunesmprint("%s/tmac.%s", tmacdir, EARGF(usage()));
if(queueinputfile(r) < 0)
fprint(2, "%S: %r\n", r);
break;
case 'r':
p = EARGF(usage());
p += chartorune(buf, p);
buf[1] = 0;
_nr(buf, erunesmprint("%s", p+1));
break;
case 'u':
utf8 = 1;
break;
case 'v':
verbose = 1;
break;
default:
usage();
}ARGEND
for(i=0; i<argc; i++){
if(strcmp(argv[i], "-") == 0)
queuestdin();
else
queueinputfile(erunesmprint("%s", argv[i]));
}
if(argc == 0 || dostdin)
queuestdin();
run();
Bprint(&bout, "\n");
Bterm(&bout);
exits(nil);
}
开发者ID:00001,项目名称:plan9port,代码行数:53,代码来源:main.c
示例14: pop3mbox
//
// open mailboxes of the form /pop/host/user or /apop/host/user
//
char*
pop3mbox(Mailbox *mb, char *path)
{
char *f[10];
int nf, apop, ppop, popssl, apopssl, apoptls, popnotls, apopnotls, poptls;
Pop *pop;
quotefmtinstall();
popssl = strncmp(path, "/pops/", 6) == 0;
apopssl = strncmp(path, "/apops/", 7) == 0;
poptls = strncmp(path, "/poptls/", 8) == 0;
popnotls = strncmp(path, "/popnotls/", 10) == 0;
ppop = popssl || poptls || popnotls || strncmp(path, "/pop/", 5) == 0;
apoptls = strncmp(path, "/apoptls/", 9) == 0;
apopnotls = strncmp(path, "/apopnotls/", 11) == 0;
apop = apopssl || apoptls || apopnotls || strncmp(path, "/apop/", 6) == 0;
if(!ppop && !apop)
return Enotme;
path = strdup(path);
if(path == nil)
return "out of memory";
nf = getfields(path, f, nelem(f), 0, "/");
if(nf != 3 && nf != 4) {
free(path);
return "bad pop3 path syntax /[a]pop[tls|ssl]/system[/user]";
}
pop = emalloc(sizeof(*pop));
pop->freep = path;
pop->host = f[2];
if(nf < 4)
pop->user = nil;
else
pop->user = f[3];
pop->ppop = ppop;
pop->needssl = popssl || apopssl;
pop->needtls = poptls || apoptls;
pop->refreshtime = 60;
pop->notls = popnotls || apopnotls;
pop->thumb = initThumbprints("/sys/lib/tls/mail", "/sys/lib/tls/mail.exclude");
mb->aux = pop;
mb->sync = pop3sync;
mb->close = pop3close;
mb->ctl = pop3ctl;
mb->d = emalloc(sizeof(*mb->d));
return nil;
}
开发者ID:AustenConrad,项目名称:plan-9,代码行数:55,代码来源:pop3.c
示例15: auth_getuserpasswd
UserPasswd*
auth_getuserpasswd(AuthGetkey *getkey, char *fmt, ...)
{
AuthRpc *rpc;
char *f[3], *p, *params;
int fd;
va_list arg;
UserPasswd *up;
up = nil;
rpc = nil;
params = nil;
fd = open("/mnt/factotum/rpc", ORDWR);
if(fd < 0)
goto out;
rpc = auth_allocrpc(fd);
if(rpc == nil)
goto out;
quotefmtinstall(); /* just in case */
va_start(arg, fmt);
params = vsmprint(fmt, arg);
va_end(arg);
if(params == nil)
goto out;
if(dorpc(rpc, "start", params, strlen(params), getkey) != ARok
|| dorpc(rpc, "read", nil, 0, getkey) != ARok)
goto out;
rpc->arg[rpc->narg] = '\0';
if(tokenize(rpc->arg, f, 2) != 2){
werrstr("bad answer from factotum");
goto out;
}
up = malloc(sizeof(*up)+rpc->narg+1);
if(up == nil)
goto out;
p = (char*)&up[1];
strcpy(p, f[0]);
up->user = p;
p += strlen(p)+1;
strcpy(p, f[1]);
up->passwd = p;
out:
free(params);
auth_freerpc(rpc);
close(fd);
return up;
}
开发者ID:AustenConrad,项目名称:plan-9,代码行数:51,代码来源:auth_getuserpasswd.c
示例16: main
void
main(int argc, char **argv)
{
char *file;
file = nil;
quotefmtinstall();
time0 = time(0);
if(NPTR != BLKSZ/sizeof(void*))
sysfatal("unexpected pointer size");
ARGBEGIN{
case 'D':
chatty9p++;
break;
case 'f':
file = EARGF(usage());
break;
case 'r':
rdonly = 1;
break;
case 's':
srvname = EARGF(usage());
break;
case 'm':
mtpt = EARGF(usage());
break;
default:
usage();
}ARGEND
if(argc > 1)
usage();
if(argc == 1)
sdname = argv[0];
if(file){
if((fd = open(file, rdonly ? OREAD : ORDWR)) < 0)
sysfatal("open %s: %r", file);
}
inquiry = estrdup9p(inquiry);
tab[0].name = estrdup9p("data");
tab[0].inuse = 1;
tab[0].mode = 0666;
postmountsrv(&fs, srvname, mtpt, MBEFORE);
exits(nil);
}
开发者ID:99years,项目名称:plan9,代码行数:49,代码来源:disksim.c
示例17: main
void
main(void)
{
extern char edata[], end[];
uint rev;
okay(1);
m = (Mach*)MACHADDR;
memset(edata, 0, end - edata); /* clear bss */
machinit();
mmuinit1();
optionsinit("/boot/boot boot");
quotefmtinstall();
ataginit((Atag*)BOOTARGS);
confinit(); /* figures out amount of memory */
xinit();
uartconsinit();
screeninit();
print("\nPlan 9 from Bell Labs\n");
rev = getfirmware();
print("firmware: rev %d\n", rev);
if(rev < Minfirmrev){
print("Sorry, firmware (start.elf) must be at least rev %d (%s)\n",
Minfirmrev, Minfirmdate);
for(;;)
;
}
trapinit();
clockinit();
printinit();
timersinit();
cpuidprint();
archreset();
procinit0();
initseg();
links();
chandevreset(); /* most devices are discovered here */
pageinit();
swapinit();
userinit();
gpiomeminit();
schedinit();
assert(0); /* shouldn't have returned */
}
开发者ID:mischief,项目名称:9problems,代码行数:48,代码来源:main.c
示例18: threadmain
void
threadmain(int argc, char **argv)
{
char args[Arglen];
char *as, *ae;
int accel, pena, devid;
int csps[] = { KbdCSP, PtrCSP, 0 };
quotefmtinstall();
pena = 1;
ae = args+sizeof(args);
as = seprint(args, ae, "kb");
ARGBEGIN{
case 'a':
accel = strtol(EARGF(usage()), nil, 0);
as = seprint(as, ae, " -a %d", accel);
break;
case 'd':
usbdebug++;
as = seprint(as, ae, " -d");
break;
case 'k':
as = seprint(as, ae, " -k");
pena = 0;
break;
case 'm':
as = seprint(as, ae, " -m");
pena = 1;
break;
case 'N':
devid = atoi(EARGF(usage())); /* ignore dev number */
USED(devid);
break;
case 'b':
as = seprint(as, ae, " -b");
break;
default:
usage();
}ARGEND;
rfork(RFNOTEG);
fmtinstall('U', Ufmt);
threadsetgrp(threadid());
if(pena == 0)
csps[1] = 0;
startdevs(args, argv, argc, matchdevcsp, csps, kbmain);
threadexits(nil);
}
开发者ID:npe9,项目名称:harvey,代码行数:48,代码来源:main.c
示例19: auth_respond
int
auth_respond(void *chal, uint nchal, char *user, uint nuser, void *resp, uint nresp, AuthGetkey *getkey, char *fmt, ...)
{
char *p, *s;
va_list arg;
int afd;
AuthRpc *rpc;
Attr *a;
if((afd = open("/mnt/factotum/rpc", ORDWR)) < 0)
return -1;
if((rpc = auth_allocrpc(afd)) == nil){
close(afd);
return -1;
}
quotefmtinstall(); /* just in case */
va_start(arg, fmt);
p = vsmprint(fmt, arg);
va_end(arg);
if(p==nil
|| dorpc(rpc, "start", p, strlen(p), getkey) != ARok
|| dorpc(rpc, "write", chal, nchal, getkey) != ARok
|| dorpc(rpc, "read", nil, 0, getkey) != ARok){
free(p);
close(afd);
auth_freerpc(rpc);
return -1;
}
free(p);
if(rpc->narg < nresp)
nresp = rpc->narg;
memmove(resp, rpc->arg, nresp);
if((a = auth_attr(rpc)) != nil
&& (s = _strfindattr(a, "user")) != nil && strlen(s) < nuser)
strcpy(user, s);
else if(nuser > 0)
user[0] = '\0';
_freeattr(a);
close(afd);
auth_freerpc(rpc);
return nresp;
}
开发者ID:AustenConrad,项目名称:plan-9,代码行数:48,代码来源:auth_respond.c
示例20: main
void
main(void)
{
hwrpb = (Hwrpb*)0x10000000;
hwrpb = (Hwrpb*)(KZERO|hwrpb->phys);
arginit();
machinit();
options();
ioinit();
clockinit();
confinit();
archinit();
xinit();
memholes();
if(i8237alloc != nil)
i8237alloc();
mmuinit();
if(arch->coreinit)
arch->coreinit();
trapinit();
screeninit();
printinit();
/* it's now safe to print */
/* dumpopts(); /* DEBUG */
i8250console();
quotefmtinstall();
print("\nPlan 9\n");
cpuidprint();
if(arch->corehello)
arch->corehello();
procinit0();
initseg();
timersinit();
links();
chandevreset();
pageinit();
swapinit();
savefpregs(&initfp);
initfp.fpstatus = 0x68028000;
userinit();
schedinit();
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:44,代码来源:main.c
注:本文中的quotefmtinstall函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论