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

C++ PERR函数代码示例

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

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



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

示例1: qof_date_format_set

void qof_date_format_set(QofDateFormat df)
{
    if (df >= DATE_FORMAT_FIRST && df <= DATE_FORMAT_LAST)
    {
        prevQofDateFormat = dateFormat;
        dateFormat = df;
    }
    else
    {
        /* hack alert - Use a neutral default. */
        PERR("non-existent date format set attempted. Setting ISO default");
        prevQofDateFormat = dateFormat;
        dateFormat = QOF_DATE_FORMAT_ISO;
    }

    return;
}
开发者ID:gijut,项目名称:gnucash,代码行数:17,代码来源:gnc-date.cpp


示例2: qof_commit_edit

gboolean qof_commit_edit (QofInstance *inst)
{
    QofInstancePrivate *priv;

    if (!inst) return FALSE;

    priv = GET_PRIVATE(inst);
    priv->editlevel--;
    if (0 < priv->editlevel) return FALSE;

    if (0 > priv->editlevel)
    {
        PERR ("unbalanced call - resetting (was %d)", priv->editlevel);
        priv->editlevel = 0;
    }
    return TRUE;
}
开发者ID:TumbleweedPretzel,项目名称:gnucash,代码行数:17,代码来源:qofinstance.cpp


示例3: if

template<> void
GncDbiProviderImpl<DbType::DBI_SQLITE>::append_col_def(std::string& ddl,
        const GncSqlColumnInfo& info)
{
    const char* type_name = nullptr;

    if (info.m_type == BCT_INT)
    {
        type_name = "integer";
    }
    else if (info.m_type == BCT_INT64)
    {
        type_name = "bigint";
    }
    else if (info.m_type == BCT_DOUBLE)
    {
        type_name = "float8";
    }
    else if (info.m_type == BCT_STRING || info.m_type == BCT_DATE
             || info.m_type == BCT_DATETIME)
    {
        type_name = "text";
    }
    else
    {
        PERR ("Unknown column type: %d\n", info.m_type);
        type_name = "";
    }
    ddl += (info.m_name + " " + type_name);
    if (info.m_size != 0)
    {
        ddl += "(" + std::to_string(info.m_size) + ")";
    }
    if (info.m_primary_key)
    {
        ddl += " PRIMARY KEY";
    }
    if (info.m_autoinc)
    {
        ddl += " AUTOINCREMENT";
    }
    if (info.m_not_null)
    {
        ddl += " NOT NULL";
    }
}
开发者ID:Bob-IT,项目名称:gnucash,代码行数:46,代码来源:gnc-dbiproviderimpl.hpp


示例4: wl_pointer_req

s8 wl_pointer_req(struct client *c,s32 pointer_slot,struct msg *m)
{
  s8 r;
  switch(m->req_op){
  case WL_POINTER_SET_CURSOR:
    r=set_cursor(c,pointer_slot,m);
    break;
  case WL_POINTER_CLOSE:
    LOG_WIRE("client(%d):pointer::close pointer_id=%u\n",c->so,m->req[0]);
    r=pointer_close(c,pointer_slot);
    break;
  default:
    PERR("client(%d):fatal:pointer unknown opcode %u\n",c->so,m->req_op);
    r=LWL_ERR;
  };
  return r;
}
开发者ID:sylware,项目名称:lwl,代码行数:17,代码来源:wl_pointer.c


示例5: set_options

static void
set_options(dbi_conn conn, const PairVec& options)
{
    for (auto option : options)
    {
        auto opt = option.first.c_str();
        auto val = option.second.c_str();
        auto result = dbi_conn_set_option(conn, opt, val);
        if (result < 0)
        {
            const char *msg = nullptr;
            int err = dbi_conn_error(conn, &msg);
            PERR("Error setting %s option to %s: %s", opt, val, msg);
            throw std::runtime_error(msg);
        }
    }
}
开发者ID:tmertens,项目名称:gnucash,代码行数:17,代码来源:gnc-backend-dbi.cpp


示例6: gnc_ui_file_access_response_cb

void
gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unused)
{
    FileAccessWindow* faw;
    gchar* url;

    g_return_if_fail( dialog != NULL );

    faw = g_object_get_data( G_OBJECT(dialog), "FileAccessWindow" );
    g_return_if_fail( faw != NULL );

    switch ( response )
    {
    case GTK_RESPONSE_HELP:
        gnc_gnome_help( HF_HELP, HL_GLOBPREFS );
        break;

    case GTK_RESPONSE_OK:
        url = geturl( faw );
        if ( url == NULL )
        {
            return;
        }
        if ( faw->type == FILE_ACCESS_OPEN )
        {
            gnc_file_open_file( url );
        }
        else if ( faw->type == FILE_ACCESS_SAVE_AS )
        {
            gnc_file_do_save_as( url );
        }
        break;

    case GTK_RESPONSE_CANCEL:
        break;

    default:
        PERR( "Invalid response" );
        break;
    }

    if ( response != GTK_RESPONSE_HELP )
    {
        gtk_widget_destroy( GTK_WIDGET(dialog) );
    }
}
开发者ID:cstim,项目名称:gnucash-svn,代码行数:46,代码来源:dialog-file-access.c


示例7: g_str_has_suffix

template<> void
error_handler<DbType::DBI_PGSQL> (dbi_conn conn, void* user_data)
{
    GncDbiBackend<DbType::DBI_PGSQL>* dbi_be =
        static_cast<decltype(dbi_be)>(user_data);
    const char* msg;

    (void)dbi_conn_error (conn, &msg);
    if (g_str_has_prefix (msg, "FATAL:  database") &&
        g_str_has_suffix (msg, "does not exist\n"))
    {
        PINFO ("DBI error: %s\n", msg);
        dbi_be->set_exists(false);
    }
    else if (g_strrstr (msg,
                        "server closed the connection unexpectedly"))    // Connection lost
    {
        if (!dbi_be->connected())
        {
            PWARN ("DBI Error: Connection lost, connection pointer invalid");
            return;
        }
        PINFO ("DBI error: %s - Reconnecting...\n", msg);
        dbi_be->set_dbi_error (ERR_BACKEND_CONN_LOST, 1, true);
        dbi_be->retry_connection(msg);
    }
    else if (g_str_has_prefix (msg, "connection pointer is NULL") ||
             g_str_has_prefix (msg, "could not connect to server"))       // No connection
    {

        if (!dbi_be->connected())
            qof_backend_set_error(reinterpret_cast<QofBackend*>(dbi_be),
                                  ERR_BACKEND_CANT_CONNECT);
        else
        {
            dbi_be->set_dbi_error(ERR_BACKEND_CANT_CONNECT, 1, true);
            dbi_be->retry_connection (msg);
        }
    }
    else
    {
        PERR ("DBI error: %s\n", msg);
        if (dbi_be->connected())
            dbi_be->set_dbi_error (ERR_BACKEND_MISC, 0, false);
    }
}
开发者ID:limitedAtonement,项目名称:gnucash,代码行数:46,代码来源:gnc-backend-dbi.cpp


示例8: htc_fingerprint_init

static int __init htc_fingerprint_init(void)
{
	int ret;

	ret = register_chrdev(0, DEVICE_NAME, &htc_fingerprint_fops);
	if (ret < 0) {
		PERR("register module fail");
		return ret;
	}
	htc_fingerprint_major = ret;

	htc_fingerprint_class = class_create(THIS_MODULE, "htc_fingerprint");
	device_create(htc_fingerprint_class, NULL, MKDEV(htc_fingerprint_major, 0), NULL, DEVICE_NAME);

	PDEBUG("register module ok");
	return 0;
}
开发者ID:BackupWildfireDEV,项目名称:ElementalX-Sense-5.0.2,代码行数:17,代码来源:htc_fingerprint.c


示例9: wl_shm_pool_buffer_req

s8 wl_shm_pool_buffer_req(struct client *c,s32 shm_pool_buffer_slot,
                                                                  struct msg *m)
{
  s8 r;
  switch(m->req_op){
  case WL_BUFFER_DESTROY:
    LOG_WIRE("client(%d):shm_pool_buffer::destroy shm_pool_buffer_id=%u\n",
                                                               c->so,m->req[0]);
    r=shm_pool_buffer_destroy(c,shm_pool_buffer_slot);
    break;
  default:
    PERR("client(%d):fatal:shm_pool_buffer unknown opcode %u\n",c->so,
                                                                     m->req_op);
    r=LWL_ERR;
  };
  return r;
}
开发者ID:sylware,项目名称:lwl,代码行数:17,代码来源:wl_shm_pool_buffer.c


示例10: ntohs

bool CTun::injectIp6Packet(IpPacket::IPv6* p_poPacket)
{
	/* ipv6 payload + ipv6 header itself */
	ssize_t packetLen = ntohs(p_poPacket->m_u16_PayloadLength) + offsetof(IpPacket::IPv6, m_oIP_Payload);
	if (packetLen > MAX_IP_PACKET_SIZE)
	{
		NLOG_WARN("CTun::injectIp6Packet, packetLen(%d) > MAX_PACKET_SIZE(%d)", packetLen, MAX_IP_PACKET_SIZE );
		return false;
	}
	Ip6PseudoHdr oPHdr(p_poPacket);
	// pseudoheader checksum
	uint16_t checksum = IpPacket::Checksum((uint8_t*)&oPHdr, sizeof oPHdr);
	switch(p_poPacket->m_u8_NextHeader)
	{
		case IPPROTO_ICMPV6:
			p_poPacket->m_oICMP_Payload.m_u16_Checksum = 0;
			/* substract the ipv6 header size from the whole packet length */
			p_poPacket->m_oICMP_Payload.m_u16_Checksum = htons(IpPacket::Checksum((const uint8_t*)&p_poPacket->m_oICMP_Payload,
								packetLen - offsetof(IpPacket::IPv6, m_oIP_Payload), checksum));
			break;
		case IPPROTO_UDP:
			p_poPacket->m_oUDP_Payload.m_u16_Checksum = 0;
			/* substract the ipv6 header size from the whole packet length */
			checksum = IpPacket::Checksum((const uint8_t*)&p_poPacket->m_oUDP_Payload
					, packetLen - offsetof(IpPacket::IPv6, m_oIP_Payload), checksum);
			if(!checksum){
				p_poPacket->m_oUDP_Payload.m_u16_Checksum = 0xFFFF;
			}else{
				p_poPacket->m_oUDP_Payload.m_u16_Checksum = htons(checksum);
			}
			break;
		default:
			NLOG_ERR("CTun::injectIp6Packet: unsupported IP next header %d, discarding packet", p_poPacket->m_u8_NextHeader);
			return false;
	}
	ssize_t bw = write(m_nTunHandle, p_poPacket, packetLen);
	if(bw < packetLen)
	{
		PERR("CTun::injectIp6Packet, write "TUN_INTERFACE);
		return false;
	}
	NLOG_DBG("injectIp6Packet, if:%s, sz:%d, data[%s%s]", m_szTunName, bw,
		GET_HEX_LIMITED(&p_poPacket, (size_t)bw, m_uHexLimit))
	return true;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:45,代码来源:Tun.cpp


示例11: gnc_register_gui_component_internal

static ComponentInfo *
gnc_register_gui_component_internal (const char * component_class)
{
    ComponentInfo *ci;
    gint component_id;

    g_return_val_if_fail (component_class, NULL);

    /* look for a free handler id */
    component_id = next_component_id;

    /* design warning: if we ever get 2^32-1 components,
       this loop is infinite.  Instead of fixing it, we'll just
       complain when (if) we get half way there (probably never).
    */
    while (find_component (component_id))
        if (++component_id == NO_COMPONENT)
            component_id++;

    if (component_id < 0)
        PERR("Amazing! Half way to running out of component_ids.");

    /* found one, add the handler */
    ci = g_new0 (ComponentInfo, 1);

    ci->watch_info.event_masks = g_hash_table_new (g_str_hash, g_str_equal);
    ci->watch_info.entity_events = guid_hash_table_new ();

    ci->component_class = g_strdup (component_class);
    ci->component_id = component_id;
    ci->session = NULL;

    components = g_list_prepend (components, ci);

    /* update id for next registration */
    next_component_id = component_id + 1;

#if CM_DEBUG
    fprintf (stderr, "Register component %d in class %s\n",
             component_id, component_class ? component_class : "(null)");
    dump_components ();
#endif

    return ci;
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:45,代码来源:gnc-component-manager.c


示例12: set_cursor

static s8 set_cursor(struct client *c,s32 pointer_slot,struct msg *m)
{
  s8 r;
  if(m->req_dws<6){
    PERR("client(%d):fatal:pointer::set_cursor missing data\n",c->so);
    r=LWL_ERR;goto exit;
  }

  LOG_WIRE("client(%d):pointer::set_cursor serial=%u surface_id=%u"
                       " hotspot_x=%d hotspot_y=%d\n",c->so,m->req[2],m->req[3],
                                                 (s32)m->req[4],(s32)m->req[5]);

  r=pointer_set_cusor(c,pointer_slot,m->req[2],m->req[3],(s32)m->req[4],
                                                              (  s32)m->req[5]);

exit:
  return r;
}
开发者ID:sylware,项目名称:lwl,代码行数:18,代码来源:wl_pointer.c


示例13: socket

bool CTun::BringUpIp6(in6_addr& p_IP, unsigned p_uMtu)
{
	m_nTunSocket = socket(AF_INET6, SOCK_DGRAM, 0);
	ioctl(m_nTunSocket, SIOGIFINDEX, &ifr);

	struct in6_ifreq ifr6;
	ifr6.ifr6_ifindex = ifr.ifr_ifindex;
	ifr6.ifr6_prefixlen = 64;
	ifr6.ifr6_addr = p_IP;

	if (ioctl(m_nTunSocket, SIOCSIFADDR, &ifr6) < 0)
	{
		PERR("SIOCSIFADDR: "TUN_INTERFACE", %s", m_szTunName);
		return false;
	}

	return bringUp(p_uMtu);;
}
开发者ID:irares,项目名称:WirelessHart-Gateway,代码行数:18,代码来源:Tun.cpp


示例14: gnc_gnome_locate_pixmap

char *
gnc_gnome_locate_pixmap (const char *name)
{
    char *fullname;

    g_return_val_if_fail (name != NULL, NULL);

    fullname = gnome_program_locate_file (gnucash_program,
                                          GNOME_FILE_DOMAIN_APP_PIXMAP,
                                          name, TRUE, NULL);
    if (fullname == NULL)
    {
        PERR ("Could not locate pixmap/pixbuf file %s", name);
        return NULL;
    }

    return fullname;
}
开发者ID:nishmu,项目名称:gnucash,代码行数:18,代码来源:gnc-gnome-utils.c


示例15: xml

void QGenodeClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
{
	if (!data || !data->hasText() || !supportsMode(mode))
		return;

	QString text = data->text();
	QByteArray utf8text = text.toUtf8();

	if (!_clipboard_reporter)
		return;

	try {
		Genode::Reporter::Xml_generator xml(*_clipboard_reporter, [&] () {
			xml.append_sanitized(utf8text.constData(), utf8text.size()); });
	} catch (...) {
		PERR("could not write clipboard data");
	}
}
开发者ID:decaprox,项目名称:genode,代码行数:18,代码来源:qgenodeclipboard.cpp


示例16: gnc_close_gui_component

void
gnc_close_gui_component (gint component_id)
{
    ComponentInfo *ci;

    ci = find_component (component_id);
    if (!ci)
    {
        PERR ("component not found");
        return;
    }

    if (!ci->close_handler)
        return;

    if (ci->close_handler)
        ci->close_handler (ci->user_data);
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:18,代码来源:gnc-component-manager.c


示例17: gnc_configure_date_format

/* gnc_configure_date_format
 *    sets dateFormat to the current value on the scheme side
 *
 * Args: Nothing
 * Returns: Nothing
 */
static void
gnc_configure_date_format (void)
{
    QofDateFormat df = gnc_prefs_get_int(GNC_PREFS_GROUP_GENERAL,
                                         GNC_PREF_DATE_FORMAT);

    /* Only a subset of the qof date formats is currently
     * supported for date entry.
     */
    if ((df > QOF_DATE_FORMAT_LOCALE)
            || (df > QOF_DATE_FORMAT_LOCALE))
    {
        PERR("Incorrect date format");
        return;
    }

    qof_date_format_set(df);
}
开发者ID:jralls,项目名称:gnucash,代码行数:24,代码来源:gnc-gnome-utils.c


示例18: gnc_dom_tree_to_address

gboolean
gnc_dom_tree_to_address (xmlNodePtr node, GncAddress *address)
{
    struct address_pdata addr_pdata;
    gboolean successful;

    addr_pdata.address = address;

    successful = dom_tree_generic_parse (node, address_handlers_v2,
                                         &addr_pdata);

    if (!successful)
    {
        PERR ("failed to parse address tree");
    }

    return successful;
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:18,代码来源:gnc-address-xml-v2.c


示例19: mmls_init

/*
 * mmls_init()
 *
 * This function returns memory size and phys addr from lower cmd
 * driver. Cmd driver is the direct interface to hardware module.
 *
 * Currently, cmd drv returns one device only.
 * To support more mmls device with 1 major cdev and multiple
 * minor num cdev, then cmd drv and mmls_init fn need to be changed
 */
static int mmls_init(void)
{
	PINFO("%s: enter\n", __func__);

	if (mmls_io_init()) {
		PERR("mmls_start/mmls_size is zero. ret=%d\n", -EINVAL);
		return -EINVAL;
	}

	get_mmls_iodata(&mmls_io_data);

	PINFO("%s: found mmls device with size and addr:\n", __func__);
	PINFO("mmls_io_data.m_size=%lu\n", mmls_io_data.m_size);
	PINFO("mmls_io_data.m_iomem=%p\n", mmls_io_data.m_iomem);
	PINFO("mmls_nsectors=%lu", (mmls_io_data.m_size)/HV_BLOCK_SIZE);

	return 0;
}
开发者ID:ssg10,项目名称:linux_char_driver_and_app,代码行数:28,代码来源:hv_cdev.c


示例20: set_popup

static s8 set_popup(struct client *c,s32 shell_surface_slot,struct msg *m)
{
  s8 r;
  if(m->req_dws<8){
    PERR("client(%d):fatal:shell_surface::set_popup missing data\n",c->so);
    r=LWL_ERR;goto exit;
  }

  LOG_WIRE("client(%d):shell_surface::set_popup seat_id=%u serial=%u"
                  " parent_surface_id=%u x=%d y=%d flags=%u \n",c->so,m->req[2],
                              m->req[3],m->req[4],(s32)m->req[5],(s32)m->req[6],
                                                                     m->req[7]);

  r=shell_surface_set_popup(c,shell_surface_slot,m->req[2],m->req[3],m->req[4],
                                       (s32)m->req[5],(s32)m->req[6],m->req[7]);
exit:
  return r;
}
开发者ID:sylware,项目名称:lwl,代码行数:18,代码来源:wl_shell_surface.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ PERL_SET_CONTEXT函数代码示例发布时间: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