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

C++ p_err函数代码示例

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

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



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

示例1: msgfree

int msgfree(msg_q_t msgid)
{
	int i;
	INT8U perr;

	for (i = 0; i < OS_MAX_QS; i++)
	{
		if (q_man[i].msg == msgid)
			break;
	}
	if (i >= OS_MAX_QS)
	{
		p_err("msgfree: err no match msg_q %x", msgid);
		return  - 1;
	}

	OSQDel((OS_EVENT*)msgid, OS_DEL_ALWAYS, &perr);
	if (OS_ERR_NONE != perr)
	{
		p_err("msgfree: free err %d", perr);
		return  - 1;
	}

	if (!q_man[i].q_start)
	{
		assert(0);
	}

	mem_free(q_man[i].q_start);
	q_man[i].q_start = 0;
	q_man[i].msg = 0;

	return 0;
}
开发者ID:foxwolf,项目名称:yjd,代码行数:34,代码来源:msg_q.c


示例2: query_flow_dissector

static int query_flow_dissector(struct bpf_attach_info *attach_info)
{
	__u32 attach_flags;
	__u32 prog_ids[1];
	__u32 prog_cnt;
	int err;
	int fd;

	fd = open("/proc/self/ns/net", O_RDONLY);
	if (fd < 0) {
		p_err("can't open /proc/self/ns/net: %d",
		      strerror(errno));
		return -1;
	}
	prog_cnt = ARRAY_SIZE(prog_ids);
	err = bpf_prog_query(fd, BPF_FLOW_DISSECTOR, 0,
			     &attach_flags, prog_ids, &prog_cnt);
	close(fd);
	if (err) {
		if (errno == EINVAL) {
			/* Older kernel's don't support querying
			 * flow dissector programs.
			 */
			errno = 0;
			return 0;
		}
		p_err("can't query prog: %s", strerror(errno));
		return -1;
	}

	if (prog_cnt == 1)
		attach_info->flow_dissector_id = prog_ids[0];

	return 0;
}
开发者ID:avagin,项目名称:linux,代码行数:35,代码来源:net.c


示例3: msgrcv

int msgrcv(msg_q_t msgid, void **msgbuf, unsigned int timeout)
{
	INT8U perr;

	if (0 == msgid)
	{
		p_err("msgrcv: msgid err");
		return  - 1;
	}

	if ((timeout > 0) && (timeout < 1000uL / OS_TICKS_PER_SEC))
		timeout = 1000uL / OS_TICKS_PER_SEC;

	timeout = timeout * OS_TICKS_PER_SEC / 1000uL;

	*msgbuf = OSQPend((OS_EVENT*)msgid, (INT32U)timeout, &perr);

	if (perr == OS_ERR_NONE)
		return 0;
	else if (perr == OS_ERR_TIMEOUT)
		return 1;

	p_err("msgrcv: err %d", perr);
	return  - 1;
}
开发者ID:foxwolf,项目名称:yjd,代码行数:25,代码来源:msg_q.c


示例4: main

int main()
{
	int ret;
	//环境初始化
	inittest();
	ret = syn_init();
	p_err(ret);
	ret = syn_rwlock_init(2);
	p_err(ret);

	//测试用例1
	ret = syn_rwlock_destroy(2);
	assert(ret == 0,"syn_rwlock_destroy Use Case 1 error");

	//测试用例2
	ret = syn_rwlock_init(2);
	p_err(ret);
	ret = syn_rwlock_destroy(64);
	assert(ret == -ERR_INVAL,"syn_rwlock_destroy Use Case 2 error");

	//测试用例3
	ret = syn_rwlock_destroy(4);
	assert(ret == -ERR_NOINIT,"syn_rwlock_destroy Use Case 3 error");

	//测试用例4
	ret = syn_rwlock_rd(2,SYN_RECV_BLOCK);
	p_err(ret);
	ret = syn_rwlock_destroy(2);
	assert(ret == -ERR_BUSY,"syn_rwlock_destroy Use Case 4 error");

	finaltest();
	return 0;
}
开发者ID:caicry,项目名称:sge800,代码行数:33,代码来源:c-xt-syn-rwlockdestroy.c


示例5: map_parse_fd

int map_parse_fd(int *argc, char ***argv)
{
	int fd;

	if (is_prefix(**argv, "id")) {
		unsigned int id;
		char *endptr;

		NEXT_ARGP();

		id = strtoul(**argv, &endptr, 0);
		if (*endptr) {
			p_err("can't parse %s as ID", **argv);
			return -1;
		}
		NEXT_ARGP();

		fd = bpf_map_get_fd_by_id(id);
		if (fd < 0)
			p_err("get map by id (%u): %s", id, strerror(errno));
		return fd;
	} else if (is_prefix(**argv, "pinned")) {
		char *path;

		NEXT_ARGP();

		path = **argv;
		NEXT_ARGP();

		return open_obj_pinned_any(path, BPF_OBJ_MAP);
	}

	p_err("expected 'id' or 'pinned', got: '%s'?", **argv);
	return -1;
}
开发者ID:avagin,项目名称:linux,代码行数:35,代码来源:map.c


示例6: do_attach

static int do_attach(int argc, char **argv)
{
	enum bpf_attach_type attach_type;
	int cgroup_fd, prog_fd;
	int attach_flags = 0;
	int ret = -1;
	int i;

	if (argc < 4) {
		p_err("too few parameters for cgroup attach");
		goto exit;
	}

	cgroup_fd = open(argv[0], O_RDONLY);
	if (cgroup_fd < 0) {
		p_err("can't open cgroup %s", argv[1]);
		goto exit;
	}

	attach_type = parse_attach_type(argv[1]);
	if (attach_type == __MAX_BPF_ATTACH_TYPE) {
		p_err("invalid attach type");
		goto exit_cgroup;
	}

	argc -= 2;
	argv = &argv[2];
	prog_fd = prog_parse_fd(&argc, &argv);
	if (prog_fd < 0)
		goto exit_cgroup;

	for (i = 0; i < argc; i++) {
		if (is_prefix(argv[i], "multi")) {
			attach_flags |= BPF_F_ALLOW_MULTI;
		} else if (is_prefix(argv[i], "override")) {
			attach_flags |= BPF_F_ALLOW_OVERRIDE;
		} else {
			p_err("unknown option: %s", argv[i]);
			goto exit_cgroup;
		}
	}

	if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) {
		p_err("failed to attach program");
		goto exit_prog;
	}

	if (json_output)
		jsonw_null(json_wtr);

	ret = 0;

exit_prog:
	close(prog_fd);
exit_cgroup:
	close(cgroup_fd);
exit:
	return ret;
}
开发者ID:avagin,项目名称:linux,代码行数:59,代码来源:cgroup.c


示例7: load_tsin_db0

void load_tsin_db0(char *infname, gboolean is_gtab_i)
{
  char tsidxfname[512];
//  dbg("cur %s %s\n", infname, current_tsin_fname);

  if (current_tsin_fname && !strcmp(current_tsin_fname, infname))
    return;

  strcpy(tsidxfname, infname);
  strcat(tsidxfname, ".idx");

//  dbg("tsidxfname %s\n", tsidxfname);

  FILE *fr;

  if ((fr=fopen(tsidxfname,"rb+"))==NULL) {
    p_err("load_tsin_db0 A Cannot open '%s'\n", tsidxfname);
  }


  fread(&phcount,4,1,fr);
#if     0
  printf("phcount:%d\n",phcount);
#endif
  a_phcount=phcount+256;
  fread(&hashidx,1,sizeof(hashidx),fr);

  fp_phidx = fr;

  if (fph)
    fclose(fph);

  dbg("tsfname: %s\n", infname);

  if ((fph=fopen(infname,"rb+"))==NULL)
    p_err("load_tsin_db0 B Cannot open '%s'", infname);

  free(current_tsin_fname);
  current_tsin_fname = strdup(infname);

  if (is_gtab_i) {
    TSIN_GTAB_HEAD head;
    fread(&head, sizeof(head), 1, fph);
    if (head.keybits*head.maxkey > 32) {
      ph_key_sz = 8;
      tsin_hash_shift = TSIN_HASH_SHIFT_64;
    }
    else {
      ph_key_sz = 4;
      tsin_hash_shift = TSIN_HASH_SHIFT_32;
    }
  } else {
    ph_key_sz = 2;
    tsin_hash_shift = TSIN_HASH_SHIFT;
  }
  tsin_is_gtab = is_gtab_i;
}
开发者ID:Tetralet,项目名称:hime,代码行数:57,代码来源:tsin-util.c


示例8: get_page

void get_page(struct page *page)
{
	p_dbg_enter;
	if (page->addr)
		p_err("addr != 0\n");

	page->addr = (char*)mem_malloc(4096);
	if (!page->addr)
		p_err("no mem\n");
	g_skb_alloc_size += 4096;
} 
开发者ID:foxwolf,项目名称:yjd,代码行数:11,代码来源:skbuff.c


示例9: printf

FILE *init_tedrc_fname(char *ftedrc, int depth)
{
FILE *fp;
char tt[256],uu[256];
#if	0
printf(" %d %s\n",depth, ftedrc);
#endif
if (cdtedrc && (fp=fopen(ftedrc,"r"))) {
	return fp;
}


if (fp=fopen(
	strcat(strcat(strcpy(tt,(char *)getenv("HOME")),"/.Ted/"),ftedrc), "r"
)) 	return fp;
if (fp=fopen(strcat(strcat(strcpy(uu, TEDDIR),"/"),ftedrc),"r"))
	return fp;
if (!depth) {
  FILE *tfp;
  extern char *exec_name;
  static char exepath[128];
  int l;

  if (exepath[0]) {
    strcpy(tt,exepath);
  } else {
    sprintf(tt,"which %s",exec_name);
    if ((tfp=popen(tt,"r"))==NULL)
      p_err("cannot locate exec %s path",exec_name);
    fgets(tt,sizeof(tt),tfp);
    if ((l=strlen(tt))>0) {
      int i=l-1;
      while (i>=0 && tt[i]!='/') i--;
      if (i>=0) tt[i]=0;
      strcpy(exepath,tt);
    }
  }
  if (fp=fopen(strcat(strcat(strcpy(uu, tt),"/"),ftedrc),"r"))
    return fp;
  if ((l=strlen(tt))>0) {
    int i=l-1;
    while (i>=0 && tt[i]!='/') i--;
    if (i>=0) tt[i]=0;
    strcat(tt,"/Ted");
    if (fp=fopen(strcat(strcat(strcpy(uu, tt),"/"),ftedrc),"r"))
      return fp;
  }
	if (cdtedrc)
		p_err("Cannot find ./%s or %s or %s",ftedrc,tt,uu);
	else
		p_err("Cannot find %s or %s",ftedrc,tt,uu);
}
return fp;
}
开发者ID:8l,项目名称:ted,代码行数:54,代码来源:xkey.c


示例10: main

int main()
{
  FILE *fp;
  char fnamein[]="pin-juyin.src";
  PIN_JUYIN pinju[1024];
  short pinjuN=0;

  if ((fp=fopen(fnamein, "r"))==NULL)
    p_err("cannot open %s", fnamein);

  while (!feof(fp)) {
    char tt[128];

    tt[0]=0;
    fgets(tt, sizeof(tt), fp);
    if (strlen(tt) < 3)
      break;

    char pin[16], ju[64];
    bzero(pin, sizeof(pin));
    sscanf(tt, "%s %s",pin, ju);

    phokey_t kk=0;
    int len = strlen(ju);
    int i=0;
    while (i<len) {
      kk |= lookup((u_char *)&ju[i]);
      i+=utf8_sz(&ju[i]);
    }

//    dbg("%s '%s' %d\n", pin, ju, kk);

    memcpy(pinju[pinjuN].pinyin, pin, sizeof(pinju[0].pinyin));
    pinju[pinjuN].key = kk;
    pinjuN++;
  }

  fclose(fp);
  dbg("zz pinjuN:%d\n", pinjuN);
  
  qsort(pinju, pinjuN, sizeof(PIN_JUYIN), qcmp_str);

  char fnameout[]="pin-juyin.xlt";

  if ((fp=fopen(fnameout, "wb"))==NULL)
    p_err("cannot create %s", fnameout);

  fwrite(&pinjuN, sizeof(pinjuN), 1, fp);
  fwrite(pinju, sizeof(PIN_JUYIN), pinjuN, fp);
  fclose(fp);

  return 0;
}
开发者ID:RJHsiao,项目名称:gcin-debian,代码行数:53,代码来源:pin-juyin.cpp


示例11: USB_OTG_USBH_handle_nptxfempty_ISR

static uint32_t USB_OTG_USBH_handle_nptxfempty_ISR(USB_OTG_CORE_HANDLE*pdev)
{
	USB_OTG_GINTMSK_TypeDef intmsk;
	USB_OTG_HNPTXSTS_TypeDef hnptxsts;
	uint16_t len_words, len;

	hnptxsts.d32 = USB_OTG_READ_REG32(&pdev->regs.GREGS->HNPTXSTS);
	
	#ifdef DEBUG
	if (hnptxsts.b.chnum > 0)
		p_err("nptxfempty:%d\n", hnptxsts.b.nptxfspcavail);

	if (pdev->host.hc[hnptxsts.b.chnum].xfer_len == 0)
	{
		p_err("%s xfer_len == 0, %d\n", __FUNCTION__, hnptxsts.b.chnum);
		USB_OTG_HC_Halt(pdev, hnptxsts.b.chnum); //test
		return 0;
	}
	#endif

	

	len_words = (pdev->host.hc[hnptxsts.b.chnum].xfer_len + 3) / 4;

	while ((hnptxsts.b.nptxfspcavail > len_words) && (pdev
	->host.hc[hnptxsts.b.chnum].xfer_len != 0))
	{

		len = hnptxsts.b.nptxfspcavail * 4;

		if (len > pdev->host.hc[hnptxsts.b.chnum].xfer_len)
		{
			/* Last packet */
			len = pdev->host.hc[hnptxsts.b.chnum].xfer_len;

			intmsk.d32 = 0;
			intmsk.b.nptxfempty = 1;
			USB_OTG_MODIFY_REG32(&pdev->regs.GREGS->GINTMSK, intmsk.d32, 0);
		}

		len_words = (pdev->host.hc[hnptxsts.b.chnum].xfer_len + 3) / 4;

		USB_OTG_WritePacket(pdev, pdev->host.hc[hnptxsts.b.chnum].xfer_buff,
	hnptxsts.b.chnum, len);

		pdev->host.hc[hnptxsts.b.chnum].xfer_buff += len;
		pdev->host.hc[hnptxsts.b.chnum].xfer_len -= len;
		pdev->host.hc[hnptxsts.b.chnum].xfer_count += len;
		hnptxsts.d32 = USB_OTG_READ_REG32(&pdev->regs.GREGS->HNPTXSTS);
	}

	return 1;
}
开发者ID:glocklueng,项目名称:MCU_WIFI,代码行数:53,代码来源:usb_hcd_int.c


示例12: init_tcp

int init_tcp()
{
struct sockaddr_in serv_addr;

bzero((char *)&serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr=inet_addr("167.170.27.6");
serv_addr.sin_port = htons(9001);
if ((sockfd=socket(AF_INET, SOCK_STREAM, 0)) < 0)
	p_err("Cannot open socket : %s",strerror(errno));
if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
	p_err("Cannot connect : %s",strerror(errno));
}
开发者ID:gitpan,项目名称:DBD-NET,代码行数:13,代码来源:cl.c


示例13: do_show_tree

static int do_show_tree(int argc, char **argv)
{
	char *cgroup_root;
	int ret;

	switch (argc) {
	case 0:
		cgroup_root = find_cgroup_root();
		if (!cgroup_root) {
			p_err("cgroup v2 isn't mounted");
			return -1;
		}
		break;
	case 1:
		cgroup_root = argv[0];
		break;
	default:
		p_err("too many parameters for cgroup tree");
		return -1;
	}


	if (json_output)
		jsonw_start_array(json_wtr);
	else
		printf("%s\n"
		       "%-8s %-15s %-15s %-15s\n",
		       "CgroupPath",
		       "ID", "AttachType", "AttachFlags", "Name");

	switch (nftw(cgroup_root, do_show_tree_fn, 1024, FTW_MOUNT)) {
	case NFTW_ERR:
		p_err("can't iterate over %s: %s", cgroup_root,
		      strerror(errno));
		ret = -1;
		break;
	case SHOW_TREE_FN_ERR:
		ret = -1;
		break;
	default:
		ret = 0;
	}

	if (json_output)
		jsonw_end_array(json_wtr);

	if (argc == 0)
		free(cgroup_root);

	return ret;
}
开发者ID:avagin,项目名称:linux,代码行数:51,代码来源:cgroup.c


示例14: main

int main(int argc, char *argv[])
{
  struct sockaddr_in addr;
  struct hostent *host;
  int sockfd;
  char buf[1024];
  int ret;
  unsigned int optval = 1;

  if(argc != 2) {
    printf("usage: %s SERVER_NAME\n", argv[0]);
    exit(1);
  }

  /* make socket */
  if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    p_err("socket");
  printf("socket: Success\n");

  /* setsockopt */
  if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)) < 0)
    p_err("setsockopt");
  printf("setsockopt: Success\n");

  /* clear s_addr */
  bzero((char *)&addr, sizeof(addr));

  /* set socket */
  if((host = gethostbyname(argv[1])) == NULL)
    p_err("gethostbyname");
  bcopy(host->h_addr, &addr.sin_addr, host->h_length);
  addr.sin_family = AF_INET;
  addr.sin_port = htons(PORT);

  /* connect server */
  if(connect(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
    p_err("connect");
  printf("connect: Success\n");

  /* data send */
  while(fgets(buf, 1024, stdin)) {
    write(sockfd, buf, 1024);
    ret = read(sockfd, buf, ret);
    printf("-> %s", buf);
  }
  close(sockfd);
  exit(EXIT_SUCCESS);

  return(0);
}
开发者ID:kshimo69,项目名称:tools,代码行数:50,代码来源:tcp_client_keepalive.c


示例15: connect_ts_share_svr

int connect_ts_share_svr()
{
    SOCKET ConnectSocket = -1;
    struct addrinfo *result = NULL, *ptr = NULL, hints;
    int iResult;

    bzero( &hints, sizeof(hints) );
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_protocol = IPPROTO_TCP;

    char port_s[8];
    sprintf(port_s, "%d", TS_SHARE_SERVER_PORT);

    iResult = getaddrinfo(TS_SHARE_SERVER, port_s, &hints, &result);
    if ( iResult != 0 ) {
#if UNIX
        p_err("getaddrinfo failed: %s\n", sys_err_strA());
#else
		p_err("getaddrinfo failed: %s\n", sock_err_strA());
#endif
    }

    for(ptr=result; ptr != NULL ;ptr=ptr->ai_next) {
        // Create a SOCKET for connecting to server
        ConnectSocket = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);
        if (ConnectSocket < 0) {
            dbg("Error at socket(): %s\n", sys_err_strA());
            continue;
        }

        // Connect to server.
        iResult = connect( ConnectSocket, ptr->ai_addr, (int)ptr->ai_addrlen);
        if (iResult < 0) {
            closesocket(ConnectSocket);
            ConnectSocket = -1;
            continue;
        }
        break;
    }

    if (ConnectSocket <= 0) {
      p_err("cannot connect to %s:%d", TS_SHARE_SERVER, TS_SHARE_SERVER_PORT, sys_err_strA());
    }

    freeaddrinfo(result);
    return ConnectSocket;
}
开发者ID:RJHsiao,项目名称:gcin-debian,代码行数:48,代码来源:ts-upload.cpp


示例16: uart1_send

int uart1_send(u8_t *buff,u32_t size)
{
	int ret;
	if((size == 0) || (buff == 0))
		return -1;
	p_dbg("uart1 send start\n");
	clear_wait_event(u1_send.wait);
	OSSemSet((OS_EVENT*)u1_send.wait, 0, (INT8U*)&ret);
	u1_send.cnt = size;
 	DMA_TxConfiguration((uint32_t*)buff, size);
	
again:
	ret = wait_event_timeout(u1_send.wait, 2000);
	if(ret != 0)
		goto again;
	
	p_dbg("uart1 send end\n");

	if(u1_send.cnt)
		p_err("uart1_send err:%d,%d,%d\n",ret,u1_send.cnt,size);
	else
		p_dbg("uart1 send a  pkg:%d\n", size);
	
	return 0;
}
开发者ID:glocklueng,项目名称:MCU_WIFI,代码行数:25,代码来源:usart.c


示例17: bzero

ITEM64 *find_ch64(char *s, int *N)
{
  ITEM64 t;

  bzero(t.ch, CH_SZ);
  u8cpy((char *)t.ch, s);

  ITEM64 *p = (ITEM64 *)bsearch(&t, it64, itN, sizeof(ITEM64), qcmp_ch64);
  if (!p)
    return NULL;

  ITEM64 *q = p+1;

  while (p > it64 && !qcmp_ch64(p-1, &t))
    p--;

  ITEM64 *end = it64 + itN;
  while (q < end && !qcmp_ch64(q, &t))
    q++;

  *N = q - p;
  if (*N > 20)
    p_err("err");

  return p;
}
开发者ID:mangoicestar,项目名称:gcin-debian,代码行数:26,代码来源:tsin2gtab-phrase.cpp


示例18: DMA2_Stream7_IRQHandler

void DMA2_Stream7_IRQHandler()  //发送中断
{	
	uint32_t irq_flag;
	enter_interrupt();

	DMA_Cmd(DMA2_Stream7, DISABLE);
	NVIC_DisableIRQ(DMA2_Stream7_IRQn);
	irq_flag = local_irq_save(); 

	if(DMA_GetFlagStatus(DMA2_Stream7, DMA_FLAG_TEIF7))
	{
		
		p_err("uart dma err");
	}

	DMA_ITConfig(DMA2_Stream7, DMA_IT_TC | DMA_IT_TE | DMA_IT_HT,DISABLE);
	DMA_ClearFlag(DMA2_Stream7, DMA_FLAG_TCIF7 | DMA_FLAG_TEIF7 | DMA_FLAG_HTIF7 | DMA_FLAG_DMEIF7 | DMA_FLAG_HTIF7);
   
	u1_send.cnt = DMA2_Stream7->NDTR;   //取剩余字数,应该为0
	local_irq_restore(irq_flag);
	USART_DMACmd(USART1, USART_DMAReq_Tx, DISABLE);
	p_dbg("u_send irq\n");
	wake_up(u1_send.wait);   //唤醒等待线程
	
	exit_interrupt(1);
}
开发者ID:glocklueng,项目名称:MCU_WIFI,代码行数:26,代码来源:usart.c


示例19: umask

void *write_thread(void *_ts) {
	struct ts *ts = _ts;
	struct packet *packet;

	mode_t umask_val = umask(0);
	dir_perm = (0777 & ~umask_val) | (S_IWUSR | S_IXUSR);

	set_thread_name("tsdump-write");
	while ((packet = queue_get(ts->packet_queue))) {
		if (!packet->data_len)
			continue;

		p_dbg1(" - Got packet %d, size: %u, file_time:%lu packet_time:%lu depth:%d\n",
			packet->num, packet->data_len, ALIGN_DOWN(packet->ts.tv_sec, ts->rotate_secs),
			packet->ts.tv_sec, ts->packet_queue->items);

		handle_files(ts, packet);

		if (ts->output_fd > -1) {
			p_dbg2(" - Writing into fd:%d size:%d file:%s\n", ts->output_fd, packet->data_len, ts->output_filename);
			ssize_t written = write(ts->output_fd, packet->data, packet->data_len);
			if (written != packet->data_len) {
				p_err("Can not write data (fd:%d written %zd of %d file:%s)",
					ts->output_fd, written, packet->data_len, ts->output_filename);
			}
		}
		free_packet(packet);
	}
	close_output_file(ts, NO_UNLINK);
	return NULL;
}
开发者ID:davidtsulaia,项目名称:tsdumper2,代码行数:31,代码来源:process.c


示例20: open_xim

void open_xim()
{
  XIMTriggerKeys triggerKeys;

  im_styles.supported_styles = Styles;
  im_styles.count_styles = sizeof(Styles)/sizeof(Styles[0]);

  triggerKeys.count_keys = sizeof(trigger_keys)/sizeof(trigger_keys[0]);
  triggerKeys.keylist = trigger_keys;

  encodings.count_encodings = sizeof(chEncodings)/sizeof(XIMEncoding) - 1;
  encodings.supported_encodings = chEncodings;

  if ((xim_arr[0].xims = IMOpenIM(dpy,
          IMServerWindow,         xim_arr[0].xim_xwin,        //input window
          IMModifiers,            "Xi18n",        //X11R6 protocol
          IMServerName,           xim_arr[0].xim_server_name, //XIM server name
          IMLocale,               lc,
          IMServerTransport,      "X/",      //Comm. protocol
          IMInputStyles,          &im_styles,   //faked styles
          IMEncodingList,         &encodings,
          IMProtocolHandler,      hime_ProtoHandler,
          IMFilterEventMask,      KeyPressMask|KeyReleaseMask,
          IMOnKeysList, &triggerKeys,
          NULL)) == NULL) {
          setenv("NO_GTK_INIT", NULL, TRUE);
          p_err("IMOpenIM '%s' failed. Maybe another XIM server is running.\n",
          xim_arr[0].xim_server_name);
  }
}
开发者ID:CarterTsai,项目名称:hime,代码行数:30,代码来源:hime.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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