Lines Matching defs:new
63 * Add a new suggestion. Only one suggestion per text allowed.
68 sugg_t *new, *n, *pos = NULL;
80 if ((new = calloc(1, sizeof (sugg_t))) == NULL)
84 new->sb_msg = strdup(sb_msg);
87 new->text = strdup(text);
89 new->weight = weight;
90 new->key = key;
91 new->func = func;
92 new->slice = 0;
94 sugg = new;
95 new->prev = NULL;
96 new->next = NULL;
106 * Create a new element
108 if ((new = calloc(1, sizeof (sugg_t))) == NULL)
112 new->sb_msg = strdup(sb_msg);
114 new->text = strdup(text);
116 new->weight = weight;
117 new->key = key;
118 new->func = func;
119 new->slice = 0;
123 * Ordering placed the new element at the end
128 n->next = new;
129 new->prev = n;
130 new->next = NULL;
134 * Ordering placed the new element at the start
136 new->next = sugg;
137 new->prev = sugg;
138 sugg->prev = new;
139 sugg = new;
142 * Ordering placed the new element somewhere in
145 new->next = pos;
146 new->prev = pos->prev;
147 pos->prev->next = new;
148 pos->prev = new;