Lines Matching defs:lp

48 append_line(grub_menu_t *mp, grub_line_t *lp)
51 mp->gm_start = lp;
53 mp->gm_end->gl_next = lp;
54 lp->gl_prev = mp->gm_end;
56 mp->gm_end = lp;
57 lp->gl_line_num = ++mp->gm_line_num;
58 lp->gl_entry_num = GRUB_ENTRY_DEFAULT;
65 grub_line_t *lp;
67 lp = mp->gm_end;
71 while (n-- != 0 && strcmp(lp->gl_cmd, grub_cmd_descs[n].gcd_cmd) != 0)
78 /* we found command, fill lp fields */
79 lp->gl_flags = grub_cmd_descs[n].gcd_flags;
80 lp->gl_cmdtp = grub_cmd_descs[n].gcd_num;
89 grub_line_t *lp;
93 for (i = 0, lp = ent->ge_start; lend != lp; lp = lp->gl_next, ++i) {
94 lp->gl_entry_num = ent->ge_entry_num;
95 if (lp->gl_flags == GRUB_LINE_INVALID ||
96 lp->gl_flags == GRUB_LINE_GLOBAL) {
98 lp->gl_flags = GRUB_LINE_INVALID;
133 grub_line_t *lp;
137 lp = mp->gm_curdefault;
139 if (lp != NULL && lp->gl_flags == GRUB_LINE_GLOBAL &&
140 lp->gl_cmdtp == GRBM_DEFAULT_CMD) {
141 defent = strtoul(lp->gl_arg, NULL, 0);
154 free_line(grub_line_t *lp)
156 if (lp == NULL)
159 free(lp->gl_cmd);
160 free(lp->gl_sep);
161 free(lp->gl_arg);
162 free(lp->gl_line);
163 free(lp);
169 grub_line_t *lp;
175 lp = line;
176 line = lp->gl_next;
177 free_line(lp);
202 grub_line_t *lp;
208 lp = NULL;
209 if ((lp = calloc(1, sizeof (*lp))) == NULL ||
210 (lp->gl_line = strdup(line)) == NULL) {
211 free(lp);
220 if ((lp->gl_cmd =
222 (lp->gl_sep =
224 (lp->gl_arg = strdup(line + 1)) == NULL)
229 if ((lp->gl_cmd = malloc(n + 1)) == NULL)
232 (void) strlcpy(lp->gl_cmd, line, n + 1);
238 if ((lp->gl_sep = malloc(n + 1)) == NULL)
241 (void) strlcpy(lp->gl_sep, line, n + 1);
246 if ((lp->gl_arg = strdup(line)) == NULL)
251 free_line(lp);
255 append_line(mp, lp);
446 grub_menu_next_line(const grub_menu_t *mp, const grub_line_t *lp)
449 if (lp == NULL)
452 return (lp->gl_next);
456 grub_menu_prev_line(const grub_menu_t *mp, const grub_line_t *lp)
459 if (lp == NULL)
462 return (lp->gl_prev);
468 grub_line_t *lp;
473 for (lp = mp->gm_start; lp != NULL && num != lp->gl_line_num;
474 lp = lp->gl_next)
476 return (lp);