source: rtems/cpukit/libmisc/shell/extern-ls.h @ 8916bdc7

4.104.115
Last change on this file since 8916bdc7 was 3899a537, checked in by Chris Johns <chrisj@…>, on 07/29/08 at 02:21:15

2008-07-29 Chris Johns <chrisj@…>

  • libblock/Makefile.am: Removed src/show_bdbuf.c.
  • libblock/src/show_bdbuf.c: Removed.
  • libblock/include/rtems/bdbuf.h, cpukit/libblock/src/bdbuf.c: Rewritten the bdbuf code. Remove pre-emption disable, score access, fixed many bugs and increased performance.
  • libblock/include/rtems/blkdev.h: Added RTEMS_BLKDEV_CAPABILITIES block device request. Cleaned up comments. Added block and user fields to the sg buffer request. Move to rtems_* namespace.
  • libblock/include/rtems/diskdevs.h, cpukit/libblock/src/diskdevs.c: Move to rtems_* namespace. Add a capabilities field for drivers. Change rtems_disk_lookup to rtems_disk_obtain to match the release call. You do not lookup and release a disk, you obtain and release a disk.
  • libblock/include/rtems/ide_part_table.h, libblock/include/rtems/ramdisk.h, libblock/src/ide_part_table.c: Move to rtems_* namespace.
  • libblock/include/rtems/nvdisk.h: Formatting change.
  • libblock/src/blkdev.c: Move to rtems_* namespace. Change rtems_disk_lookup to rtems_disk_obtain
  • libblock/src/flashdisk.c: Move to rtems_* namespace. Use the new support for the block number in the scatter/grather request struct. This allows non-continuous buffer requests for those drivers that can support increasing performance.
  • libblock/src/nvdisk.c: Move to rtems_* namespace. Removed warnings. Added better error checking. Fixed some comments.
  • libblock/src/ramdisk.c: Move to rtems_* namespace. Added some trace functions to help debugging upper layers. Use the new support for the block number in the scatter/grather request struct. This allows non-continuous buffer requests for those drivers that can support increasing performance.
  • libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h: Use new chains API. Removed temporary hack and changed set_errno_and_return_minus_one to rtems_set_errno_and_return_minus_one. Move fat_buf_access from header and stopped it being inlined. Updated to libblock changes.
  • libfs/src/dosfs/fat_fat_operations.c, libfs/src/dosfs/fat_file.c, libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_eval.c, libfs/src/dosfs/msdos_file.c, libfs/src/dosfs/msdos_format.c, libfs/src/dosfs/msdos_free.c, libfs/src/dosfs/msdos_initsupp.c, libfs/src/dosfs/msdos_misc.c, libfs/src/dosfs/msdos_mknod.c: Use new chains API. Removed temporary hack and changed set_errno_and_return_minus_one to rtems_set_errno_and_return_minus_one. Updated to libblock changes.
  • libmisc/Makefile.am: Add new ls and rm command files.
  • libmisc/shell/cmp-ls.c, libmisc/shell/extern-ls.h, libmisc/shell/filemode.c, libmisc/shell/print-ls.c, libmisc/shell/pwcache.c, libmisc/shell/utils-ls.c, libmisc/shell/vis.c, shell/vis.h: New.
  • libmisc/shell/extern-cp.h, libmisc/shell/main_cp.c, libmisc/shell/utils-cp.c: Fixed the usage call bug.
  • libmisc/shell/main_blksync.c: Updated to the new block IO ioctl command.
  • libmisc/shell/main_ls.c, libmisc/shell/main_rm.c: Updated to BSD commands with more features.
  • score/src/coremutex.c: Fix the strick order mutex code.
  • libmisc/shell/shell.c: Change shell tasks mode to be timeslice and no ASR.
  • sapi/include/confdefs.h: Change ata_driver_task_priority to rtems_ata_driver_task_priority. Add the new BD buf cache parameters with defaults.
  • score/src/interr.c: Do not return if the CPU halt call returns.
  • Property mode set to 100644
File size: 6.4 KB
Line 
1/*-
2 * Copyright (c) 1989, 1993
3 *      The Regents of the University of California.  All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Michael Fischbein.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 * 4. Neither the name of the University nor the names of its contributors
17 *    may be used to endorse or promote products derived from this software
18 *    without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 *      from: @(#)ls.h  8.1 (Berkeley) 5/31/93
33 * $FreeBSD: src/bin/ls/ls.h,v 1.23 2008/04/04 03:57:46 grog Exp $
34 */
35
36#ifndef _EXTERN_LS_H_
37#define _EXTERN_LS_H_
38
39#define NO_PRINT        1
40//#define COLORLS   1
41
42#include <sys/cdefs.h>
43#include <setjmp.h>
44
45#define major(d) rtems_filesystem_dev_major_t(d)
46#define minor(d) rtems_filesystem_dev_minor_t(d)
47
48const char *user_from_uid(uid_t uid, int nouser);
49
50typedef struct {
51  int blocksize;
52  int termwidth;
53  int sortkey;
54  int rval;
55  int output;
56  time_t now;
57
58  int f_accesstime;
59  int f_column;
60  int f_columnacross;
61  int f_flags;
62  int f_grouponly;
63  int f_humanize;
64  int f_inode;
65  int f_listdir;
66  int f_listdot;
67  int f_longform;
68  int f_nonprint;
69  int f_nosort;
70  int f_numericonly;
71  int f_octal;
72  int f_octal_escape;
73  int f_recursive;
74  int f_reversesort;
75  int f_sectime;
76  int f_singlecol;
77  int f_size;
78  int f_statustime;
79  int f_stream;
80  int f_type;
81  int f_typedir;
82  int f_whiteout;
83
84  int exit_code;
85  jmp_buf exit_jmp;
86} rtems_shell_ls_globals;
87
88#define blocksize      globals->blocksize
89#define termwidth      globals->termwidth
90#define sortkey        globals->sortkey
91#define rval           globals->rval
92#define output         globals->output
93#define now            globals->now
94
95#define f_accesstime   globals->f_accesstime
96#define f_column       globals->f_column
97#define f_columnacross globals->f_columnacross
98#define f_flags        globals->f_flags
99#define f_grouponly    globals->f_grouponly
100#define f_humanize     globals->f_humanize
101#define f_inode        globals->f_inode
102#define f_listdir      globals->f_listdir
103#define f_listdot      globals->f_listdot
104#define f_longform     globals->f_longform
105#define f_nonprint     globals->f_nonprint
106#define f_nosort       globals->f_nosort
107#define f_numericonly  globals->f_numericonly
108#define f_octal        globals->f_octal
109#define f_octal_escape globals->f_octal_escape
110#define f_recursive    globals->f_recursive
111#define f_reversesort  globals->f_reversesort
112#define f_sectime      globals->f_sectime
113#define f_singlecol    globals->f_singlecol
114#define f_size         globals->f_size
115#define f_statustime   globals->f_statustime
116#define f_stream       globals->f_stream
117#define f_type         globals->f_type
118#define f_typedir      globals->f_typedir
119#define f_whiteout     globals->f_whiteout
120
121#define exit_jump      &(globals->exit_jmp)
122
123void rtems_shell_ls_exit(rtems_shell_ls_globals* globals, int code);
124
125#define exit(ec) rtems_shell_ls_exit(globals, ec)
126
127
128typedef struct {
129        FTSENT *list;
130        u_int64_t btotal;
131        u_int64_t stotal;
132        int entries;
133        int maxlen;
134        int s_block;
135        int s_flags;
136        int s_group;
137        int s_inode;
138        int s_nlink;
139        int s_size;
140        int s_user;
141        int s_major;
142        int s_minor;
143} DISPLAY;
144
145typedef struct {
146        char *user;
147        char *group;
148        char *flags;
149        char data[1];
150} NAMES;
151
152#define acccmp        rtems_shell_ls_acccmp
153#define revacccmp     rtems_shell_ls_revacccmp
154#define modcmp        rtems_shell_ls_modcmp
155#define revmodcmp     rtems_shell_ls_revmodcmp
156#define namecmp       rtems_shell_ls_namecmp
157#define revnamecmp    rtems_shell_ls_revnamecmp
158#define statcmp       rtems_shell_ls_statcmp
159#define revstatcmp    rtems_shell_ls_revstatcmp
160#define sizecmp       rtems_shell_ls_sizecmp
161#define revsizecmp    rtems_shell_ls_revsizecmp
162#define printescaped  rtems_shell_ls_printescaped
163#define printacol     rtems_shell_ls_printacol
164#define printcol      rtems_shell_ls_printcol
165#define printlong     rtems_shell_ls_printlong
166#define printscol     rtems_shell_ls_printscol
167#define printstream   rtems_shell_ls_printstream
168#define usage         rtems_shell_ls_usage
169
170int      acccmp(const FTSENT *, const FTSENT *);
171int      revacccmp(const FTSENT *, const FTSENT *);
172int      modcmp(const FTSENT *, const FTSENT *);
173int      revmodcmp(const FTSENT *, const FTSENT *);
174int      namecmp(const FTSENT *, const FTSENT *);
175int      revnamecmp(const FTSENT *, const FTSENT *);
176int      statcmp(const FTSENT *, const FTSENT *);
177int      revstatcmp(const FTSENT *, const FTSENT *);
178int      sizecmp(const FTSENT *, const FTSENT *);
179int      revsizecmp(const FTSENT *, const FTSENT *);
180
181int      printescaped(rtems_shell_ls_globals* globals, const char *);
182void     printacol(rtems_shell_ls_globals* globals, DISPLAY *);
183void     printcol(rtems_shell_ls_globals* globals, DISPLAY *);
184void     printlong(rtems_shell_ls_globals* globals, DISPLAY *);
185void     printscol(rtems_shell_ls_globals* globals, DISPLAY *);
186void     printstream(rtems_shell_ls_globals* globals, DISPLAY *);
187int      safe_print(rtems_shell_ls_globals* globals, const char *);
188void     usage(rtems_shell_ls_globals* globals);
189
190void strmode(mode_t mode, char *p);
191
192#define DAYSPERNYEAR 365
193#define SECSPERDAY   (60 * 60 * 24)
194
195#endif /* !_EXTERN_H_ */
Note: See TracBrowser for help on using the repository browser.