+2005-10-15 Yoshinori K. Okuji <okuji@enbug.org>
+
+ * fs/xfs.c (grub_xfs_iterate_dir): Change the type of BLK to
+ grub_uint64_t.
+ Call the hook with a NUL-terminated filename.
+ (grub_xfs_mount): Use grub_be_to_cpu32 instead of
+ grub_cpu_to_be32.
+
+ * kern/term.c (cursor_state): New variable.
+ (grub_term_set_current): Reset the cursor state on a new
+ terminal.
+ (grub_setcursor): Rewritten to use CURSOR_STATE.
+ (grub_getcursor): New function.
+
+ * include/grub/term.h (grub_getcursor): New prototype.
+
+ * io/gzio.c (test_header): Align BUF for accessing it as 32-bit
+ integers on ARM. Reported by Timothy Baldwin
+ <T.E.Baldwin99@members.leeds.ac.uk>.
+
2005-10-11 Marco Gerards <mgerards@xs4all.nl>
* fs/sfs.c (grub_sfs_open): Don't free `data->label' if it is not
#define GRUB_XFS_NEXT_DIRENT(pos,len) \
(pos) + GRUB_XFS_ROUND_TO_DIRENT (8 + 1 + len + 2)
\f
-static inline int grub_xfs_inode_block (struct grub_xfs_data *data,
- grub_uint64_t ino)
+static inline int
+grub_xfs_inode_block (struct grub_xfs_data *data,
+ grub_uint64_t ino)
{
long long int inoinag = GRUB_XFS_INO_INOINAG (data, ino);
long long ag = GRUB_XFS_INO_AG (data, ino);
}
-static inline int grub_xfs_inode_offset (struct grub_xfs_data *data,
- grub_uint64_t ino)
+static inline int
+grub_xfs_inode_offset (struct grub_xfs_data *data,
+ grub_uint64_t ino)
{
int inoag = GRUB_XFS_INO_INOINAG (data, ino);
return (inoag & ((1 << 4) - 1)) << 8;
{
grub_uint64_t ino;
void *inopos = (((char *) de)
- + sizeof (struct grub_xfs_dir_entry) + de->len - 1);
-
+ + sizeof (struct grub_xfs_dir_entry)
+ + de->len - 1);
+ char name[de->len + 1];
+
if (smallino)
{
ino = grub_be_to_cpu32 (*(grub_uint32_t *) inopos);
else
ino = *(grub_uint64_t *) inopos;
- if (call_hook (ino, de->name))
+ grub_memcpy (name, de->name, de->len);
+ name[de->len] = '\0';
+ if (call_hook (ino, name))
return 1;
de = ((struct grub_xfs_dir_entry *)
{
grub_ssize_t numread;
char *dirblock;
- unsigned int blk;
+ grub_uint64_t blk;
dirblock = grub_malloc (dir->data->bsize);
- if (!dirblock)
+ if (! dirblock)
return 0;
/* Iterate over every block the directory has. */
data->diropen.data = data;
data->diropen.ino = data->sblock.rootino;
data->diropen.inode_read = 1;
- data->bsize = grub_cpu_to_be32 (data->sblock.bsize);
- data->agsize = grub_cpu_to_be32 (data->sblock.agsize);
+ data->bsize = grub_be_to_cpu32 (data->sblock.bsize);
+ data->agsize = grub_be_to_cpu32 (data->sblock.agsize);
data->disk = disk;
data->inode = &data->diropen.inode;
void EXPORT_FUNC(grub_setcolor) (grub_uint8_t normal_color,
grub_uint8_t highlight_color);
int EXPORT_FUNC(grub_setcursor) (int on);
+int EXPORT_FUNC(grub_getcursor) (void);
void EXPORT_FUNC(grub_refresh) (void);
void EXPORT_FUNC(grub_set_more) (int onoff);
/* If the more pager is active. */
static int grub_more;
+/* The current cursor state. */
+static int cursor_state = 1;
+
void
grub_term_register (grub_term_t term)
{
grub_cur_term = term;
grub_cls ();
+ grub_setcursor (grub_getcursor ());
return GRUB_ERR_NONE;
}
int
grub_setcursor (int on)
{
- static int prev = 1;
- int ret = prev;
+ int ret = cursor_state;
if (grub_cur_term->setcursor)
{
(grub_cur_term->setcursor) (on);
- prev = on;
+ cursor_state = on;
}
return ret;
}
+int
+grub_getcursor (void)
+{
+ return cursor_state;
+}
+
void
grub_refresh (void)
{