2023-08-03 Paul Eggert <eggert@cs.ucla.edu>
+ readutmp: fix idx_t FIXME in API
+ * lib/readutmp.c (read_utmp): 2nd arg is now idx_t *, not
+ size_t *.
+ * lib/readutmp.h: Include idx.h, for idx_t.
+ * modules/readutmp (Depends-on): Add idx.
+
readutmp: go back to simple ‘free’
Omit the new free_utmp function. Instead, allocate storage
in one block, so that using code can still just call ‘free’.
Date Modules Changes
-2023-08-01 readutmp Some STRUCT_UTMP members can be char *,
- rather than fixed-length char arrays.
+2023-08-02 readutmp Some STRUCT_UTMP members can be char *,
+2023-08-01 rather than fixed-length char arrays.
+ read_utmp's 2nd arg is now idx_t * not size_t *.
Link additionally with $(READUTMP_LIB).
2023-07-10 dfa The signature of the function
}
int
-read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
int options)
{
/* Fill entries, simulating what a utmp file would contain. */
}
int
-read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
int options)
{
idx_t n_read = 0;
# else
int
-read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
int options)
{
idx_t n_read = 0;
#else /* dummy fallback */
int
-read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
int options)
{
errno = ENOSYS;
# error "Please include config.h first."
# endif
+# include "idx.h"
+
# include <stdlib.h>
# include <sys/types.h>
process-IDs do not currently exist.
If OPTIONS & READ_UTMP_USER_PROCESS is nonzero, omit entries which
do not correspond to a user process. */
-/* FIXME: This header should use idx_t, not size_t. */
-int read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+int read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
int options);
#endif /* __READUTMP_H__ */
Depends-on:
extensions
+idx
xalloc
stdbool
stdint