File indexing completed on 2025-05-11 08:24:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef _EXTERN_LS_H_
0037 #define _EXTERN_LS_H_
0038
0039 #define NO_PRINT 1
0040
0041
0042 #include <sys/cdefs.h>
0043 #include <setjmp.h>
0044 #include <rtems.h>
0045
0046 #define major(d) rtems_filesystem_dev_major_t(d)
0047 #define minor(d) rtems_filesystem_dev_minor_t(d)
0048
0049 const char *user_from_uid(uid_t uid, int nouser);
0050
0051 typedef struct {
0052 int blocksize;
0053 int termwidth;
0054 int sortkey;
0055 int rval;
0056 int output;
0057 time_t now;
0058
0059 int f_accesstime;
0060 int f_column;
0061 int f_columnacross;
0062 int f_flags;
0063 int f_grouponly;
0064 int f_humanize;
0065 int f_inode;
0066 int f_listdir;
0067 int f_listdot;
0068 int f_longform;
0069 int f_nonprint;
0070 int f_nosort;
0071 int f_numericonly;
0072 int f_octal;
0073 int f_octal_escape;
0074 int f_recursive;
0075 int f_reversesort;
0076 int f_sectime;
0077 int f_singlecol;
0078 int f_size;
0079 int f_statustime;
0080 int f_stream;
0081 int f_type;
0082 int f_typedir;
0083 int f_whiteout;
0084
0085 int exit_code;
0086 jmp_buf exit_jmp;
0087 } rtems_shell_ls_globals;
0088
0089 #define blocksize globals->blocksize
0090 #define termwidth globals->termwidth
0091 #define sortkey globals->sortkey
0092 #define rval globals->rval
0093 #define output globals->output
0094 #define now globals->now
0095
0096 #define f_accesstime globals->f_accesstime
0097 #define f_column globals->f_column
0098 #define f_columnacross globals->f_columnacross
0099 #define f_flags globals->f_flags
0100 #define f_grouponly globals->f_grouponly
0101 #define f_humanize globals->f_humanize
0102 #define f_inode globals->f_inode
0103 #define f_listdir globals->f_listdir
0104 #define f_listdot globals->f_listdot
0105 #define f_longform globals->f_longform
0106 #define f_nonprint globals->f_nonprint
0107 #define f_nosort globals->f_nosort
0108 #define f_numericonly globals->f_numericonly
0109 #define f_octal globals->f_octal
0110 #define f_octal_escape globals->f_octal_escape
0111 #define f_recursive globals->f_recursive
0112 #define f_reversesort globals->f_reversesort
0113 #define f_sectime globals->f_sectime
0114 #define f_singlecol globals->f_singlecol
0115 #define f_size globals->f_size
0116 #define f_statustime globals->f_statustime
0117 #define f_stream globals->f_stream
0118 #define f_type globals->f_type
0119 #define f_typedir globals->f_typedir
0120 #define f_whiteout globals->f_whiteout
0121
0122 #define exit_jump &(globals->exit_jmp)
0123
0124 void rtems_shell_ls_exit(rtems_shell_ls_globals* globals, int code);
0125
0126 #define exit(ec) rtems_shell_ls_exit(globals, ec)
0127
0128
0129 typedef struct {
0130 FTSENT *list;
0131 u_int64_t btotal;
0132 u_int64_t stotal;
0133 int entries;
0134 int maxlen;
0135 int s_block;
0136 int s_flags;
0137 int s_group;
0138 int s_inode;
0139 int s_nlink;
0140 int s_size;
0141 int s_user;
0142 int s_major;
0143 int s_minor;
0144 } DISPLAY;
0145
0146 typedef struct {
0147 char *user;
0148 char *group;
0149 char *flags;
0150 char data[1];
0151 } NAMES;
0152
0153 #define acccmp rtems_shell_ls_acccmp
0154 #define revacccmp rtems_shell_ls_revacccmp
0155 #define modcmp rtems_shell_ls_modcmp
0156 #define revmodcmp rtems_shell_ls_revmodcmp
0157 #define namecmp rtems_shell_ls_namecmp
0158 #define revnamecmp rtems_shell_ls_revnamecmp
0159 #define statcmp rtems_shell_ls_statcmp
0160 #define revstatcmp rtems_shell_ls_revstatcmp
0161 #define sizecmp rtems_shell_ls_sizecmp
0162 #define revsizecmp rtems_shell_ls_revsizecmp
0163 #define printescaped rtems_shell_ls_printescaped
0164 #define printacol rtems_shell_ls_printacol
0165 #define printcol rtems_shell_ls_printcol
0166 #define printlong rtems_shell_ls_printlong
0167 #define printscol rtems_shell_ls_printscol
0168 #define printstream rtems_shell_ls_printstream
0169 #define usage rtems_shell_ls_usage
0170
0171 int acccmp(const FTSENT *, const FTSENT *);
0172 int revacccmp(const FTSENT *, const FTSENT *);
0173 int modcmp(const FTSENT *, const FTSENT *);
0174 int revmodcmp(const FTSENT *, const FTSENT *);
0175 int namecmp(const FTSENT *, const FTSENT *);
0176 int revnamecmp(const FTSENT *, const FTSENT *);
0177 int statcmp(const FTSENT *, const FTSENT *);
0178 int revstatcmp(const FTSENT *, const FTSENT *);
0179 int sizecmp(const FTSENT *, const FTSENT *);
0180 int revsizecmp(const FTSENT *, const FTSENT *);
0181
0182 int printescaped(rtems_shell_ls_globals* globals, const char *);
0183 void printacol(rtems_shell_ls_globals* globals, DISPLAY *);
0184 void printcol(rtems_shell_ls_globals* globals, DISPLAY *);
0185 void printlong(rtems_shell_ls_globals* globals, DISPLAY *);
0186 void printscol(rtems_shell_ls_globals* globals, DISPLAY *);
0187 void printstream(rtems_shell_ls_globals* globals, DISPLAY *);
0188 int safe_print(rtems_shell_ls_globals* globals, const char *);
0189 void usage(rtems_shell_ls_globals* globals);
0190
0191 void strmode(mode_t mode, char *p);
0192
0193 #endif