mirror of
https://git.proxmox.com/git/grub2
synced 2025-05-28 12:33:27 +00:00

* fs/ext2.c (pupa_ext2_label): New function. (pupa_ext2_fs): Added label. * fs/fat.c (pupa_fat_label): New function. (pupa_fat_fs): Added label. * include/pupa/fs.h (struct pupa_fs): Added prototype label. * kern/misc.c (pupa_strndup): New function. * include/pupa/misc.h (pupa_strndup): New prototype. * include/pupa/normal.h: Include <pupa/err.h>. (pupa_set_history): New prototype. (pupa_iterate_commands): New prototype. * normal/cmdline.c: Include <pupa/machine/partition.h>, <pupa/disk.h>, <pupa/file.h>. (hist_size): New variable. (hist_lines): Likewise. (hist_end): Likewise. (hist_used): Likewise. (pupa_set_history): New function. (pupa_history_get): Likewise. (pupa_history_add): Likewise. (pupa_history_replace): Likewise. (pupa_tab_complete): Likewise. (pupa_cmdline_run): Added tab completion and history buffer. Tab completion shows partitionnames while completing partitions, this feature was suggested by Jeff Bailey. * normal/command.c (pupa_iterate_commands): New function. * normal/main.c (PUPA_DEFAULT_HISTORY_SIZE): New macro. (pupa_normal_init): Initialize history buffer. (PUPA_MOD_INIT): Likewise. (pupa_normal_fini): Free the history buffer. (PUPA_MOD_FINI): Likewise. * util/console.c (pupa_ncurses_getkey): Accept 127 as backspace key. * aclocal.m4 (pupa_I386_CHECK_REGPARM_BUG): New DEFUN. * configure.ac [i386]: Check for regparam bug. (NESTED_FUNC_ATTR) [! i386]: Defined.
60 lines
2.7 KiB
C
60 lines
2.7 KiB
C
/* misc.h - prototypes for misc functions */
|
|
/*
|
|
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
|
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org>
|
|
* Copyright (C) 2003 Marco Gerards <metgerards@student.han.nl>
|
|
*
|
|
* PUPA is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with PUPA; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
#ifndef PUPA_MISC_HEADER
|
|
#define PUPA_MISC_HEADER 1
|
|
|
|
#include <stdarg.h>
|
|
#include <pupa/types.h>
|
|
#include <pupa/symbol.h>
|
|
|
|
/* XXX: If pupa_memmove is too slow, we must implement pupa_memcpy. */
|
|
#define pupa_memcpy(d,s,n) pupa_memmove ((d), (s), (n))
|
|
|
|
void *EXPORT_FUNC(pupa_memmove) (void *dest, const void *src, pupa_size_t n);
|
|
char *EXPORT_FUNC(pupa_strcpy) (char *dest, const char *src);
|
|
char *EXPORT_FUNC(pupa_strncpy) (char *dest, const char *src, int c);
|
|
char *EXPORT_FUNC(pupa_stpcpy) (char *dest, const char *src);
|
|
char *EXPORT_FUNC(pupa_strcat) (char *dest, const char *src);
|
|
|
|
|
|
int EXPORT_FUNC(pupa_memcmp) (const void *s1, const void *s2, pupa_size_t n);
|
|
int EXPORT_FUNC(pupa_strcmp) (const char *s1, const char *s2);
|
|
int EXPORT_FUNC(pupa_strncmp) (const char *s1, const char *s2, int c);
|
|
char *EXPORT_FUNC(pupa_strchr) (const char *s, int c);
|
|
char *EXPORT_FUNC(pupa_strrchr) (const char *s, int c);
|
|
int EXPORT_FUNC(pupa_isspace) (int c);
|
|
int EXPORT_FUNC(pupa_isprint) (int c);
|
|
int EXPORT_FUNC(pupa_isalpha) (int c);
|
|
int EXPORT_FUNC(pupa_tolower) (int c);
|
|
unsigned long EXPORT_FUNC(pupa_strtoul) (const char *str, char **end, int base);
|
|
char *EXPORT_FUNC(pupa_strdup) (const char *s);
|
|
char *EXPORT_FUNC(pupa_strndup) (const char *s, pupa_size_t n);
|
|
void *EXPORT_FUNC(pupa_memset) (void *s, int c, pupa_size_t n);
|
|
pupa_size_t EXPORT_FUNC(pupa_strlen) (const char *s);
|
|
int EXPORT_FUNC(pupa_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
|
int EXPORT_FUNC(pupa_vprintf) (const char *fmt, va_list args);
|
|
int EXPORT_FUNC(pupa_sprintf) (char *str, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
|
int EXPORT_FUNC(pupa_vsprintf) (char *str, const char *fmt, va_list args);
|
|
void EXPORT_FUNC(pupa_stop) (void) __attribute__ ((noreturn));
|
|
|
|
#endif /* ! PUPA_MISC_HEADER */
|