+2004-01-14 Ulrich Drepper <drepper@redhat.com>
+
+ * libio/libio.h: Add const to function tables types.
+ * libio/libioP.h: Likewise.
+ * /login/utmp-private.h: Likewise.
+ * libio/fileops.c: Add const to jump table variable definition.
+ * libio/genops.c: Likewise.
+ * libio/iofopncook.c: Likewise.
+ * libio/iopopen.c: Likewise.
+ * libio/memstream.c: Likewise.
+ * libio/obprintf.c: Likewise.
+ * libio/oldfileops.c: Likewise.
+ * libio/oldiopopen.c: Likewise.
+ * libio/strops.c: Likewise.
+ * libio/vsnprintf.c: Likewise.
+ * libio/vswprintf.c: Likewise.
+ * libio/wfileops.c: Likewise.
+ * libio/wstrops.c: Likewise.
+ * login/getutent_r.c: Likewise.
+ * login/getutid_r.c Likewise.
+ * login/getutline_r.c: Likewise.
+ * sysdeps/generic/utmp_file.c: Likewise.
+
2004-01-09 Bruno Haible <bruno@clisp.org>
* intl/gmo.h (MO_REVISION_NUMBER_WITH_SYSDEP_I): New definition.
-/* Copyright (C) 1993, 1995, 1997-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
versioned_symbol (libc, _IO_new_file_xsputn, _IO_file_xsputn, GLIBC_2_1);
#endif
-struct _IO_jump_t _IO_file_jumps =
+const struct _IO_jump_t _IO_file_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, INTUSE(_IO_file_finish)),
};
libc_hidden_data_def (_IO_file_jumps)
-struct _IO_jump_t _IO_file_jumps_mmap =
+const struct _IO_jump_t _IO_file_jumps_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, INTUSE(_IO_file_finish)),
JUMP_INIT(imbue, _IO_default_imbue)
};
-struct _IO_jump_t _IO_file_jumps_maybe_mmap =
+const struct _IO_jump_t _IO_file_jumps_maybe_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, INTUSE(_IO_file_finish)),
-/* Copyright (C) 1993,1995,1997-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1995,1997-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
int flags;
int orientation;
struct _IO_wide_data *wd;
- struct _IO_jump_t *jmp;
+ const struct _IO_jump_t *jmp;
{
_IO_old_init (fp, flags);
fp->_mode = orientation;
-/* Copyright (C) 1993,95,97,99,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993,95,97,99,2000,2002,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
}
-static struct _IO_jump_t _IO_cookie_jumps = {
+static const struct _IO_jump_t _IO_cookie_jumps = {
JUMP_INIT_DUMMY,
JUMP_INIT(finish, INTUSE(_IO_file_finish)),
JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
return (ret == -1) ? _IO_pos_BAD : ret;
}
-static struct _IO_jump_t _IO_old_cookie_jumps = {
+static const struct _IO_jump_t _IO_old_cookie_jumps = {
JUMP_INIT_DUMMY,
JUMP_INIT(finish, INTUSE(_IO_file_finish)),
JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
-/* Copyright (C) 1993, 1997-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
};
typedef struct _IO_proc_file _IO_proc_file;
-static struct _IO_jump_t _IO_proc_jumps;
-static struct _IO_jump_t _IO_wproc_jumps;
+static const struct _IO_jump_t _IO_proc_jumps;
+static const struct _IO_jump_t _IO_wproc_jumps;
static struct _IO_proc_file *proc_file_chain;
#endif
}
-static struct _IO_jump_t _IO_proc_jumps = {
+static const struct _IO_jump_t _IO_proc_jumps = {
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
JUMP_INIT(overflow, _IO_new_file_overflow),
JUMP_INIT(imbue, _IO_default_imbue)
};
-static struct _IO_jump_t _IO_wproc_jumps = {
+static const struct _IO_jump_t _IO_wproc_jumps = {
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
JUMP_INIT(overflow, _IO_new_file_overflow),
-/* Copyright (C) 1991-1995, 1997-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1995, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
wchar_t _shortbuf[1];
- struct _IO_jump_t *_wide_vtable;
+ const struct _IO_jump_t *_wide_vtable;
};
#endif
-/* Copyright (C) 1993, 1997-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
extern int _IO_default_showmanyc __P ((_IO_FILE *));
extern void _IO_default_imbue __P ((_IO_FILE *, void *));
-extern struct _IO_jump_t _IO_file_jumps;
+extern const struct _IO_jump_t _IO_file_jumps;
libc_hidden_proto (_IO_file_jumps)
-extern struct _IO_jump_t _IO_file_jumps_mmap attribute_hidden;
-extern struct _IO_jump_t _IO_file_jumps_maybe_mmap attribute_hidden;
-extern struct _IO_jump_t _IO_wfile_jumps;
+extern const struct _IO_jump_t _IO_file_jumps_mmap attribute_hidden;
+extern const struct _IO_jump_t _IO_file_jumps_maybe_mmap attribute_hidden;
+extern const struct _IO_jump_t _IO_wfile_jumps;
libc_hidden_proto (_IO_wfile_jumps)
-extern struct _IO_jump_t _IO_wfile_jumps_mmap attribute_hidden;
-extern struct _IO_jump_t _IO_wfile_jumps_maybe_mmap attribute_hidden;
-extern struct _IO_jump_t _IO_old_file_jumps attribute_hidden;
-extern struct _IO_jump_t _IO_streambuf_jumps;
-extern struct _IO_jump_t _IO_old_proc_jumps attribute_hidden;
-extern struct _IO_jump_t _IO_str_jumps attribute_hidden;
-extern struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
+extern const struct _IO_jump_t _IO_wfile_jumps_mmap attribute_hidden;
+extern const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap attribute_hidden;
+extern const struct _IO_jump_t _IO_old_file_jumps attribute_hidden;
+extern const struct _IO_jump_t _IO_streambuf_jumps;
+extern const struct _IO_jump_t _IO_old_proc_jumps attribute_hidden;
+extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
+extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
extern struct _IO_codecvt __libio_codecvt attribute_hidden;
extern int _IO_do_write __P ((_IO_FILE *, const char *, _IO_size_t));
extern int _IO_new_do_write __P ((_IO_FILE *, const char *, _IO_size_t));
extern _IO_FILE* _IO_new_file_fopen __P ((_IO_FILE *, const char *, const char *,
int));
extern void _IO_no_init __P ((_IO_FILE *, int, int, struct _IO_wide_data *,
- struct _IO_jump_t *));
+ const struct _IO_jump_t *));
extern void _IO_new_file_init __P ((struct _IO_FILE_plus *));
extern _IO_FILE* _IO_new_file_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
extern _IO_FILE* _IO_file_setbuf_mmap __P ((_IO_FILE *, char *, _IO_ssize_t));
-/* Copyright (C) 1995-1997,1999,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-97,99,2000,2002,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
static void _IO_mem_finish __P ((_IO_FILE* fp, int));
-static struct _IO_jump_t _IO_mem_jumps =
+static const struct _IO_jump_t _IO_mem_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT (finish, _IO_mem_finish),
/* Print output of stream to given obstack.
- Copyright (C) 1996,1997,1999-2003 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
/* the jump table. */
-static struct _IO_jump_t _IO_obstack_jumps =
+static const struct _IO_jump_t _IO_obstack_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, NULL),
-/* Copyright (C) 1993,95,97,98,99,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
}
-struct _IO_jump_t _IO_old_file_jumps =
+const struct _IO_jump_t _IO_old_file_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_old_file_finish),
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
#endif
}
-struct _IO_jump_t _IO_old_proc_jumps = {
+const struct _IO_jump_t _IO_old_proc_jumps = {
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_old_file_finish),
JUMP_INIT(overflow, _IO_old_file_overflow),
-/* Copyright (C) 1993, 1997-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
INTUSE(_IO_default_finish) (fp, 0);
}
-struct _IO_jump_t _IO_str_jumps =
+const struct _IO_jump_t _IO_str_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
-/* Copyright (C) 1994,1997,1999-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1997,1999-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
}
-static struct _IO_jump_t _IO_strn_jumps =
+static const struct _IO_jump_t _IO_strn_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
-/* Copyright (C) 1994,1997,1999,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1997,1999-2002,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
}
-static struct _IO_jump_t _IO_wstrn_jumps =
+static const struct _IO_jump_t _IO_wstrn_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_wstr_finish),
-/* Copyright (C) 1993,95,97,98,99,2000,2001,2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1995,1997-2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@cygnus.com>.
Based on the single byte version by Per Bothner <bothner@cygnus.com>.
INTDEF(_IO_wfile_xsputn)
-struct _IO_jump_t _IO_wfile_jumps =
+const struct _IO_jump_t _IO_wfile_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
libc_hidden_data_def (_IO_wfile_jumps)
-struct _IO_jump_t _IO_wfile_jumps_mmap =
+const struct _IO_jump_t _IO_wfile_jumps_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
JUMP_INIT(imbue, _IO_default_imbue)
};
-struct _IO_jump_t _IO_wfile_jumps_maybe_mmap =
+const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
-/* Copyright (C) 1993,1997-1999,2001-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997-1999,2001-2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
wchar_t *pstart;
{
wchar_t *end;
-
+
if (size == 0)
end = ptr + __wcslen (ptr);
else if ((_IO_size_t) ptr + size * sizeof (wchar_t) > (_IO_size_t) ptr)
INTUSE(_IO_wdefault_finish) (fp, 0);
}
-struct _IO_jump_t _IO_wstr_jumps =
+const struct _IO_jump_t _IO_wstr_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_wstr_finish),
-/* Copyright (C) 1996,1997,1998,2000,2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998,2000,2001,2002,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
static void endutent_unknown (void);
/* Initial Jump table. */
-struct utfuncs __libc_utmp_unknown_functions =
+const struct utfuncs __libc_utmp_unknown_functions =
{
setutent_unknown,
getutent_r_unknown,
};
/* Currently selected backend. */
-struct utfuncs *__libc_utmp_jump_table = &__libc_utmp_unknown_functions;
+const struct utfuncs *__libc_utmp_jump_table = &__libc_utmp_unknown_functions;
/* We need to protect the opening of the file. */
__libc_lock_define_initialized (, __libc_utmp_lock attribute_hidden)
-/* Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
/* We have to use the lock in getutent_r.c. */
__libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
-/* The jump table is also in getutent_r.c. */
-extern struct utfuncs *__libc_utmp_jump_table;
-
int
__getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result)
-/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
/* We have to use the lock in getutent_r.c. */
__libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
-/* The jump table is also in getutent_r.c. */
-extern struct utfuncs *__libc_utmp_jump_table;
-
int
__getutline_r (const struct utmp *line, struct utmp *buffer,
/* Internal definitions and declarations for UTMP functions.
- Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
};
/* The tables from the services. */
-extern struct utfuncs __libc_utmp_file_functions attribute_hidden;
-extern struct utfuncs __libc_utmp_unknown_functions attribute_hidden;
+extern const struct utfuncs __libc_utmp_file_functions attribute_hidden;
+extern const struct utfuncs __libc_utmp_unknown_functions attribute_hidden;
/* Currently selected backend. */
-extern struct utfuncs *__libc_utmp_jump_table attribute_hidden;
+extern const struct utfuncs *__libc_utmp_jump_table attribute_hidden;
/* Current file name. */
extern const char *__libc_utmp_file_name attribute_hidden;
-/* Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
static int updwtmp_file (const char *file, const struct utmp *utmp);
/* Jump table for file functions. */
-struct utfuncs __libc_utmp_file_functions =
+const struct utfuncs __libc_utmp_file_functions =
{
setutent_file,
getutent_r_file,