当前位置: 首页>>代码示例>>C++>>正文


C++ plog函数代码示例

本文整理汇总了C++中plog函数的典型用法代码示例。如果您正苦于以下问题:C++ plog函数的具体用法?C++ plog怎么用?C++ plog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了plog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: xdr_statfsokres

bool_t
xdr_statfsokres(XDR *xdrs, nfsstatfsokres *objp)
{
  if (amuDebug(D_XDRTRACE))
    plog(XLOG_DEBUG, "xdr_statfsokres:");

  if (!xdr_u_int(xdrs, &objp->sfrok_tsize)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bsize)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_blocks)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bfree)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bavail)) {
    return (FALSE);
  }
  return (TRUE);
}
开发者ID:raven-au,项目名称:am-utils-6.2,代码行数:23,代码来源:xdr_func.c

示例2: amfs_retry

/*
 * Retry a mount
 */
static void
amfs_retry(int rc, int term, opaque_t arg)
{
  struct continuation *cp = (struct continuation *) arg;
  am_node *mp = cp->mp;
  int error = 0;

  dlog("Commencing retry for mount of %s", mp->am_path);

  new_ttl(mp);

  if ((cp->start + ALLOWED_MOUNT_TIME) < clocktime(NULL)) {
    /*
     * The entire mount has timed out.  Set the error code and skip past all
     * the mntfs's so that amfs_bgmount will not have any more
     * ways to try the mount, thus causing an error.
     */
    plog(XLOG_INFO, "mount of \"%s\" has timed out", mp->am_path);
    error = ETIMEDOUT;
    while (*cp->al)
      cp->al++;
    /* explicitly forbid further retries after timeout */
    cp->retry = FALSE;
  }
  if (error || !IN_PROGRESS(cp))
    error = amfs_bgmount(cp);
  else
    /* Normally it's amfs_bgmount() which frees the continuation. However, if
     * the mount is already in progress and we're in amfs_retry() for another
     * node we don't try mounting the filesystem once again. Still, we have
     * to free the continuation as we won't get called again and thus would
     * leak the continuation structure and our am_loc references.
     */
    free_continuation(cp);

  reschedule_timeout_mp();
}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:40,代码来源:amfs_generic.c

示例3: handle_vendorid

int
handle_vendorid(struct ph1handle *iph1, struct isakmp_gen *gen)
{
	int vid_numeric;

	vid_numeric = check_vendorid(gen);
	if (vid_numeric == VENDORID_UNKNOWN)
		return vid_numeric;

	iph1->vendorid_mask |= BIT(vid_numeric);

#ifdef ENABLE_NATT
	if (natt_vendorid(vid_numeric))
		natt_handle_vendorid(iph1, vid_numeric);
#endif
#ifdef ENABLE_HYBRID
	switch (vid_numeric) {
	case VENDORID_XAUTH:
		iph1->mode_cfg->flags |= ISAKMP_CFG_VENDORID_XAUTH;
		break;
	case VENDORID_UNITY:
		iph1->mode_cfg->flags |= ISAKMP_CFG_VENDORID_UNITY;
		break;
	default:
		break;
	}
#endif
#ifdef ENABLE_DPD
	if (vid_numeric == VENDORID_DPD &&
	    (iph1->rmconf == NULL || iph1->rmconf->dpd)) {
		iph1->dpd_support = 1;
		plog(LLV_DEBUG, LOCATION, NULL, "remote supports DPD\n");
	}
#endif

	return vid_numeric;
}
开发者ID:AdamMajer,项目名称:ipsec-tools,代码行数:37,代码来源:vendorid.c

示例4: while

/**
 * Load a CRL
 */
static x509crl_t *builder_load_crl(certificate_type_t type, va_list args)
{
	chunk_t blob = chunk_empty;
	x509crl_t *crl;

	while (TRUE)
	{
		switch (va_arg(args, builder_part_t))
		{
			case BUILD_BLOB_ASN1_DER:
				blob = va_arg(args, chunk_t);
				continue;
			case BUILD_END:
				break;
			default:
				return NULL;
		}
		break;
	}
	if (blob.ptr)
	{
		crl = malloc_thing(x509crl_t);
		crl->next = NULL;
		crl->distributionPoints = linked_list_create();
		crl->crl = lib->creds->create(lib->creds,
							  		  CRED_CERTIFICATE, CERT_X509_CRL,
							  		  BUILD_BLOB_ASN1_DER, blob,
							  		  BUILD_END);
		if (crl->crl)
		{
			return crl;
		}
		plog("  error in X.509 crl");
		free_crl(crl);
	}
	return NULL;
}
开发者ID:carriercomm,项目名称:vyatta-strongswan,代码行数:40,代码来源:builder.c

示例5: remove_am

/*
 * Remove am from its place in the mount tree
 */
static void
remove_am(am_node *mp)
{
  /*
   * 1.  Consistency check
   */
  if (mp->am_child && mp->am_parent) {
    plog(XLOG_WARNING, "children of \"%s\" still exist - deleting anyway", mp->am_path);
  }

  /*
   * 2.  Update parent's child pointer
   */
  if (mp->am_parent && mp->am_parent->am_child == mp)
    mp->am_parent->am_child = mp->am_osib;

  /*
   * 3.  Unlink from sibling chain
   */
  if (mp->am_ysib)
    mp->am_ysib->am_osib = mp->am_osib;
  if (mp->am_osib)
    mp->am_osib->am_ysib = mp->am_ysib;
}
开发者ID:marulkan,项目名称:am-utils-tcp-workaround,代码行数:27,代码来源:map.c

示例6: xdr_umntrequest

bool_t
xdr_umntrequest(XDR *xdrs, umntrequest *objp)
{
#ifdef DEBUG
  amuDebug(D_XDRTRACE)
    plog(XLOG_DEBUG, "xdr_umntrequest:");
#endif /* DEBUG */

  if (!xdr_int(xdrs, &objp->isdirect))
    return (FALSE);

  if (!xdr_u_int(xdrs, (u_int *) &objp->devid))
    return (FALSE);

#ifdef HAVE_UMNTREQUEST_RDEVID
  if (!xdr_u_long(xdrs, &objp->rdevid))
    return (FALSE);
#endif /* HAVE_UMNTREQUEST_RDEVID */

  if (!xdr_pointer(xdrs, (char **) &objp->next, sizeof(umntrequest), (XDRPROC_T_TYPE) xdr_umntrequest))
    return (FALSE);

  return (TRUE);
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:24,代码来源:autofs_solaris_v1.c

示例7: plog

void CopyPhotosDialog::receivedPhotos_getInTarget(VKRequest *req)
{
    if((req->reqType!=VKRequest::Photos_get) ||
            (reqPhotosGetInTarget != req->reqId)){
        return;
    }
    reqPhotosGetInTarget = -1;
    plog(tr("Get target album photos description"));

    photosInTarget.clear();

    QDomDocument doc("Photos");
    doc.setContent(req->result);
    QDomElement docElem = doc.documentElement();
    QDomNodeList users = docElem.elementsByTagName ( "photo" );
    for(int i=0; i < users.count(); i++){
        QDomElement userElem = users.at(i).toElement();

        VKAlbumPhoto photo;

        photo.pid = userElem.elementsByTagName("pid").at(0).toElement().text();
        photo.aid = userElem.elementsByTagName("aid").at(0).toElement().text();
        photo.owner_id = userElem.elementsByTagName("owner_id").at(0).toElement().text();
        photo.src = userElem.elementsByTagName("src").at(0).toElement().text();
        photo.src_big = userElem.elementsByTagName("src_big").at(0).toElement().text();
        photo.src_small = userElem.elementsByTagName("src_small").at(0).toElement().text();
        photo.text = userElem.elementsByTagName("text").at(0).toElement().text();
        photo.src_xbig = userElem.elementsByTagName("src_xbig").at(0).toElement().text();
        photo.src_xxbig = userElem.elementsByTagName("src_xxbig").at(0).toElement().text();
        photo.cacheFileName = albumDir + photo.src_big.right(photo.src_big.length() - (photo.src_big.lastIndexOf("/")));

        photosInTarget.append( photo );
    }

    reqPhotosGet = m_vkEngine->reqPhotos_get(gidFrom, aidFrom);
}
开发者ID:PushoN,项目名称:vimka,代码行数:36,代码来源:copyphotosdialog.cpp

示例8: rc_addrpool_assign

/*
 * allocate a peer-specified address from pool
 * returns pointer to struct of address if successful
 * returns 0 if address already used or any error
 *
 * caller must do LIST_INSERT_HEAD(&child_sa->rcf_lease_list, i, link_sa);
 */
struct rcf_address *
rc_addrpool_assign(struct rcf_addresspool *conf, int af, uint8_t *addr)
{
	size_t	addrsize;
	struct rcf_address_pool_item	*i;
	struct rcf_address	*a;

	if (!conf) {
		plog(PLOG_INTERR, PLOGLOC, NULL,
		     "no address pool specified\n");
		return 0;
	}

	addrsize = af_addrsize(af);
	if (addrsize == 0)
		return 0;
	for (i = LIST_FIRST(&conf->pool_list); i != NULL; i = LIST_NEXT(i, link)) {
		if (af != i->af)
			continue;

		if (memcmp(addr, i->start, addrsize) < 0 ||
		    memcmp(addr, i->end, addrsize) > 0)
			continue;	/* out of range, try next */

		if (addrpool_check(i, addr) != 0)
			continue;

		a = rc_address_new(af, addr, IPV6_ADDRESS_PREFIX_LEN, 0,
				   &i->lease_list);
		if (!a)
			return 0;	/* allocation failed */
		return a;
	}

	return 0;
}
开发者ID:hmatyschok,项目名称:MeshBSD,代码行数:43,代码来源:addresspool.c

示例9: BitMapCheckEnd

int BitMapCheckEnd(void)
{
	if (gBitMapInited) {
#if _VBC_DEBUG_
		int maxdepth = 0;

		BMS_MaxDepth(gBMS_Root, 0, &maxdepth);
		plog("   %d full segments, %d segment nodes (max depth was %d nodes)\n",
		       gFullSegments, gSegmentNodes, maxdepth);
#endif
		free(gFullBitmapSegment);
		gFullBitmapSegment = NULL;

		free(gEmptyBitmapSegment);
		gEmptyBitmapSegment = NULL;

		bit_dealloc(gFullSegmentList);
		gFullSegmentList = NULL;

		BMS_DisposeTree();
		gBitMapInited = 0;
	}
	return (0);
}
开发者ID:Leon555,项目名称:Mac-src-essentials,代码行数:24,代码来源:VolumeBitmapCheck.c

示例10: rmdirs

/*
 * Remove as many directories in the path as possible.
 * Give up if the directory doesn't appear to have
 * been created by Amd (not mode dr-x) or an rmdir
 * fails for any reason.
 */
void
rmdirs(char *dir)
{
  char *xdp = xstrdup(dir);
  char *dp;

  do {
    struct stat stb;
    /*
     * Try to find out whether this was
     * created by amd.  Do this by checking
     * for owner write permission.
     */
    if (stat(xdp, &stb) == 0 && (stb.st_mode & 0200) == 0) {
      if (rmdir(xdp) < 0) {
	if (errno != ENOTEMPTY &&
	    errno != EBUSY &&
	    errno != EEXIST &&
	    errno != EROFS &&
	    errno != EINVAL)
	  plog(XLOG_ERROR, "rmdir(%s): %m", xdp);
	break;
      } else {
	dlog("rmdir(%s)", xdp);
      }
    } else {
      break;
    }

    dp = strrchr(xdp, '/');
    if (dp)
      *dp = '\0';
  } while (dp && dp > xdp);

  XFREE(xdp);
}
开发者ID:0mp,项目名称:freebsd,代码行数:42,代码来源:xutil.c

示例11: play_sound

/*
 * Play a sound of type "event".
 */
static void play_sound(int event)
{
	Mix_Chunk *wave = NULL;
	int s;

	/* Paranoia */
	if (event < 0 || event >= MSG_MAX) return;

	/* Check there are samples for this event */
	if (!samples[event].num) return;

	/* Choose a random event */
	s = rand_int(samples[event].num);
	wave = samples[event].wavs[s];

	/* Try loading it, if it's not cached */
	if (!wave)
	{
		/* Verify it exists */
		const char *filename = samples[event].paths[s];
		if (!file_exists(filename)) return;

		/* Load */
		wave = Mix_LoadWAV(filename);
	}

	/* Check to see if we have a wave again */
	if (!wave)
	{
		plog("SDL sound load failed.");
		return;
	}

	/* Actually play the thing */
	Mix_PlayChannel(-1, wave, 0);
}
开发者ID:NickMcConnell,项目名称:OangbandU,代码行数:39,代码来源:snd-sdl.c

示例12: mount_auto_node

/*
 * Mount a top level automount node
 * by calling lookup in the parent
 * (root) node which will cause the
 * automount node to be automounted.
 */
int
mount_auto_node(char *dir, opaque_t arg)
{
  int error = 0;
  am_node *mp = (am_node *) arg;
  am_node *new_mp;

  new_mp = mp->am_mnt->mf_ops->lookup_child(mp, dir, &error, VLOOK_CREATE);
  if (new_mp && error < 0) {
    /*
     * We can't allow the fileid of the root node to change.
     * Should be ok to force it to 1, always.
     */
    new_mp->am_gen = new_mp->am_fattr.na_fileid = 1;

    new_mp = mp->am_mnt->mf_ops->mount_child(new_mp, &error);
  }

  if (error > 0) {
    errno = error;		/* XXX */
    plog(XLOG_ERROR, "Could not mount %s: %m", dir);
  }
  return error;
}
开发者ID:marulkan,项目名称:am-utils-tcp-workaround,代码行数:30,代码来源:map.c

示例13: autofs_get_fh

int
autofs_get_fh(am_node *mp)
{
    autofs_fh_t *fh;
    char buf[MAXHOSTNAMELEN];
    mntfs *mf = mp->am_al->al_mnt;
    struct utsname utsname;

    plog(XLOG_DEBUG, "autofs_get_fh for %s", mp->am_path);
    fh = ALLOC(autofs_fh_t);
    memset((voidp) fh, 0, sizeof(autofs_fh_t)); /* Paranoid */

    /*
     * SET MOUNT ARGS
     */
    if (uname(&utsname) < 0) {
        xstrlcpy(buf, "localhost.autofs", sizeof(buf));
    } else {
        xstrlcpy(buf, utsname.nodename, sizeof(buf));
        xstrlcat(buf, ".autofs", sizeof(buf));
    }
#ifdef HAVE_AUTOFS_ARGS_T_ADDR
    fh->addr.buf = xstrdup(buf);
    fh->addr.len = fh->addr.maxlen = strlen(buf);
#endif /* HAVE_AUTOFS_ARGS_T_ADDR */

    fh->direct = (mf->mf_fsflags & FS_DIRECT) ? 1 : 0;
    fh->rpc_to = 1;		/* XXX: arbitrary */
    fh->mount_to = mp->am_timeo;
    fh->path = mp->am_path;
    fh->opts = "";		/* XXX: arbitrary */
    fh->map = mp->am_path;	/* this is what we get back in readdir */

    mp->am_autofs_fh = fh;
    return 0;
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:36,代码来源:autofs_solaris_v1.c

示例14: mf_mounted

void
mf_mounted(mntfs *mf)
{
  int quoted;
  int wasmounted = mf->mf_flags & MFF_MOUNTED;

  if (!wasmounted) {
    /*
     * If this is a freshly mounted
     * filesystem then update the
     * mntfs structure...
     */
    mf->mf_flags |= MFF_MOUNTED;
    mf->mf_error = 0;

    /*
     * Do mounted callback
     */
    if (mf->mf_ops->mounted) {
      (*mf->mf_ops->mounted) (mf);
    }

    mf->mf_fo = 0;
  }

  /*
   * Log message
   */
  quoted = strchr(mf->mf_info, ' ') != 0;
  plog(XLOG_INFO, "%s%s%s %s fstype %s on %s",
       quoted ? "\"" : "",
       mf->mf_info,
       quoted ? "\"" : "",
       wasmounted ? "referenced" : "mounted",
       mf->mf_ops->fs_type, mf->mf_mount);
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:36,代码来源:autil.c

示例15: SubmitCrashInfo

// If we can't resolve the symbols, we assume it's because we don't have symbols
// so we'll try to download them and retry. If we can resolve symbols, we'll
// get the callstacks etc. and submit to our server for analysis.
void SubmitCrashInfo()
{
    if (!dir::Create(gSymbolsDir)) {
        plog("SubmitCrashInfo(): couldn't create symbols dir");
        return;
    }

    lf("SubmitCrashInfo(): start");
    lf(L"SubmitCrashInfo(): gSymbolPathW: '%s'", gSymbolPathW);
    if (!CrashHandlerCanUseNet()) {
        plog("SubmitCrashInfo(): internet access not allowed");
        return;
    }

    char *s = NULL;
    if (!dbghelp::Initialize(gSymbolPathW)) {
        plog("SubmitCrashInfo(): dbghelp::Initialize() failed");
        return;
    }

    if (!dbghelp::HasSymbols()) {
        if (!DownloadAndUnzipSymbols(gPdbZipPath, gSymbolsDir)) {
            plog("SubmitCrashInfo(): failed to download symbols");
            return;
        }

        if (!dbghelp::Initialize(gSymbolPathW, true)) {
            plog("SubmitCrashInfo(): second dbghelp::Initialize() failed");
            return;
        }
    }

    if (!dbghelp::HasSymbols()) {
        plog("SubmitCrashInfo(): HasSymbols() false after downloading symbols");
        return;
    }

    s = BuildCrashInfoText();
    if (!s)
        return;
    SendCrashInfo(s);
    gCrashHandlerAllocator->Free(s);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:46,代码来源:CrashHandler.cpp


注:本文中的plog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。