本文整理汇总了C++中dbglog函数的典型用法代码示例。如果您正苦于以下问题:C++ dbglog函数的具体用法?C++ dbglog怎么用?C++ dbglog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbglog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dbus_error_init
bool DBusCommunicator::initDBusComm(string strDbusPath/*=""*/,string strInterfaceName/*=""*/,
string strPrinterURI/*=""*/, string strPrinterName/*= ""*/, int iJobId/*=0*/, string strUser/*=""*/)
{
#ifdef HAVE_DBUS
DBusError objError;
DBusError * pDBusError=&objError;
m_strPrinterURI = strPrinterURI;
m_strPrinterName = strPrinterName;
m_strDbusInterface = strInterfaceName;
m_strDbusPath = strDbusPath;
m_strUser = strUser;
m_iJobId = iJobId;
dbus_error_init(pDBusError);
m_DbusConnPtr = dbus_bus_get(DBUS_BUS_SYSTEM, pDBusError);
if(dbus_error_is_set(pDBusError))
{
dbglog("Error: dBus Connection Error (%s)!\n", pDBusError->message);
dbus_error_free(pDBusError);
}
if(m_DbusConnPtr == NULL)
{
dbglog("Error: dBus Connection Error (%s)!\n", pDBusError->message);
return false;
}
#endif
return true;
}
开发者ID:Distrotech,项目名称:hplip,代码行数:30,代码来源:dbuscomm.cpp
示例2: vmdfs_fat_read
/* Common code for both fat_read and fat_write */
static int vmdfs_fat_read(const char *vmdfile, vmd_root_t * root, uint16 * fat_buf) {
uint16 fat_block, fat_size;
/* Find the FAT starting block and length */
fat_block = root->fat_loc;
fat_size = root->fat_size;
/* We can't reliably handle VMDs with a larger FAT... */
if(fat_size > 1) {
dbglog(DBG_ERROR, "vmdfs_fat_read: VMD has >1 (%d) FAT blocks\n",(int)fat_size);
return -1;
}
file_t f = fs_open(vmdfile,O_RDONLY);
fs_seek(f,fat_block*BLOCK_SIZE,SEEK_SET);
fs_read(f,(uint8 *)fat_buf,BLOCK_SIZE);
fs_close(f);
if(!*fat_buf) {
dbglog(DBG_ERROR, "vmdfs_fat_read: can't read block %d\n",(int)fat_block);
return -2;
}
return 0;
}
开发者ID:DC-SWAT,项目名称:DreamShell,代码行数:26,代码来源:vmdfs.c
示例3: pybackend_allowed_address
static int pybackend_allowed_address(u_int32_t addr)
{
int result = 0;
PyObject *ret = NULL;
PyObject *arg0 = NULL;
dbglog("pybackend plugin: allowed_address_hook(addr = %d)", addr);
arg0 = PyInt_FromSize_t(addr);
ret = pybackend_call_function("allowed_address_hook", 1, arg0);
if (ret == NULL || ret == Py_None)
{
goto Exit;
}
if (!PyBool_Check(ret))
{
warn("pybackend plugin: allowed_address_hook() did not return a boolean value");
goto Exit;
}
if (ret == Py_True)
{
result = 1;
}
Exit:
Py_CLEAR(arg0);
Py_CLEAR(ret);
dbglog("pybackend plugin: allowed_address_hook: %d", result);
return result;
}
开发者ID:ziyan,项目名称:pppd-backend,代码行数:34,代码来源:pybackend.c
示例4: check_gdi_image
static int check_gdi_image(file_t fd) {
char line[MAX_FN_LEN];
uint32 track_count;
fs_seek(fd, 0, SEEK_SET);
if(fs_gets(fd, line, MAX_FN_LEN) == NULL) {
#ifdef DEBUG
dbglog(DBG_DEBUG, "%s: Not a GDI image\n", __func__);
#endif
return -1;
}
track_count = strtoul(line, NULL, 0);
if(track_count == 0 || track_count > 99) {
#ifdef DEBUG
dbglog(DBG_DEBUG, "%s: Invalid GDI image\n", __func__);
#endif
return -1;
}
return (int)track_count;
}
开发者ID:DC-SWAT,项目名称:DreamShell,代码行数:25,代码来源:gdi.c
示例5: set_port
/**
* ポート番号設定
*
* @param[out] addr sockaddr_in構造体
* @param[in] port ポート番号またはサービス名
* @retval EX_NG エラー
*/
int
set_port(struct sockaddr_in *addr, const char *port)
{
struct servent *sp = NULL; /* サービス情報構造体 */
uint16_t portno = 0; /* ポート番号 */
const int base = 10; /* 基数 */
dbglog("start: addr=%p, port=%s", addr, port);
if (!addr || !port)
return EX_NG;
if (isdigit(port[0])) { /* 先頭が数字 */
portno = (uint16_t)strtol(port, NULL, base);
dbglog("portno=%"PRIu16", 0x%"PRIx16"", portno, portno);
if (portno <= 0 || 65535 <= portno) {
outlog("portno=%d", portno);
return EX_NG;
}
dbglog("portno=0x%"PRIx16"", htons(portno));
addr->sin_port = (u_short)htons(portno);
} else {
sp = getservbyname(port, "tcp");
if (!sp) {
outlog("getservbyname: port=%s", port);
return EX_NG;
}
addr->sin_port = sp->s_port;
}
dbglog("port=%"PRIu16"", ntohs((uint16_t)addr->sin_port));
return EX_OK;
}
开发者ID:sluchin,项目名称:calc,代码行数:39,代码来源:net.c
示例6: send_data
/**
* データ送信
*
* @param[in] sock ソケット
* @param[in] sdata データ
* @param[in,out] length データ長
* @retval EX_NG エラー
*/
int
send_data(const int sock, const void *sdata, size_t *length)
{
ssize_t len = 0; /* send戻り値 */
size_t left = 0; /* 残りのバイト数 */
const unsigned char *ptr = NULL; /* ポインタ */
dbglog("start: sdata=%p, length=%zu", sdata, *length);
ptr = (unsigned char *)sdata;
left = *length;
while (left > 0) {
len = send(sock, sdata, *length, 0);
dbglog("send=%zd, ptr=%p, left=%zu", len, ptr, left);
if (len <= 0) {
if ((errno == EINTR) ||
(errno == EAGAIN) || (errno == EWOULDBLOCK))
len = 0;
else
goto error_handler;
}
left -= len;
ptr += len;
}
*length -= left;
dbglog("send=%zd, sock=%d, ptr=%p, left=%zu, length=%zu",
len, sock, ptr, left, *length);
return EX_OK;
error_handler:
*length -= left;
outlog("send=%zd, sock=%d, ptr=%p, left=%zu, length=%zu",
len, sock, ptr, left, *length);
return EX_NG;
}
开发者ID:sluchin,项目名称:calc,代码行数:43,代码来源:net.c
示例7: gui_worker
static FFTHDCALL int gui_worker(void *param)
{
ffui_init();
ffui_wnd_initstyle();
if (0 != load_ui())
goto err;
wmain_init();
wabout_init();
wuri_init();
if (gg->conf.autosave_playlists)
corecmd_add(LOADLISTS, NULL);
FF_WRITEONCE(gg->state, 1);
dbglog("entering UI loop");
ffui_run();
dbglog("exited UI loop");
corecmd_add(A_ONCLOSE, NULL);
goto done;
err:
FF_WRITEONCE(gg->state, 1);
gg->load_err = 1;
done:
ffui_uninit();
return 0;
}
开发者ID:stsaz,项目名称:fmedia,代码行数:29,代码来源:gui.c
示例8: flashrom_get_region_only
int flashrom_get_region_only() {
int start, size;
uint8 region[6] = { 0 };
region[2] = *(uint8*)0x0021A002;
/* Find the partition */
if(flashrom_info(FLASHROM_PT_SYSTEM, &start, &size) < 0) {
dbglog(DBG_ERROR, "%s: can't find partition %d\n", __func__, FLASHROM_PT_SYSTEM);
} else {
/* Read the first 5 characters of that partition */
if(flashrom_read(start, region, 5) < 0) {
dbglog(DBG_ERROR, "%s: can't read partition %d\n", __func__, FLASHROM_PT_SYSTEM);
}
}
if(region[2] == 0x58 || region[2] == 0x30) {
return FLASHROM_REGION_JAPAN;
} else if(region[2] == 0x59 || region[2] == 0x31) {
return FLASHROM_REGION_US;
} else if(region[2] == 0x5A || region[2] == 0x32) {
return FLASHROM_REGION_EUROPE;
} else {
dbglog(DBG_ERROR, "%s: Unknown region code %02x\n", __func__, region[2]);
return FLASHROM_REGION_UNKNOWN;
}
}
开发者ID:WinCoder,项目名称:DreamShell,代码行数:30,代码来源:utils.c
示例9: tcpfs_read
static ssize_t tcpfs_read(void *h, void *buffer, size_t size) {
int len = 0;
TCPContext *s = (TCPContext *)h;
uint8 *buf = (uint8 *)buffer;
do {
int l;
#ifdef DEBUG
dbglog(DBG_DEBUG, "TCPFS: reading size %d -->", size);
#endif
l = read(s->socket, buf, size);
#ifdef DEBUG
dbglog(DBG_DEBUG, " %d\n", l);
#endif
if (l >= 0) {
len += l;
s->pos += l;
buf += l;
size -= l;
} else if (len == 0)
return l;
else
return len;
} while(s->stream && 0 < size);
return len;
}
开发者ID:WinCoder,项目名称:DreamShell,代码行数:33,代码来源:tcpfs.c
示例10: pybackend_ip_choose
static void pybackend_ip_choose(u_int32_t *addr)
{
PyObject *ret = NULL;
PyObject *arg0 = NULL;
dbglog("pybackend plugin: ip_choose_hook(addr = %d)", *addr);
arg0 = PyInt_FromSize_t(*addr);
ret = pybackend_call_function("ip_choose_hook", 1, arg0);
if (ret == NULL || ret == Py_None)
{
goto Exit;
}
if (!PyInt_Check(ret))
{
warn("pybackend plugin: return value of ip_choose_hook() is not an int");
goto Exit;
}
//
// No failure.
//
*addr = PyInt_AsUnsignedLongMask(ret);
Exit:
Py_CLEAR(arg0);
Py_CLEAR(ret);
dbglog("pybackend plugin: ip_choose_hook: %d", *addr);
return;
}
开发者ID:ziyan,项目名称:pppd-backend,代码行数:34,代码来源:pybackend.c
示例11: pybackend_chap_check
static int pybackend_chap_check(void)
{
int result = 0;
PyObject *ret = NULL;
dbglog("pybackend plugin: chap_check_hook()");
ret = pybackend_call_function("chap_check_hook", 0);
if (ret == NULL || ret == Py_None)
{
goto Exit;
}
if (!PyBool_Check(ret))
{
warn("pybackend plugin: chap_check_hook() did not return a boolean value");
goto Exit;
}
if (ret == Py_True)
{
result = 1;
}
Exit:
Py_CLEAR(ret);
dbglog("pybackend plugin: chap_check_hook: %d", result);
return result;
}
开发者ID:ziyan,项目名称:pppd-backend,代码行数:31,代码来源:pybackend.c
示例12: ChallengeResponse
static void
ChallengeResponse(u_char *challenge,
u_char PasswordHash[MD4_SIGNATURE_SIZE],
u_char response[24])
{
u_char ZPasswordHash[21];
BZERO(ZPasswordHash, sizeof(ZPasswordHash));
BCOPY(PasswordHash, ZPasswordHash, MD4_SIGNATURE_SIZE);
#if 0
dbglog("ChallengeResponse - ZPasswordHash %.*B",
sizeof(ZPasswordHash), ZPasswordHash);
#endif
(void) DesSetkey(ZPasswordHash + 0);
DesEncrypt(challenge, response + 0);
(void) DesSetkey(ZPasswordHash + 7);
DesEncrypt(challenge, response + 8);
(void) DesSetkey(ZPasswordHash + 14);
DesEncrypt(challenge, response + 16);
#if 0
dbglog("ChallengeResponse - response %.24B", response);
#endif
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:26,代码来源:chap_ms.c
示例13: ySafeTrace
void ySafeTrace(const char *file,u32 line,void *ptr)
{
u32 i;
YMEM_ENTRY *entry;
yEnterCriticalSection(&yMapCS);
for(i=0, entry=yMap; i< yMapUsed ; i++,entry++){
YASSERT(entry->state != YMEM_NOT_USED);
if(entry->ptr == ptr)
break;
}
if(i == yMapUsed){
dbglog("Update trace of unallocated pointer 0x%x at %s:%d\n\n",ptr,file,line);
ymemdump();
YASSERT(0);
}
if(entry->state == YMEM_FREED){
dbglog("Update trace of allready freed pointer (0x%x) at %s:%d\n",ptr,file,line);
dbglog("was allocated at %s:%d size =%d freed at %s:%d\n\n",
entry->malloc_file, entry->malloc_line, entry->malloc_size, entry->free_file,entry->free_line);
ymemdump();
YASSERT(0);
}
ymemdumpentry(entry,"trace");
entry->malloc_file = file;
entry->malloc_line = line;
yLeaveCriticalSection(&yMapCS);
}
开发者ID:lucasroitman,项目名称:rosyocto3d,代码行数:28,代码来源:ymemory.c
示例14: set_block
/**
* ブロッキングモードの設定
*
* @param[in] fd ファイルディスクリプタ
* @param[in] mode ブロッキングモード
* @retval EX_NG エラー
*/
int
set_block(int fd, blockmode mode)
{
int flags = 0; /* fcntl戻り値(F_GETFL) */
int retval = 0; /* fcntl戻り値(F_SETFL) */
flags = fcntl(fd, F_GETFL, 0);
if (flags < 0) {
outlog("fcntl=0x%x", flags);
return EX_NG;
}
dbglog("fcntl=0x%x", flags);
if (mode == NONBLOCK) { /* ノンブロッキング */
retval = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
if (retval < 0)
outlog("fcntl=%d", retval);
} else if (mode == BLOCKING) { /* ブロッキング */
retval = fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
if (retval < 0)
outlog("fcntl=%d", retval);
} else { /* no mode */
outlog("mode=%d", mode);
return EX_NG;
}
#ifdef _DEBUG
flags = fcntl(fd, F_GETFL, 0);
if (flags < 0)
dbglog("fcntl=0x%x", flags);
dbglog("fcntl=0x%x", flags);
#endif /* _DEBUG */
return EX_OK;
}
开发者ID:sluchin,项目名称:calc,代码行数:42,代码来源:net.c
示例15: launch_callmgr
/*** call the call manager main ***********************************************/
static void launch_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int window)
{
dbglog("pptp: call manager for %s\n", inet_ntoa(inetaddr));
dbglog("window size:\t%d\n",window);
if (phonenr) dbglog("phone number:\t'%s'\n",phonenr);
dbglog("call id:\t%d\n",call_id);
exit(callmgr_main(inetaddr, phonenr, window, call_id));
}
开发者ID:Yui-Qi-Tang,项目名称:openwrtPKG,代码行数:9,代码来源:pptp.c
示例16: send_slow_cmd
static uint8 send_slow_cmd (
uint8 cmd, /* Command byte */
uint32 arg /* Argument */
)
{
uint8 n, res;
uint8 cb[6];
int i;
(void)spi_slow_sr_byte(0xff);
i = 0;
do {
res = spi_slow_sr_byte(0xff);
i++;
} while ((res != 0xFF) && i < 100000);
if (res != 0xff) {
#ifdef SD_DEBUG
dbglog(DBG_DEBUG, "%s: CMD 0x%02x error\n", __func__, cmd);
#endif
return(0xff);
}
cb[0] = cmd;
cb[1] = (uint8)(arg >> 24);
cb[2] = (uint8)(arg >> 16);
cb[3] = (uint8)(arg >> 8);
cb[4] = (uint8)arg;
cb[5] = sd_crc7(cb, 5, 0);
/* Send command packet */
spi_slow_sr_byte(cmd); /* Command */
spi_slow_sr_byte(cb[1]); /* Argument[31..24] */
spi_slow_sr_byte(cb[2]); /* Argument[23..16] */
spi_slow_sr_byte(cb[3]); /* Argument[15..8] */
spi_slow_sr_byte(cb[4]); /* Argument[7..0] */
spi_slow_sr_byte(cb[5]); // CRC7
/* Receive command response */
if (cmd == CMD12)
(void)spi_slow_sr_byte(0xff);/* Skip a stuff byte when stop reading */
n = 20; /* Wait for a valid response in timeout of 10 attempts */
do {
res = spi_slow_sr_byte(0xff);
} while ((res & 0x80) && --n);
#ifdef SD_DEBUG
dbglog(DBG_DEBUG, "%s: CMD 0x%02x response 0x%02x\n", __func__, cmd, res);
#endif
return res; /* Return with the response value */
}
开发者ID:DC-SWAT,项目名称:DreamShell,代码行数:56,代码来源:sd.c
示例17: dbglog
bool DBusCommunicator::sendEvent(string strDbusPath,string strInterfaceName, string strDeviceURI, string strPrinterName, int iEvent,
string strTitle/*=""*/, int iJobId/*=0*/, string strUser/*=""*/)
{
#ifdef HAVE_DBUS
if(NULL == m_DbusConnPtr )
{
dbglog("Error: dBus connection ptr is NULL.\n");
return false;
}
if(true == strDbusPath.empty() || true == strInterfaceName.empty() || 0 == iEvent)
{
dbglog("Error: dBus service Name can't be empty. DBus Path(%s) DBus Interface (%s) Event(%d)!\n",
strDbusPath.c_str(), strInterfaceName.c_str(), iEvent);
return false;
}
DBusMessage * msg = dbus_message_new_signal(strDbusPath.c_str(), strInterfaceName.c_str(), "Event");
if (NULL == msg)
{
dbglog("Error: dBus dbus_message_new_signal returned error. DBus Interface (%s) Event(%d)!\n", strInterfaceName.c_str(), iEvent);
return false;
}
if (NULL == msg)
{
dbglog("dbus message is NULL!\n");
return false;
}
const char * stURI=strDeviceURI.c_str();
const char * stPRNTNM=strPrinterName.c_str();
const char * stUSR=strUser.c_str();
const char * stTtl=strTitle.c_str();
dbus_message_append_args(msg,
DBUS_TYPE_STRING, &stURI,
DBUS_TYPE_STRING, &stPRNTNM,
DBUS_TYPE_UINT32, &iEvent,
DBUS_TYPE_STRING, &stUSR,
DBUS_TYPE_UINT32, &iJobId,
DBUS_TYPE_STRING, &stTtl,
DBUS_TYPE_INVALID);
if (!dbus_connection_send(m_DbusConnPtr , msg, NULL))
{
dbglog("dbus message send failed!\n");
return false;
}
dbus_connection_flush(m_DbusConnPtr );
dbus_message_unref(msg);
#endif
return true;
}
开发者ID:Distrotech,项目名称:hplip,代码行数:55,代码来源:dbuscomm.cpp
示例18: test_stop_timer
/**
* stop_timer() 関数テスト
*
* @return なし
*/
void
test_stop_timer(void)
{
unsigned int t = 0, time = 0; /* タイマ用変数 */
start_timer(&t);
dbglog("t=%u", t);
time = stop_timer(&t);
dbglog("time=%u", time);
cut_assert_operator(time, >, 0);
}
开发者ID:sluchin,项目名称:calc,代码行数:16,代码来源:test_timer.c
示例19: process_line
static int process_line(HTTPContext *s, char *line, int line_count) {
char *tag, *p;
/* end of header */
if (line[0] == '\0')
return 0;
p = line;
if (line_count == 0) {
while (!isspace(*p) && *p != '\0')
p++;
while (isspace(*p))
p++;
s->http_code = strtol(p, NULL, 10);
#ifdef DEBUG
dbglog(DBG_DEBUG, "http_code=%d\n", s->http_code);
#endif
} else {
while (*p != '\0' && *p != ':')
p++;
if (*p != ':')
return 1;
*p = '\0';
tag = line;
p++;
while (isspace(*p))
p++;
if (!strcmp(tag, "Location")) {
strcpy(s->location, p);
}
if (!strcmp(tag, "Content-Length")) {
s->len = strtol(p, NULL, 10);
#ifdef DEBUG
dbglog(DBG_DEBUG, "len=%d\n", s->len);
#endif
}
}
return 1;
}
开发者ID:DC-SWAT,项目名称:DreamShell,代码行数:52,代码来源:httpfs.c
示例20: pybackend_chap_verify
static int pybackend_chap_verify(char *name, char *ourname, int id, struct chap_digest_type *digest, unsigned char *challenge, unsigned char *response, char *message, int message_space)
{
int result = 0;
PyObject *ret = NULL;
PyObject *arg0 = NULL;
PyObject *arg1 = NULL;
PyObject *arg2 = NULL;
char *secret = NULL;
size_t secret_len = 0;
dbglog("pybackend plugin: chap_verify_hook(name = %s, ourname = %s, id = %d, ipparm = %s)", name, ourname, id, ipparam);
arg0 = PyString_FromString(name);
arg1 = PyString_FromString(ourname);
arg2 = PyString_FromString(ipparam);
ret = pybackend_call_function("chap_verify_hook", 3, arg0, arg1, arg2);
if (ret == NULL || ret == Py_None)
{
goto Exit;
}
if (!PyString_Check(ret))
{
warn("pybackend plugin: return value of chap_verify_hook() is not a string");
goto Exit;
}
secret = PyString_AsString(ret);
secret_len = strlen(secret);
dbglog("pybackend plugin: chap_verify_hook: %s, %d", secret, secret_len);
if (!digest->verify_response(id, name, (unsigned char *)secret, secret_len, challenge, response, message, message_space))
{
goto Exit;
}
//
// No failure.
//
result = 1;
Exit:
Py_CLEAR(arg0);
Py_CLEAR(arg1);
Py_CLEAR(arg2);
Py_CLEAR(ret);
dbglog("pybackend plugin: chap_verify_hook: %d", result);
return result;
}
开发者ID:ziyan,项目名称:pppd-backend,代码行数:52,代码来源:pybackend.c
注:本文中的dbglog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论