(linenum→info "unix/slp.c:2238")

guest

2008-02-29

_ anthy/9100e/src-util/agent.c:503-504

  503: static int
  504: proc_connection(void)

標準入力を処理する

_ anthy/9100e/src-util/agent.c:96-120

   96: struct high_level_command_type {
   97:   const char* name;
   98:   int cmd;
   99:   int n_arg;
  100:   int opt_arg;
  101: } high_level_command_type[] = {
  102:   /* コンテキストの情報を表示する */
  103:   {"PRINT_CONTEXT",  CMDH_PRINT_CONTEXT,  0, 0},
  104:   /* トグルに使うキーを変更する */
  105:   {"CHANGE_TOGGLE",  CMDH_CHANGE_TOGGLE,  1, 0},
  106:   /* コンテキストを選択する */
  107:   {"SELECT_CONTEXT", CMDH_SELECT_CONTEXT, 1, 0},
  108:   {"RELEASE_CONTEXT", CMDH_RELEASE_CONTEXT, 0, 0},
  109:   {"MAP_CLEAR", CMDH_MAP_CLEAR, 1, 0},
  110:   {"MAP_EDIT",       CMDH_MAP_EDIT,       3, 0},
  111:   {"MAP_SELECT",     CMDH_MAP_SELECT,     1, 0},
  112:   {"GET_CANDIDATE",  CMDH_GET_CANDIDATE,  1, 0},
  113:   {"SELECT_CANDIDATE", CMDH_SELECT_CANDIDATE, 1, 0},
  114:   /* バックスペースでローマ字に戻る */
  115:   {"BREAK_INTO_ROMAN", CMDH_SET_BREAK_INTO_ROMAN, 1, 0},
  116:   /**/
  117:   {"SET_PREEDIT_MODE", CMDH_SET_PREEDIT_MODE, 1, 0},
  118:   /**/
  119:   {NULL, -1, 0, 0}
  120: };

ハイレベルコマンドの文字列定義

2008-01-17

_ tree/1.5.1.1/tree.c:589-589

  589:   path=malloc(pathsize=4096);

メモリの確保

_ tree/1.5.1.1/tree.c:833-833

  833:     dl[p]->name = scopy(ent->d_name);

scopyで()内の複製を作る。

_ tree/1.5.1.1/tree.c:806-806

  806:   dl = (struct _info **)xmalloc(sizeof(struct _info *) * (ne = MINIT));

メモリ確保

_ tree/1.5.1.1/tree.c:91-94

   91: struct xtable {
   92:   u_short xid;
   93:   char *name;
   94:   struct xtable *nxt;

リストの宣言

_ tree/1.5.1.1/tree.c:99-102

   99: struct inotable {
  100:   ino_t inode;
  101:   dev_t device;
  102:   struct inotable *nxt;

リストの宣言

_ gcc/4.2.2/gcc/print-tree.c:37-41

   37: struct bucket
   38: {
   39:   tree node;
   40:   struct bucket *next;
   41: };

リスト構造: 要素に木構造を持つ by M.I

2008-01-16

_ gcc/4.2.2/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c:4-6

    4: struct list_head {
    5:  struct list_head *next;
    6: };

単方向リストの宣言

_ gcc/4.2.2/libmudflap/testsuite/libmudflap.c/heap-scalestress.c:44-51

   44:             {                  /* add at tail */
   45:               p->next = NULL;
   46:               if (NULL != tail)
   47:                 tail->next = p;
   48:               else
   49:                 head = p;
   50:               tail = p;
   51:             }

tailに追加

_ gcc/4.2.2/libmudflap/testsuite/libmudflap.c/heap-scalestress.c:53-59

   53:             {                  /* add at head */
   54:               p->next = head;
   55:               if (NULL == tail)
   56:                 tail = p;
   57:               head = p;
   58:             }
   59:         }

headに追加

_ gcc/4.2.2/libmudflap/testsuite/libmudflap.c/heap-scalestress.c:15-18

   15: struct list
   16: {
   17:   struct list *next;
   18: };

単方向リストの宣言

_ gcc/4.2.2/gcc/testsuite/gcc.dg/vect/pr21591.c:26-26

   26:       a->a1[i] = b->a1[i] + c->a1[i];

ポインタで表された構造体の要素に対して for文で2つの構造体の要素の和を渡している。 ITB2 by mk

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/execute/20000801-2.c:7-7

    7:   struct foo *next;

リスト構造 : 次の構造体変数のアドレス ITB2 by mk

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/execute/20000801-2.c:10-18

   10: struct foo *test(struct foo *node)
   11: {
   12:   while (node) {
   13:     if (bar() && !baz())
   14:       break;
   15:     node = node->next;
   16:   }
   17:   return node;
   18: }

単方向リスト ITB2 by mk

_ linux/2.6.23/lib/list_debug.c:19-39

   19: void __list_add(struct list_head *new,
   20:                               struct list_head *prev,
   21:                               struct list_head *next)
   22: {
   23:         if (unlikely(next->prev != prev)) {
   24:                 printk(KERN_ERR "list_add corruption. next->prev should be "
   25:                         "prev (%p), but was %p. (next=%p).\n",
   26:                         prev, next->prev, next);
   27:                 BUG();
   28:         }
   29:         if (unlikely(prev->next != next)) {
   30:                 printk(KERN_ERR "list_add corruption. prev->next should be "
   31:                         "next (%p), but was %p. (prev=%p).\n",
   32:                         next, prev->next, prev);
   33:                 BUG();
   34:         }
   35:         next->prev = new;
   36:         new->next = next;
   37:         new->prev = prev;
   38:         prev->next = new;
   39: }

リスト構造をつくる関数list_add() ITB2 by mk

_ linux/2.6.23/lib/list_debug.c:50-53

   50: void list_add(struct list_head *new, struct list_head *head)
   51: {
   52:         __list_add(new, head, head->next);
   53: }

リスト構造を使った関数の入れ子。 ITB2 by mk

_ linux/2.6.23/lib/list_debug.c:62-77

   62: void list_del(struct list_head *entry)
   63: {
   64:         if (unlikely(entry->prev->next != entry)) {
   65:                 printk(KERN_ERR "list_del corruption. prev->next should be %p, "
   66:                                 "but was %p\n", entry, entry->prev->next);
   67:                 BUG();
   68:         }
   69:         if (unlikely(entry->next->prev != entry)) {
   70:                 printk(KERN_ERR "list_del corruption. next->prev should be %p, "
   71:                                 "but was %p\n", entry, entry->next->prev);
   72:                 BUG();
   73:         }
   74:         __list_del(entry->prev, entry->next);
   75:         entry->next = LIST_POISON1;
   76:         entry->prev = LIST_POISON2;
   77: }

listadd() <==> listdel() ITB2 by mk

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/compile/20040303-1.c:1-3

    1: typedef struct input {
    2:         struct input *next;
    3: } input_t;

構造体によるリスト構造 ITB2 by mk

_ binutils/2.18/libiberty/argv.c:64-64

   64: char **

charへのポインタのポインタ

_ gcc/4.2.2/libjava/gnu/gcj/natCore.cc:80-86

   80:   while (node)
   81:     {
   82:       if (total == node->name_length
   83:           && strncmp (buf, node->name, total) == 0)
   84:         return node;
   85:       node = node->next;
   86:     }

単方向リストが用いられている。

_ gcc/4.2.2/gcc/ipa.c:155-155

  155:       next = node->next;

木構造が用いられている。

_ gcc/4.2.2/gcc/testsuite/gcc.dg/20000906-1.c:15-18

   15: struct list
   16: {
   17:   struct list *next;
   18: };

単方向リストの宣言

_ tree/1.5.1.1/tree.c:781-783

  781:   dirs[lev] = 0;
  782:   free(path);
  783:   free_dir(sav);

781:DIRS[lev]の初期化  782:Pathのメモリ領域の解放  783:再帰呼び出し?

_ linux/2.6.23/drivers/acpi/namespace/nsalloc.c:323-386

  323: void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
  324: {
  325:         struct acpi_namespace_node *child_node = NULL;
  326:         u32 level = 1;
  327: 
  328:         ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree);
  329: 
  330:         if (!parent_node) {
  331:                 return_VOID;
  332:         }
  333: 
  334:         /*
  335:          * Traverse the tree of objects until we bubble back up
  336:          * to where we started.
  337:          */
  338:         while (level > 0) {
  339: 
  340:                 /* Get the next node in this scope (NULL if none) */
  341: 
  342:                 child_node =
  343:                     acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
  344:                                           child_node);
  345:                 if (child_node) {
  346: 
  347:                         /* Found a child node - detach any attached object */
  348: 
  349:                         acpi_ns_detach_object(child_node);
  350: 
  351:                         /* Check if this node has any children */
  352: 
  353:                         if (acpi_ns_get_next_node
  354:                             (ACPI_TYPE_ANY, child_node, NULL)) {
  355:                                 /*
  356:                                  * There is at least one child of this node,
  357:                                  * visit the node
  358:                                  */
  359:                                 level++;
  360:                                 parent_node = child_node;
  361:                                 child_node = NULL;
  362:                         }
  363:                 } else {
  364:                         /*
  365:                          * No more children of this parent node.
  366:                          * Move up to the grandparent.
  367:                          */
  368:                         level--;
  369: 
  370:                         /*
  371:                          * Now delete all of the children of this parent
  372:                          * all at the same time.
  373:                          */
  374:                         acpi_ns_delete_children(parent_node);
  375: 
  376:                         /* New "last child" is this parent node */
  377: 
  378:                         child_node = parent_node;
  379: 
  380:                         /* Move up the tree to the grandparent */
  381: 
  382:                         parent_node = acpi_ns_get_parent_node(parent_node);
  383:                 }
  384:         }
  385: 
  386:         return_VOID;

It uses tree struct that can move up.

2008-01-15

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/compile/pr25514.c:1-4

    1: struct node {
    2:   struct node *next;
    3:   int value;
    4: };

リストの構造体である。

2008-01-14

_ coreutils/6.9/lib/idcache.c:37-37

   37: struct userid

単方向リストの宣言

_ coreutils/6.9/lib/idcache.c:63-63

   63:       if (tail->id.u == uid)

このときtailをmatchに代入する。

_ coreutils/6.9/lib/idcache.c:167-167

  167:       match->next = group_alist;

リストの先頭に追加

2008-01-12

_ gcc/4.2.2/gcc/coretypes.h:35-35

   35: #define GTY(x)  /* nothing - marker for gengtype */

これがどのように働くかを調べたり、理解するのはちょっと大変そう。gccint の 19 章か 20 章に説明があるらしいけれど。 (一度 guest で書いたのですが login してから消せたので、書直しました。と思ったがまだ login 出来ていなかったか ?

2008-01-10

_ gcc/4.2.2/gcc/testsuite/gcc.dg/uninit-1.c:18-18

   18:   for (p = el; p; p = p->next)

this is a list traversal.

_ gcc/4.2.2/gcc/testsuite/gcc.dg/uninit-1.c:6-10

    6: struct list
    7: {
    8:   struct list *next;
    9:   int id;
   10: };

単方向リストの宣言(自分自身を指すポインタを構造体のメンバに加える)

_ gcc/4.2.2/gcc/testsuite/gcc.dg/uninit-1.c:20-20

   20:     for (q = el; q != p; q = q->next)

Sorry, this is a test writing. by mk

_ hello/2.3/src/hello.c:104-104

  104:     printf (_("hello, world\n"));

hello, world!

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/compile/pr25514.c:14-14

   14:   next = node->next;

Kikouzou is used in this part.

_ gcc/4.2.2/gcc/testsuite/gcc.dg/tree-ssa/pr22591.c:13-16

   13:   p->next = q; 
   14:   p->prev = q; 
   15:   q->next = p; 
   16:   q->prev = p; 

毎度お馴染のnode,next,prev。 ポインタの受け渡しをしているので、課題に沿っていると思われる。 以上。

_ tree/1.5.1.1/tree.c:535-535

  535:   switch(n) {

ケースによって場合分け

_ hello/2.3/contrib/evolution.txt:63-69

   63:   char *message[] = {"Hello ", "World"};
   64:   int i;
   65: 
   66:   for(i = 0; i < 2; ++i)
   67:     printf("%s", message[i]);
   68:   printf("\n");
   69: }

message[0]にHelloを、message[1]にWorldを入れて、for文でmessage[i]を回して、 printfでHello Worldを表示する部分。そして最後に改行している。 配列とfor文の練習と思われる。

_ gcc/4.2.2/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c:10-10

   10:     a[i] = b[i] + c[i];

for文でポインタにポインタの和を代入するコード。(ITB2 by mk)

_ tree/1.5.1.1/tree.c:213-213

  213:         switch(argv[i][j]) {

ケースによって場合分け

_ gcc/4.2.2/gcc/testsuite/gcc.c-torture/compile/20000420-1.c:10-16

   10:   for (; *p; )
   11:     {
   12:       if (pedantic ? (*p)->viable == 1 : (*p)->viable)
   13:         p = &((*p)->next);
   14:       else
   15:         *p = (*p)->next;
   16:     }

In the if structure, it's along TANHOUKOU list.

_ gcc/4.2.2/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c:23-33

   23:  struct sysfs_dirent * sd;
   24:  struct sysfs_dirent * parent_sd = dir->d_fsdata;
   25:  for (sd = (struct sysfs_dirent *)((&parent_sd->s_children)->next);
   26:      &sd->s_sibling != (&parent_sd->s_children);
   27:      sd  = (struct sysfs_dirent *)sd->s_sibling.next) {
   28:   if (!__builtin_strcmp(sysfs_get_name(sd), name))
   29:   {
   30:    list_del_init(&sd->s_sibling);
   31:    break;
   32:   }
   33:  }

In this part,tree stlucture is used.

_ coreutils/6.9/src/tsort.c:58-58

   58:   size_t count;

先行節点のカウンタ

_ coreutils/6.9/src/tsort.c:60-60

   60:   struct successor *top;

後続節点の単方向リストの先頭

_ coreutils/6.9/src/tsort.c:56-56

   56:   struct item *left, *right;

節点の情報を管理するのに、表ではなく二分木を使っている

2008-01-08

_ ruby/1.9.0/gc.c:10-12

   10:   Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
   11:   Copyright (C) 2000  Information-technology Promotion Agency, Japan
   12: 

.

2008-01-07

_ emacs/22.1/configure:1-8

    1: #! /bin/sh
    2: # Guess values for system-dependent variables and create Makefiles.
    3: # Generated by GNU Autoconf 2.61.
    4: #
    5: # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
    6: # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    7: # This configure script is free software; the Free Software Foundation
    8: # gives unlimited permission to copy, distribute and modify it.

おおお.かっこいい.

_ hello/2.3/src/hello.c:113-117

  113:         printf (_("\
  114: +---------------+\n\
  115: | Hello, world! |\n\
  116: +---------------+\n\
  117: "));

メッセージ表示部分

_ ruby/1.9.0/COPYING:1-3

    1: Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
    2: You can redistribute it and/or modify it under either the terms of the GPL
    3: version 2 (see the file GPL), or the conditions below:

Copyright notice

_ hello/2.3/src/hello.c:123-127

  123:       puts (greeting);
  124:     }
  125:   
  126:   exit (EXIT_SUCCESS);
  127: }

test

2008-01-06

_ hello/2.3/src/hello.c:16-17

   16:    You should have received a copy of the GNU General Public License
   17:    along with this program; if not, write to the Free Software Foundation,

ゲストアカウントで書き込みテスト。