Lines Matching defs:line

244  * Simply allocate a new line and copy in cmd + sep + arg
252 BAM_DPRINTF(("%s: line before update: %s\n", fcn, linep->line));
253 free(linep->line);
255 linep->line = s_calloc(1, size);
256 (void) snprintf(linep->line, size, "%s%s%s", linep->cmd, linep->sep,
258 BAM_DPRINTF(("%s: line after update: %s\n", fcn, linep->line));
306 * The parse_kernel_line function examines a menu.lst kernel line. For
346 cvt_kernel_line(line_t *line, const char *osroot, entry_t *entry)
358 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, line->line, osroot));
385 "Not updating line %d\n"), line->lineNum);
397 free(line->cmd);
398 line->cmd = s_strdup(menu_cmds[KERNEL_DOLLAR_CMD]);
399 BAM_DPRINTF(("%s: converted kernel cmd to %s\n", fcn, line->cmd));
401 assert(sizeof (linebuf) > strlen(line->arg) + 32);
402 (void) strlcpy(linebuf, line->arg, sizeof (linebuf));
485 free(line->arg);
486 line->arg = s_strdup(new_arg);
487 update_line(line);
488 BAM_DPRINTF(("%s: converted line is: %s\n", fcn, line->line));
493 * Similar to above, except this time we're looking at a module line,
496 * Under multiboot, the archive line is:
500 * Under directboot, the archive line is:
523 cvt_module_line(line_t *line, entry_t *entry)
527 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, line->line));
538 if (strcmp(line->arg, FAILSAFE_ARCHIVE) == 0) {
539 BAM_DPRINTF(("%s: failsafe module line needs no "
540 "conversion: %s\n", fcn, line->arg));
544 } else if (strcmp(line->arg, MULTIBOOT_ARCHIVE) != 0) {
545 bam_error(_("module command on line %d not recognized.\n"),
546 line->lineNum);
551 free(line->cmd);
552 free(line->arg);
553 line->cmd = s_strdup(menu_cmds[MODULE_DOLLAR_CMD]);
555 line->arg = s_strdup(entry->flags & BAM_ENTRY_FAILSAFE ?
558 update_line(line);
559 BAM_DPRINTF(("%s: converted module line is: %s\n", fcn, line->line));
621 line_t *line;
642 for (line = entry->start; line; line = line->next) {
643 if (line->cmd == NULL || line->arg == NULL) {
644 if (line == entry->end) {
650 "NULL line\n", fcn));
654 if (strcmp(line->cmd, menu_cmds[ROOT_CMD])
655 == 0 && strcmp(line->arg, grubroot) == 0) {
657 "line: %s,%s\n", fcn,
658 line->line, grubsign));
661 if (line == entry->end) {
668 for (line = entry->start; line; line = line->next) {
669 if (line->cmd == NULL || line->arg == NULL) {
670 if (line == entry->end) {
676 "NULL line\n", fcn));
680 if (strcmp(line->cmd, menu_cmds[FINDROOT_CMD])
681 == 0 && strcmp(line->arg, grubsign) == 0) {
683 "findroot line: %s,%s\n", fcn,
684 line->line, grubsign));
687 if (line == entry->end) {
724 line_t *line;
744 for (line = entry->start; line; line = line->next) {
745 if (line->cmd == NULL || line->arg == NULL) {
746 if (line == entry->end) {
751 BAM_DPRINTF(("%s: skipping NULL line\n",
756 if (strcmp(line->cmd, menu_cmds[TITLE_CMD]) == 0) {
764 newlp->line = s_strdup(linebuf);
765 bam_add_line(mp, entry, line, newlp);
769 BAM_DPRINTF(("%s: added findroot line: %s\n",
770 fcn, newlp->line));
771 line = newlp;
773 if (strcmp(line->cmd, menu_cmds[ROOT_CMD]) == 0) {
774 BAM_DPRINTF(("%s: freeing root line: %s\n",
775 fcn, line->line));
776 unlink_line(mp, line);
777 line_free(line);
779 if (line == entry->end) {
838 line_t *line;
846 for (line = entry->start; line; line = line->next) {
847 if (line->cmd == NULL || line->arg == NULL) {
848 if (line == entry->end) {
853 BAM_DPRINTF(("%s: skipping NULL line\n",
865 if (strcmp(line->cmd, menu_cmds[KERNEL_CMD]) == 0) {
866 ret = cvt_kernel_line(line, osroot, entry);
881 if (strcmp(line->cmd, menu_cmds[MODULE_CMD]) == 0) {
882 ret = cvt_module_line(line, entry);
898 if (line == entry->end) {