本文整理汇总了C++中vec::base方法的典型用法代码示例。如果您正苦于以下问题:C++ vec::base方法的具体用法?C++ vec::base怎么用?C++ vec::base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec
的用法示例。
在下文中一共展示了vec::base方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: warn
static void
restart ()
{
if (hup_lock)
return;
hup_lock = true;
warn ("version %s, pid %d, restarted with SIGHUP\n", VERSION,
int (getpid ()));
server *s, *ns;
for (s = serverlist.first; s; s = ns) {
ns = serverlist.next (s);
serverlist.remove (s);
delete s;
}
for (sfssrv *nsp, *sp = services.first; sp; sp = nsp) {
nsp = services.next (sp);
delete sp;
}
for (sockaddr **sap = listenaddrs.base (); sap < listenaddrs.lim (); sap++)
xfree (*sap);
listenaddrs.clear ();
listeners.clear ();
parseconfig ();
delaycb (0, 100000000, wrap (launchservers));
}
示例2: covered
bool
extension::covered (const vec<str> &ev)
{
bhash<str> eh;
for (const str *ep = ev.base (); ep < ev.lim (); ep++)
eh.insert (*ep);
return covered (eh);
}
示例3: finish
void finish () {
output ("\n");
flush ();
wmstr p (pw.size ());
memcpy (p, pw.base (), pw.size ());
reset ();
(*cb) (p);
delete this;
}
示例4: while
str
join (str sep, const vec<str> &v)
{
strbuf sb;
const str *sp = v.base ();
if (sp < v.lim ()) {
sb.cat (*sp++);
while (sp < v.lim ())
sb.cat (sep).cat (*sp++);
}
return sb;
}
示例5: bzero
void
rex_mksecretid (vec<char> &secretid, rpc_bytes<> &ksc, rpc_bytes<> &kcs)
{
sfs_sessinfo si;
si.type = SFS_SESSINFO_SECRETID;
si.ksc = ksc;
si.kcs = kcs;
sfs_hash dummy_hash;
secretid.setsize (dummy_hash.size ());
sha1_hashxdr (secretid.base (), si, true);
bzero (si.kcs.base (), si.kcs.size ());
bzero (si.ksc.base (), si.ksc.size ());
}
示例6: sizeof
void
ifchgcb_test ()
{
vec<in_addr> newaddrs;
if (!myipaddrs (&newaddrs))
return;
if (newaddrs.size () == ifchg_addrs.size ()
&& !memcmp (newaddrs.base (), ifchg_addrs.base (),
ifchg_addrs.size () * sizeof (in_addr)))
return;
ifchg_addrs.swap (newaddrs);
++ifchg_count;
list<ifchgcb_t, &ifchgcb_t::link> olist;
chglist.swap (olist);
while (ifchgcb_t *chg = olist.first) {
olist.remove (chg);
chglist.insert_head (chg);
(*chg->cb) ();
}
}
示例7: inetsocket
static void
dolisten ()
{
for (sockaddr **sp = listenaddrs.base (); sp < listenaddrs.lim (); sp++) {
sockaddr_in *sinp = reinterpret_cast<sockaddr_in *> (*sp);
int fd = inetsocket (SOCK_STREAM, ntohs (sinp->sin_port),
ntohl (sinp->sin_addr.s_addr));
if (fd < 0)
warn ("could not bind TCP port %d: %m\n", ntohs (sinp->sin_port));
else {
if (sinp->sin_addr.s_addr == htonl (INADDR_ANY))
warn ("listening on TCP port %d\n", ntohs (sinp->sin_port));
else
warn ("listening on %s TCP port %d\n",
inet_ntoa (sinp->sin_addr), ntohs (sinp->sin_port));
listeners.push_back (New refcounted<listener> (fd));
}
}
if (listeners.empty ())
fatal ("no TCP ports to listen on\n");
hup_lock = false;
}
示例8: bzero
~kbdline () { bzero (pw.base (), pw.size ()); }