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


C++ check_list函数代码示例

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


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

示例1: ec_list_remove

EC_API ec_list ec_list_remove( ec_list list, ec_list_node node )
{
	ec_list_node prev, cur;

	check_list(list);
	check_node(node);
	if (! node) return list;

	prev = NULL;
	cur  = HEAD(list);
	while (cur && (cur != node))
	{
		prev = cur;
		cur  = NEXT(cur);
	}

	if (cur != node) return list;

	ASSERT( cur && (cur == node) );

	if (prev)
		NEXT(prev) = NEXT(node);
	else
		HEAD(list) = NEXT(node);
	NEXT(node) = NULL;

	check_list(list);
	return list;
}
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:29,代码来源:list.c

示例2: ec_list_copy

EC_API ec_list ec_list_copy( ec_list list )
{
	ec_list          newlist;
	ec_list_iterator iter;
	ec_list_node     node, newnode, last;

	check_list(list);

	newlist = ec_list_create();
	if (! newlist) return NULL;

	last = NULL;
	iter = ec_list_iterator_create( list );
	while ((node = ec_list_iterator_next( iter )))
	{
		check_node(node);
		newnode = alloc_node( KEY(node), DATA(node) );
		ASSERT( newnode );
		if (! newnode) return NULL;								/* argh ! */
		if (last)
			NEXT(last) = newnode;
		else
		{
			HEAD(newlist) = newnode;
			last          = newnode;
		}
	}
	ec_list_iterator_destroy( iter );

	check_list(newlist);
	return newlist;
}
开发者ID:BackupTheBerlios,项目名称:elastic-svn,代码行数:32,代码来源:list.c

示例3: RELAY_ShowDebugmsgRelay

/***********************************************************************
 *           RELAY_ShowDebugmsgRelay
 *
 * Simple function to decide if a particular debugging message is
 * wanted.
 */
static BOOL RELAY_ShowDebugmsgRelay(const char *module, int ordinal, const char *func)
{
    if (debug_relay_excludelist && check_list( module, ordinal, func, debug_relay_excludelist ))
        return FALSE;
    if (debug_relay_includelist && !check_list( module, ordinal, func, debug_relay_includelist ))
        return FALSE;
    return TRUE;
}
开发者ID:AndreRH,项目名称:wine,代码行数:14,代码来源:relay.c

示例4: SNOOP16_ShowDebugmsgSnoop

/***********************************************************************
 *          SNOOP16_ShowDebugmsgSnoop
 *
 * Simple function to decide if a particular debugging message is
 * wanted.
 */
BOOL SNOOP16_ShowDebugmsgSnoop(const char *module, int ordinal, const char *func)
{
    if (debug_snoop_excludelist && check_list( module, ordinal, func, debug_snoop_excludelist ))
        return FALSE;
    if (debug_snoop_includelist && !check_list( module, ordinal, func, debug_snoop_includelist ))
        return FALSE;
    return TRUE;
}
开发者ID:AndreRH,项目名称:wine,代码行数:14,代码来源:relay.c

示例5: run_tests

int run_tests()
{
    /* assumes that the test directory has been set up and we have
       changed into the test directory. */

    check_list("*", dir_entries, n_dir_entries + 2, 1);
    check_list("*.*", dir_entries, n_dir_entries + 2, 1);
    check_list("C*", entries_begin_with_C, sizeof(entries_begin_with_C)/sizeof(entries_begin_with_C[0]), 0);
    check_list("*A", entries_end_with_A, sizeof(entries_end_with_A)/sizeof(entries_end_with_A[0]), 0);

    return 0;
}
开发者ID:Henauxg,项目名称:minix,代码行数:12,代码来源:dirent-test.c

示例6: check_tree

static int		check_tree(struct memtree	*tree)
{
  if (tree == NULL)
    return (0);
  int			i;

  i = check_list(tree->allocated);
  i += check_list(tree->freed);
  i += check_tree(tree->lesser);
  i += check_tree(tree->greater);
  return (i);
}
开发者ID:thecyril,项目名称:Wolf3D,代码行数:12,代码来源:malloc.cpp

示例7: name_convert

static int
name_convert(krb5_context context, const char *name, const char *realm, 
	     const char **out)
{
    const krb5_config_binding *l;
    l = krb5_config_get_list (context,
			      NULL,
			      "realms",
			      realm,
			      "v4_name_convert",
			      "host",
			      NULL);
    if(l && check_list(l, name, out))
	return KRB5_NT_SRV_HST;
    l = krb5_config_get_list (context,
			      NULL,
			      "libdefaults",
			      "v4_name_convert",
			      "host",
			      NULL);
    if(l && check_list(l, name, out))
	return KRB5_NT_SRV_HST;
    l = krb5_config_get_list (context,
			      NULL,
			      "realms",
			      realm,
			      "v4_name_convert",
			      "plain",
			      NULL);
    if(l && check_list(l, name, out))
	return KRB5_NT_UNKNOWN;
    l = krb5_config_get_list (context,
			      NULL,
			      "libdefaults",
			      "v4_name_convert",
			      "host",
			      NULL);
    if(l && check_list(l, name, out))
	return KRB5_NT_UNKNOWN;
    
    /* didn't find it in config file, try built-in list */
    {
	struct v4_name_convert *q;
	for(q = default_v4_name_convert; q->from; q++) {
	    if(strcmp(name, q->to) == 0) {
		*out = q->from;
		return KRB5_NT_SRV_HST;
	    }
	}
    }
    return -1;
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:52,代码来源:principal.c

示例8: main

int main()
{
  /* sort 1..19, 30..20, 30..100 */
  #define LEN 18
  int arr[LEN] = {1, 5, 28, 4, 3, 2, 10, 20, 18, 25, 21, 29, 34, 35, 14, 100, 27, 19};
  int ans[LEN] = {1, 2, 3, 4, 5, 10, 14, 18, 19, 29, 28, 27, 25, 21, 20, 34, 35, 100};
  int tmp[LEN];

  /* Region to invert: 20-30 (inclusive) */
  int interval[2] = {20, 30};
  int i, res = 1;
  const int tlen = 100000;
  int *tarray = NULL;

  printf("Test 1:\n");
  printf("sort_r\n");
  memcpy(tmp, arr, LEN*sizeof(int));
  print_list(tmp, LEN);
  sort_r(tmp, LEN, sizeof(int), sort_r_cmp, interval);
  print_list(tmp, LEN);
  res &= check_list(tmp, ans, LEN);

  printf("sort_r_simple\n");
  memcpy(tmp, arr, LEN*sizeof(int));
  print_list(tmp, LEN);
  sort_r_simple(tmp, LEN, sizeof(int), sort_r_cmp, interval);
  print_list(tmp, LEN);
  res &= check_list(tmp, ans, LEN);

  printf("Test 2:\n");
  tarray = malloc(tlen * sizeof(int));
  for(i = 0; i < tlen; i++) tarray[i] = i;
  /* sort integers */
  sort_r(tarray, tlen, sizeof(tarray[0]), cmp_int, NULL);
  for(i = 0; i < tlen && tarray[i] == i; i++) {}
  res &= (i == tlen);
  sort_r_simple(tarray, tlen, sizeof(tarray[0]), cmp_int, NULL);
  for(i = 0; i < tlen && tarray[i] == i; i++) {}
  res &= (i == tlen);
  /* reverse sort integers */
  sort_r(tarray, tlen, sizeof(tarray[0]), cmpr_int, NULL);
  for(i = 0; i < tlen && tarray[i] == tlen-i-1; i++) {}
  res &= (i == tlen);
  sort_r_simple(tarray, tlen, sizeof(tarray[0]), cmpr_int, NULL);
  for(i = 0; i < tlen && tarray[i] == tlen-i-1; i++) {}
  res &= (i == tlen);
  free(tarray);

  printf("return: %s\n", res ? "PASS" : "FAIL");
  return res ? EXIT_SUCCESS : EXIT_FAILURE;
}
开发者ID:cap,项目名称:sort_r,代码行数:51,代码来源:example.c

示例9: slab_checker

static void slab_checker(void) {
	struct _kmem_cache *searchp;
	struct kmem_list3 *l3;
	int i;
	mutex_lock(cache_chain_mutex);
	list_for_each_entry(searchp, cache_chain, next)
	{
		printk("--z-- checking %s\n", searchp->name);
		for (i = 0; i < MAX_NUMNODES; i++) {
			l3 = searchp->nodelists[i];
			check_list(&l3->slabs_partial);
			check_list(&l3->slabs_full);
			check_list(&l3->slabs_free);
		}
	}
开发者ID:warriorpaw,项目名称:Paw-s-Linux-lab,代码行数:15,代码来源:my_module.c

示例10: brute_force

void  brute_force(struct s_list *list, char **square)
{
  int i;
  int j;

  i = 0;
  while (square[i])
  {
    j = 0;
    while (square[i][j])
    {
      if (square[i][j] == '.')
      {
/*
        while (list->flag == 1)
        {
          printf("on continue");
          list = list->next;
          continue ;
      }*/
        if (list->flag == 0 && set_a_jeton(square, &list, i, j) == 0)
        {
          list = list->next;
          display(square); // a enlever
        }
      }
      j++;
    }
    i++;
  }
 if (check_list(list) == -1)
    brute_force(list, square);
}
开发者ID:kevgusma,项目名称:fillet,代码行数:33,代码来源:backtracking.c

示例11: setup

void setup(void) {
  array_t *a = array_create(0);

  list_null = datalist_create(NULL);
  check_list(list_null, 0);

  array_push(a, str_wrap("test"));
  array_push(a, data_true());
  array_push(a, data_null());
  array_push(a, int_to_data(42));
  list_array = datalist_create(a);
  check_list(list_array, array_size(a));

  list_valist = (datalist_t *) data_create(List, 2, str_wrap("test"), int_to_data(42));
  check_list(list_valist, 2);
}
开发者ID:JanDeVisser,项目名称:obelix,代码行数:16,代码来源:tdatalist.c

示例12: main

int main(int argc, char *argv[])
{
  int ret;

  ret = check_list();
  if(ret)
    {
      fprintf(stderr, "LIST fails: %d\n", ret);
      return 1;
    }

  ret = check_stack();
  if(ret)
    {
      fprintf(stderr, "STACK fails: %d\n", ret);
      return 2;
    }

  ret = check_queue();
  if(ret)
    {
      fprintf(stderr, "QUEUE fails: %d\n", ret);
      return 3;
    }

  return 0;
}
开发者ID:JackieXie168,项目名称:liblist,代码行数:27,代码来源:oldapi.c

示例13: return

t_match		*check_space_pvp(t_match *match, int flag)
{
  int		check;

  check = 0;
  if (check_list(match) == 1)
    {
      flag = 1;
      return (match);
    }
  check = init_check(match);
  if (is_ok(match, check) == 1)
    {
      flag = 1;
      return (match);
    }
  flag = burn_select(&match, flag);
  if (flag != 0)
    {
      is_finished(match);
      if (who_play == 0)
	who_play = 42;
      else
	who_play = 0;
    }
  return (match);
}
开发者ID:luxsypher,项目名称:alum1,代码行数:27,代码来源:pvp.c

示例14: my_parse

int				my_parse(t_fdf *e, int ac, char **av)
{
	int		i;
	int		fd;
	t_list	*list;

	if ((fd = open(av[1], O_RDWR)) < 0 && ft_printf("fdf: %s: ", av[1]))
	{
		perror("");
		return (0);
	}
	if ((i = my_filllist(&list, fd)) == -2)
		return (0);
	if (close(fd) && ft_printf("fdf: %s: ", av[1]))
	{
		perror("");
		return (0);
	}
	if (!check_list(e, &list))
		return (0);
	if (i == -1 || ac < 3)
		return ((i == -1) ? 0 : 1);
	if ((e->mic.col = read_color(av[2])) < 0)
		return ((e->mic.col = FDF_COL_MIN) + 1);
	if ((ac < 4 || (e->mac.col = read_color(av[3])) < 0))
		return ((e->mac.col = e->mic.col) + 1);
	return (1);
}
开发者ID:thomasLeMeur,项目名称:fdf,代码行数:28,代码来源:parse.c

示例15: tri_basic

void				tri_basic(t_content *axx)
{
	TMP_A(4) = LIST_A(3);
	LIST_I(NB_LIST + 4, 0);
	norm(axx);
	while (check_list(axx, 0) != 0)
	{
		TMP_A(3) = LIST_A(0);
		LIST_I(NB_LIST + 3, 1);
		TMP_A(8) = LIST_A(0);
		LIST_I(NB_LIST + 8, 0);
		LIST_I(NB_LIST + 8, 0);
		if (VALUE_IN(0, 0) < VALUE_IN(0, 1))
		{
			op(axx, 5);
		}
		else if (TMP_IN(3, 1) < VALUE_IN(0, 1))
		{
			op(axx, 0);
		}
		else
		{
			push_b(axx, pos_x(axx, TMP_I(4, 0)));
			LIST_I(NB_LIST + 4, 0);
		}
	}
}
开发者ID:mdambrev,项目名称:42,代码行数:27,代码来源:sort_3.c


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