X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Freadutmp.h;h=f96b9dc491c3d948fb4529398a33b7568749be5c;hb=12cc8b970806cca3260e499c74d2f001df705a60;hp=28afb780c851ea3580de58c2a80b0df6c97387c3;hpb=55b799acc33983a85f56baf9139ac12e9288537b;p=gnulib.git diff --git a/lib/readutmp.h b/lib/readutmp.h index 28afb780c..f96b9dc49 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -25,14 +25,16 @@ # ifdef HAVE_UTMPX_H # include -# define STRUCT_UTMP struct utmpx +# define UTMP_STRUCT_NAME utmpx # define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_tv.tv_sec) # else # include -# define STRUCT_UTMP struct utmp +# define UTMP_STRUCT_NAME utmp # define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_time) # endif +typedef struct UTMP_STRUCT_NAME STRUCT_UTMP; + # include # ifdef HAVE_SYS_PARAM_H # include @@ -69,8 +71,6 @@ extern int errno; # define WTMP_FILE "/etc/wtmp" # endif -extern STRUCT_UTMP * utmp_contents; - # undef PARAMS # if defined (__STDC__) && __STDC__ # define PARAMS(Args) Args @@ -78,7 +78,8 @@ extern STRUCT_UTMP * utmp_contents; # define PARAMS(Args) () # endif -extern char * extract_trimmed_name PARAMS((const STRUCT_UTMP *ut)); -extern int read_utmp PARAMS((const char *filename)); +extern char *extract_trimmed_name PARAMS ((const STRUCT_UTMP *ut)); +extern int read_utmp PARAMS ((const char *filename, + int *n_entries, STRUCT_UTMP **utmp_buf)); #endif /* __READUTMP_H__ */