• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Log1函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: HPRegisterForHotplugEvents

/**
 * Sets up callbacks for device hotplug events.
 */
ULONG HPRegisterForHotplugEvents(void)
{
	struct udev *udev;

	(void)pthread_mutex_init(&usbNotifierMutex, NULL);

	if (driverSize <= 0)
	{
		Log1(PCSC_LOG_INFO, "No bundle files in pcsc drivers directory: "
			PCSCLITE_HP_DROPDIR);
		Log1(PCSC_LOG_INFO, "Disabling USB support for pcscd");
		return 0;
	}

	/* Create the udev object */
	udev = udev_new();
	if (!udev)
	{
		Log1(PCSC_LOG_ERROR, "udev_new() failed");
		return 0;
	}

	HPRescanUsbBus(udev);

	(void)ThreadCreate(&usbNotifyThread, THREAD_ATTR_DETACHED,
		(PCSCLITE_THREAD_FUNCTION( )) HPEstablishUSBNotifications, udev);

	return 0;
} /* HPRegisterForHotplugEvents */
开发者ID:kenieevan,项目名称:pcsc-lite,代码行数:32,代码来源:hotplug_libudev.c


示例2: MSGCheckHandleAssociation

static LONG MSGCheckHandleAssociation(SCARDHANDLE hCard,
	SCONTEXT * threadContext)
{
	int list_index = 0;

	if (0 == threadContext->hContext)
	{
		/* the handle is no more valid. After SCardReleaseContext() for
		 * example */
		Log1(PCSC_LOG_CRITICAL, "Invalidated handle");
		return -1;
	}

	(void)pthread_mutex_lock(&threadContext->cardsList_lock);
	list_index = list_locate(&threadContext->cardsList, &hCard);
	(void)pthread_mutex_unlock(&threadContext->cardsList_lock);
	if (list_index >= 0)
		return 0;

	/* Must be a rogue client, debug log and sleep a couple of seconds */
	Log1(PCSC_LOG_ERROR, "Client failed to authenticate");
	(void)SYS_Sleep(2);

	return -1;
}
开发者ID:ZuyingWo,项目名称:PCSC,代码行数:25,代码来源:winscard_svc.c


示例3: IFDHPowerICC

RESPONSECODE
IFDHPowerICC (DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD AtrLength)
{
    switch (Action) {
        case IFD_POWER_DOWN:
            if (vicc_poweroff() < 0) {
                Log1(PCSC_LOG_ERROR, "could not powerdown");
                return IFD_COMMUNICATION_ERROR;
            }

            /* XXX see bug #312754 on https://alioth.debian.org/projects/pcsclite */
#if 0
            *AtrLength = 0;

#endif
            return IFD_SUCCESS;
        case IFD_POWER_UP:
            if (vicc_poweron() < 0) {
                Log1(PCSC_LOG_ERROR, "could not powerup");
                return IFD_COMMUNICATION_ERROR;
            }
            break;
        case IFD_RESET:
            if (vicc_reset() < 0) {
                Log1(PCSC_LOG_ERROR, "could not reset");
                return IFD_COMMUNICATION_ERROR;
            }
            break;
        default:
            Log2(PCSC_LOG_ERROR, "%0lX not supported", Action);
            return IFD_NOT_SUPPORTED;
    }

    return IFDHGetCapabilities (Lun, TAG_IFD_ATR, AtrLength, Atr);
}
开发者ID:Churro,项目名称:vsmartcard,代码行数:35,代码来源:ifd-vpcd.c


示例4: latch_overlay_get_account_id

static int
latch_overlay_get_account_id(latch_overlay_config_data *cfg, char *id, char **account_id) {

    int search_scope = LDAP_SCOPE_BASE;
    char *search_base_dn = NULL;
    char *search_filter = NULL;
    int rv = ERROR;

    Log1(LDAP_DEBUG_TRACE, LDAP_LEVEL_DEBUG, ">>> %s\n", __func__);

    search_base_dn = replace_str(cfg->ldap_search_base_dn, "@@@[email protected]@@", id);
    search_filter = replace_str(cfg->ldap_search_filter, "@@@[email protected]@@", id);

    if (cfg->ldap_search_scope != NULL) {
        if (strcmp("onelevel", cfg->ldap_search_scope) == 0) {
            search_scope = LDAP_SCOPE_ONELEVEL;
        }
        else if (strcmp("subtree", cfg->ldap_search_scope) == 0) {
            search_scope = LDAP_SCOPE_SUBTREE;
        }
    }

    rv = latch_overlay_get_entry_attribute(cfg->ldap_uri, cfg->ldap_bind_dn, cfg->ldap_bind_password, search_base_dn, search_filter, search_scope, cfg->ldap_attribute, cfg->ldap_tls_ca_file, account_id);

    free(search_base_dn);
    free(search_filter);

    Log1(LDAP_DEBUG_TRACE, LDAP_LEVEL_DEBUG, "<<< %s\n", __func__);

    return rv;

}
开发者ID:ElevenPaths,项目名称:latch-plugin-openLDAP,代码行数:32,代码来源:latch-overlay-latch.c


示例5: EHDestroyEventHandler

LONG EHDestroyEventHandler(PREADER_CONTEXT rContext)
{
	if (NULL == rContext->readerState)
	{
		Log1(PCSC_LOG_ERROR, "Thread never started (reader init failed?)");
		return SCARD_S_SUCCESS;
	}

	PCSCD::SharedReaderState *rs = PCSCD::SharedReaderState::overlay(rContext->readerState);
	if ((rContext->pthThread == 0) || !rs || (rs->readerNameLength() == 0))
	{
		Log1(PCSC_LOG_INFO, "Thread already stomped.");
		return SCARD_S_SUCCESS;
	}

	secdebug("pcscd", "EHDestroyEventHandler: pthThread: %p, reader name len: %ld",
		rContext->pthThread, rs->readerNameLength());

	/*
	 * Zero out the public status struct to allow it to be recycled and
	 * used again
	 */

	rs->xreaderNameClear();
	rs->xcardAtrClear();
	rs->xreaderID(0);
	rs->xreaderState(0);
	rs->xlockState(0);
	rs->sharing(0);
	rs->xcardAtrLength(0);
	rs->xcardProtocol(SCARD_PROTOCOL_UNSET);		// we only set this one to write to memory cache

	/*
	 * Set the thread to 0 to exit thread
	 */
	ReaderContextLock(rContext);

	Log1(PCSC_LOG_INFO, "Stomping thread.");

	int ix;
	for (ix = 0; (ix < 100) && ReaderContextIsLocked(rContext); ++ix)
	{
		/*
		 * Wait 0.05 seconds for the child to respond
		 */
		SYS_USleep(50000);
	}

	secdebug("pcscd", "EHDestroyEventHandler: post-stop dwLockId: %d", rContext->dwLockId);


	/* Zero the thread */
	rContext->pthThread = 0;

	Log1(PCSC_LOG_INFO, "Thread stomped.");

	return SCARD_S_SUCCESS;
}
开发者ID:smartcardservices,项目名称:smartcardservices,代码行数:58,代码来源:eventhandler.cpp


示例6: HPEstablishUSBNotifications

static void HPEstablishUSBNotifications(void)
{
	int i, do_polling;

	/* libusb default is /dev/bus/usb but the devices are not yet visible there
	 * when a hotplug is requested */
	setenv("USB_DEVFS_PATH", "/proc/bus/usb", 0);

	usb_init();

	/* scan the USB bus for devices at startup */
	HPRescanUsbBus();

	/* if at least one driver do not have IFD_GENERATE_HOTPLUG */
	do_polling = FALSE;
	for (i=0; i<driverSize; i++)
		if (driverTracker[i].libraryPath)
			if ((driverTracker[i].ifdCapabilities & IFD_GENERATE_HOTPLUG) == 0)
			{
				Log2(PCSC_LOG_INFO,
					"Driver %s does not support IFD_GENERATE_HOTPLUG. Using active polling instead.",
					driverTracker[i].bundleName);
				if (HPForceReaderPolling < 1)
					HPForceReaderPolling = 1;
				break;
			}

	if (HPForceReaderPolling)
	{
		Log2(PCSC_LOG_INFO,
				"Polling forced every %d second(s)", HPForceReaderPolling);
		do_polling = TRUE;
	}

	if (do_polling)
	{
		while (!AraKiriHotPlug)
		{
			SYS_Sleep(HPForceReaderPolling);
			HPRescanUsbBus();
		}
	}
	else
	{
		char dummy;

	  	pipe(rescan_pipe);
		while (read(rescan_pipe[0], &dummy, sizeof(dummy)) > 0)
		{
			Log1(PCSC_LOG_INFO, "Reload serial configuration");
			HPRescanUsbBus();
			RFReCheckReaderConf();
			Log1(PCSC_LOG_INFO, "End reload serial configuration");
		}
		close(rescan_pipe[0]);
		rescan_pipe[0] = -1;
	}
}
开发者ID:andyvand,项目名称:pcsc-lite-clone,代码行数:58,代码来源:hotplug_libusb.c


示例7: Log1

void StatusBar::draw_marks(Buffer::iterator& cursor)
{
	Log1("Redrawing status bar");

	std::vector<std::shared_ptr<Mark>> before_cursor(Brush::MarkColorsTotal);
	std::vector<std::shared_ptr<Mark>> after_cursor(Brush::MarkColorsTotal);

	// Initialize before_cursor and after_cursor to 0s.
	for (int i = 0; i < Brush::MarkColorsTotal; i++) {
		before_cursor[i] = 0;
		after_cursor[i] = 0;
	}

	Mark c(cursor);
	for (Mark m : _marks) {
		Log1("Looking at mark " << m);
		Log3("Comparing with cursor " << c);
		if (m < c) {
			Log2("Mark " << m << " is less then cursor. Setting for color " << m.get_color_index());
			before_cursor[m.get_color_index()].reset(new Mark(m));
		} else if (m == c) {
			Log2("Mark " << m << " is equal to cursor.");
		} else {
			Log2("Mark " << m << " is greater then cursor. Setting for color " << m.get_color_index());
			after_cursor[m.get_color_index()].reset(new Mark(m));
		}
	}

	for (int i = 0, x = 2; i < Brush::MarkColorsTotal; i++) {
		std::stringstream ss;
		if (before_cursor[i] != 0) {
			s64 n = before_cursor[i]->get_iterator().distance_lines(cursor);
			Log3("Drawing " << n << " lines before cursor, from " << *before_cursor[i] << 
				" until " << cursor);
			ss << std::setfill(' ') << std::setw(4) << n;
		} else {
			ss << "----";
		}

		ss << "|";

		if (after_cursor[i] != 0) {
			s64 n = after_cursor[i]->get_iterator().distance_lines(cursor);
			Log3("Drawing " << n << " lines after cursor, from " << *after_cursor[i] << 
				" until " << cursor);
			ss << std::setfill(' ') << std::setw(4) << std::left << n;
		} else {
			ss << "----";
		}

		Log3("Marks line: " << ss.str());

		Line l(ss.str());
		_brush.draw_text(x, _text_height + 1, l, _brush.marks[i]);
		x += l.length() + 1;
	}
}
开发者ID:dowel,项目名称:hless,代码行数:57,代码来源:status_bar.cpp


示例8: udev_device_get_sysattr_value

/*@[email protected]*/ static struct _driverTracker *get_driver(struct udev_device *dev,
	const char *devpath, struct _driverTracker **classdriver)
{
	int i;
	unsigned int idVendor, idProduct;
	static struct _driverTracker *driver;
	const char *str;

	str = udev_device_get_sysattr_value(dev, "idVendor");
	if (!str)
	{
		Log1(PCSC_LOG_ERROR, "udev_device_get_sysattr_value() failed");
		return NULL;
	}
	sscanf(str, "%X", &idVendor);

	str = udev_device_get_sysattr_value(dev, "idProduct");
	if (!str)
	{
		Log1(PCSC_LOG_ERROR, "udev_device_get_sysattr_value() failed");
		return NULL;
	}
	sscanf(str, "%X", &idProduct);

	Log4(PCSC_LOG_DEBUG,
		"Looking for a driver for VID: 0x%04X, PID: 0x%04X, path: %s",
		idVendor, idProduct, devpath);

	*classdriver = NULL;
	driver = NULL;
	/* check if the device is supported by one driver */
	for (i=0; i<driverSize; i++)
	{
		if (driverTracker[i].libraryPath != NULL &&
			idVendor == driverTracker[i].manuID &&
			idProduct == driverTracker[i].productID)
		{
			if ((driverTracker[i].CFBundleName != NULL)
				&& (0 == strcmp(driverTracker[i].CFBundleName, "CCIDCLASSDRIVER")))
				*classdriver = &driverTracker[i];
			else
				/* it is not a CCID Class driver */
				driver = &driverTracker[i];
		}
	}

	/* if we found a specific driver */
	if (driver)
		return driver;

	/* else return the Class driver (if any) */
	return *classdriver;
}
开发者ID:kenieevan,项目名称:pcsc-lite,代码行数:53,代码来源:hotplug_libudev.c


示例9: Log1

eFlag Tree::parse(Sit S, DataLine *d)
{
    Log1(S, L1_PARSING, getURI());
    double time_was = getMillisecs();
    TreeConstructer tc(S);
    eFlag retval = tc.parseDataLineUsingExpat(S, this, d);
    if (!retval)
    {
        Log1(S, L1_PARSE_DONE, getMillisecsDiff(time_was));
    }
    return retval;
}
开发者ID:alepharchives,项目名称:Sablotron,代码行数:12,代码来源:tree.cpp


示例10: IFDHPowerICC

RESPONSECODE
IFDHPowerICC (DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD AtrLength)
{
    size_t slot = Lun & 0xffff;
    RESPONSECODE r = IFD_COMMUNICATION_ERROR;

    if (slot >= vicc_max_slots) {
        goto err;
    }

    switch (Action) {
        case IFD_POWER_DOWN:
            if (vicc_poweroff(ctx[slot]) < 0) {
                Log1(PCSC_LOG_ERROR, "could not powerdown");
                goto err;
            }

            /* XXX see bug #312754 on https://alioth.debian.org/projects/pcsclite */
#if 0
            *AtrLength = 0;

#endif
            return IFD_SUCCESS;
        case IFD_POWER_UP:
            if (vicc_poweron(ctx[slot]) < 0) {
                Log1(PCSC_LOG_ERROR, "could not powerup");
                goto err;
            }
            break;
        case IFD_RESET:
            if (vicc_reset(ctx[slot]) < 0) {
                Log1(PCSC_LOG_ERROR, "could not reset");
                goto err;
            }
            break;
        default:
            Log2(PCSC_LOG_ERROR, "%0lX not supported", Action);
            r = IFD_NOT_SUPPORTED;
            goto err;
    }

    r = IFD_SUCCESS;

err:
    if (r != IFD_SUCCESS && AtrLength)
        *AtrLength = 0;
    else
        r = IFDHGetCapabilities (Lun, TAG_IFD_ATR, AtrLength, Atr);

    return r;
}
开发者ID:Jdi99y515,项目名称:vsmartcard,代码行数:51,代码来源:ifd-vpcd.c


示例11: IFDHGetCapabilities

RESPONSECODE
IFDHGetCapabilities (DWORD Lun, DWORD Tag, PDWORD Length, PUCHAR Value)
{
    unsigned char *atr = NULL;
    ssize_t size;

    if (!Length || !Value)
        return IFD_COMMUNICATION_ERROR;

    switch (Tag) {
        case TAG_IFD_ATR:

            size = vicc_getatr(&atr);
            if (size < 0) {
                Log1(PCSC_LOG_ERROR, "could not get ATR");
                return IFD_COMMUNICATION_ERROR;
            }
            if (size == 0) {
                Log1(PCSC_LOG_ERROR, "Virtual ICC removed");
                return IFD_ICC_NOT_PRESENT;
            }
            Log2(PCSC_LOG_DEBUG, "Got ATR (%d bytes)", size);

            if (*Length < size) {
                free(atr);
                Log1(PCSC_LOG_ERROR, "Not enough memory for ATR");
                return IFD_COMMUNICATION_ERROR;
            }

            memcpy(Value, atr, size);
            *Length = size;
            free(atr);
            break;

        case TAG_IFD_SLOTS_NUMBER:
            if (*Length < 1) {
                Log1(PCSC_LOG_ERROR, "Invalid input data");
                return IFD_COMMUNICATION_ERROR;
            }

            *Value  = 1;
            *Length = 1;
            break;

        default:
            Log2(PCSC_LOG_DEBUG, "unknown tag %d", (int)Tag);
            return IFD_ERROR_TAG;
    }

    return IFD_SUCCESS;
}
开发者ID:Churro,项目名称:vsmartcard,代码行数:51,代码来源:ifd-vpcd.c


示例12: sendData

/* wrap data, transmit to the device and get answer */
RESPONSECODE sendData(PUCHAR TxBuffer, DWORD TxLength, 
				 PUCHAR RxBuffer, PDWORD RxLength, int wait)
{
	RESPONSECODE rc;
	
	if (present == 0)
	{
		return IFD_COMMUNICATION_ERROR;
	}
	
	unsigned char apdu[TxLength];
	unsigned char buffer[2000];
	unsigned int i, j, response_length, n = 0;
	int sLen = TxLength;
	
	for (i = 0; i < TxLength; ++i)
	{
		apdu[i] = *(TxBuffer + i);
	}

	Log2(PCSC_LOG_DEBUG, "preparing to write %d data bytes", TxLength);
	printf(">> %s \n", hexdump(TxBuffer, TxLength));
	int rv;

	rv = rfid_protocol_transceive(ph, TxBuffer, TxLength, RxBuffer, &response_length, 0, 0);
	if (rv < 0)
	{
		Log2(PCSC_LOG_ERROR, "Error from transceive, returned %d\n", rv);
		present = 0;
		rfid_protocol_close(ph);
		rfid_layer2_close(l2h);
		rfid_reader_close(rh);
		return IFD_COMMUNICATION_ERROR;
	}

	Log2(PCSC_LOG_DEBUG, "wrote %d data bytes", TxLength);		
	Log2(PCSC_LOG_DEBUG, "got %d response bytes", response_length);
		
    if (response_length > 0)
    {
		*RxLength = response_length;
		
		//for (j = 0; j < response_length; ++j)
		//{
		//	*(RxBuffer + j) = buffer[j];
		//}
		rc = IFD_SUCCESS;
	    
	}
	else
	{
	    Log1(PCSC_LOG_ERROR, "no response, meaning eof, reader not usable anymore\n");
		present = 0;
		rfid_protocol_close(ph);
		rfid_layer2_close(l2h);
		rfid_reader_close(rh);
	    rc = IFD_COMMUNICATION_ERROR;
	}
	return rc;
}
开发者ID:jdkbx,项目名称:librfid-pcsc-ifdhandler,代码行数:61,代码来源:ok.c


示例13: IFDHSetProtocolParameters

RESPONSECODE IFDHSetProtocolParameters ( DWORD Lun, DWORD Protocol, 
				   UCHAR Flags, UCHAR PTS1,
				   UCHAR PTS2, UCHAR PTS3) {

  /* This function should set the PTS of a particular card/slot using
     the three PTS parameters sent

     Protocol  - 0 .... 14  T=0 .... T=14
     Flags     - Logical OR of possible values:
     IFD_NEGOTIATE_PTS1 IFD_NEGOTIATE_PTS2 IFD_NEGOTIATE_PTS3
     to determine which PTS values to negotiate.
     PTS1,PTS2,PTS3 - PTS Values.

     returns:

     IFD_SUCCESS
     IFD_ERROR_PTS_FAILURE
     IFD_COMMUNICATION_ERROR
     IFD_PROTOCOL_NOT_SUPPORTED
  */
	Log1(PCSC_LOG_DEBUG, "IFDHSetProtocolParameters");
	if (Protocol != SCARD_PROTOCOL_T0 && Protocol != SCARD_PROTOCOL_T1)
	{
		return IFD_PROTOCOL_NOT_SUPPORTED;
	}
	return IFD_SUCCESS;
}
开发者ID:FlexCOS,项目名称:lib-tty-ifdhandler,代码行数:27,代码来源:ifdhandler.c


示例14: sysMapMem

/*
 * Map a range of virtual memory.  Note that the size asked for here
 * is literally what the upper level has asked for.  We need to do
 * any rounding, etc. here.  If mapping fails return 0, otherwise
 * return the address of the base of the mapped memory.
 */
void *
sysMapMem(size_t requestedSize, size_t *mappedSize)
{
    void *mappedAddr;

    *mappedSize = roundUpToGrain(requestedSize);
#ifdef USE_MALLOC
    mappedAddr = (void *) sysMalloc(*mappedSize); /* Returns 0 on failure */
#ifdef __linux__
     if (mappedAddr) {
       memset(mappedAddr, 0, *mappedSize);
       mappedAddr = (void *) roundUpToGrain(mappedAddr);
     }
#endif
#else
    mappedAddr = mapChunk(*mappedSize);           /* Returns 0 on failure */
#endif /* USE_MALLOC */
    if (mappedAddr) {
        Log3(2, "sysMapMem: 0x%x bytes at 0x%x (request: 0x%x bytes)\n",
             *mappedSize, mappedAddr, requestedSize);
    } else {
        Log1(2, "sysMapMem failed: (request: 0x%x bytes)\n", requestedSize);
    }
    return mappedAddr;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:31,代码来源:memory_md.c


示例15: vernum_db_init

static int
vernum_db_init(
	BackendDB	*be,
	ConfigReply	*cr)
{
	slap_overinst	*on = (slap_overinst *) be->bd_info;
	vernum_t	*vn = NULL;

	if ( SLAP_ISGLOBALOVERLAY( be ) ) {
		Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"vernum_db_init: vernum cannot be used as global overlay.\n" );
		return 1;
	}

	if ( be->be_nsuffix == NULL ) {
		Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"vernum_db_init: database must have suffix\n" );
		return 1;
	}

	if ( BER_BVISNULL( &be->be_rootndn ) || BER_BVISEMPTY( &be->be_rootndn ) ) {
		Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"vernum_db_init: missing rootdn for database DN=\"%s\", YMMV\n",
			be->be_suffix[ 0 ].bv_val );
	}

	vn = (vernum_t *)ch_calloc( 1, sizeof( vernum_t ) );

	on->on_bi.bi_private = (void *)vn;

	return 0;
}
开发者ID:ystk,项目名称:debian-openldap,代码行数:32,代码来源:vernum.c


示例16: vernum_db_open

static int
vernum_db_open(
	BackendDB	*be,
	ConfigReply	*cr )
{
	slap_overinst *on = (slap_overinst *)be->bd_info;
	vernum_t *vn = (vernum_t *)on->on_bi.bi_private;

	if ( SLAP_SINGLE_SHADOW( be ) ) {
		Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"vernum incompatible with shadow database \"%s\".\n",
			be->be_suffix[ 0 ].bv_val );
		return 1;
	}

	/* default: unicodePwd & msDS-KeyVersionNumber */
	if ( vn->vn_attr == NULL ) {
		const char *text = NULL;
		int rc;

		rc = slap_str2ad( "unicodePwd", &vn->vn_attr, &text );
		if ( rc != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY, "vernum: unable to find attribute 'unicodePwd' (%d: %s)\n",
				rc, text, 0 );
			return 1;
		}

		vn->vn_vernum = ad_msDS_KeyVersionNumber;
	}

	return vernum_repair( be );
}
开发者ID:ystk,项目名称:debian-openldap,代码行数:32,代码来源:vernum.c


示例17: pguid_db_init

static int
pguid_db_init(
	BackendDB	*be,
	ConfigReply	*cr)
{
	if ( SLAP_ISGLOBALOVERLAY( be ) ) {
		Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"pguid_db_init: pguid cannot be used as global overlay.\n" );
		return 1;
	}

	if ( be->be_nsuffix == NULL ) {
		Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"pguid_db_init: database must have suffix\n" );
		return 1;
	}

	if ( BER_BVISNULL( &be->be_rootndn ) || BER_BVISEMPTY( &be->be_rootndn ) ) {
		Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"pguid_db_init: missing rootdn for database DN=\"%s\", YMMV\n",
			be->be_suffix[ 0 ].bv_val );
	}

	return 0;
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:25,代码来源:pguid.c


示例18: relay_back_db_open

int
relay_back_db_open( Backend *be, ConfigReply *cr )
{
	relay_back_info		*ri = (relay_back_info *)be->be_private;

	assert( ri != NULL );

	if ( !BER_BVISNULL( &ri->ri_realsuffix ) ) {
		ri->ri_bd = select_backend( &ri->ri_realsuffix, 1 );

		/* must be there: it was during config! */
		if ( ri->ri_bd == NULL ) {
			snprintf( cr->msg, sizeof( cr->msg),
				"cannot find database "
				"of relay dn \"%s\" "
				"in \"olcRelay <dn>\"\n",
				ri->ri_realsuffix.bv_val );
			Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
				"relay_back_db_open: %s.\n", cr->msg );

			return 1;
		}

		/* inherit controls */
		AC_MEMCPY( be->bd_self->be_ctrls, ri->ri_bd->be_ctrls, sizeof( be->be_ctrls ) );

	} else {
		/* inherit all? */
		AC_MEMCPY( be->bd_self->be_ctrls, frontendDB->be_ctrls, sizeof( be->be_ctrls ) );
	}

	return 0;
}
开发者ID:1ack,项目名称:Impala,代码行数:33,代码来源:init.c


示例19: IFDHTransmitToICC

RESPONSECODE
IFDHTransmitToICC (DWORD Lun, SCARD_IO_HEADER SendPci, PUCHAR TxBuffer,
        DWORD TxLength, PUCHAR RxBuffer, PDWORD RxLength,
        PSCARD_IO_HEADER RecvPci)
{
    unsigned char *rapdu = NULL;
    ssize_t size;
    RESPONSECODE r = IFD_COMMUNICATION_ERROR;
    size_t slot = Lun & 0xffff;

    if (slot >= vicc_max_slots) {
        goto err;
    }

    if (!RxLength || !RecvPci) {
        Log1(PCSC_LOG_ERROR, "Invalid input data");
        goto err;
    }

    size = vicc_transmit(ctx[slot], TxLength, TxBuffer, &rapdu);

    if (size < 0) {
        Log1(PCSC_LOG_ERROR, "could not send apdu or receive rapdu");
        goto err;
    }

    if (*RxLength < size) {
        Log1(PCSC_LOG_ERROR, "Not enough memory for rapdu");
        goto err;
    }

    *RxLength = size;
    memcpy(RxBuffer, rapdu, size);
    RecvPci->Protocol = 1;

    r = IFD_SUCCESS;

err:
    if (r != IFD_SUCCESS && RxLength)
        *RxLength = 0;

    free(rapdu);

    return r;
}
开发者ID:Jdi99y515,项目名称:vsmartcard,代码行数:45,代码来源:ifd-vpcd.c


示例20: dds_db_open

static int
dds_db_open(
	BackendDB	*be,
	ConfigReply	*cr )
{
	slap_overinst	*on = (slap_overinst *)be->bd_info;
	dds_info_t	*di = on->on_bi.bi_private;
	int		rc = 0;
	void		*thrctx = ldap_pvt_thread_pool_context();

	if ( slapMode & SLAP_TOOL_MODE )
		return 0;

	if ( DDS_OFF( di ) ) {
		goto done;
	}

	if ( SLAP_SINGLE_SHADOW( be ) ) {
		Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
			"DDS incompatible with shadow database \"%s\".\n",
			be->be_suffix[ 0 ].bv_val );
		return 1;
	}

	if ( di->di_max_ttl == 0 ) {
		di->di_max_ttl = DDS_RF2589_DEFAULT_TTL;
	}

	if ( di->di_min_ttl == 0 ) {
		di->di_max_ttl = DDS_RF2589_DEFAULT_TTL;
	}

	di->di_suffix = be->be_suffix;
	di->di_nsuffix = be->be_nsuffix;

	/* count the dynamic objects first */
	rc = dds_count( thrctx, be );
	if ( rc != LDAP_SUCCESS ) {
		rc = 1;
		goto done;
	}

	/* start expire task */
	ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
	di->di_expire_task = ldap_pvt_runqueue_insert( &slapd_rq,
		DDS_INTERVAL( di ),
		dds_expire_fn, di, "dds_expire_fn",
		be->be_suffix[ 0 ].bv_val );
	ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );

	/* register dinamicSubtrees root DSE info support */
	rc = entry_info_register( dds_entry_info, (void *)di );

done:;

	return rc;
}
开发者ID:Smilefant,项目名称:ReOpenLDAP,代码行数:57,代码来源:dds.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LogAccuracyHit函数代码示例发布时间:2022-05-30
下一篇:
C++ Log函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap