~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to uspace/app/bdsh/cmds/modules/cat/cat.h

  • Committer: Vojtech Horky
  • Author(s): Taylor Killian
  • Date: 2012-03-27 13:13:06 UTC
  • mto: (1460.2.42 mainline)
  • mto: This revision was merged to the branch mainline in revision 1447.
  • Revision ID: vojtechhorky@users.sourceforge.net-20120327131306-c8usfcb6fha4ro0u
Implement head and tail functionality in bdsh/cat (thx Taylor Killian)

This patch fixes a number of problems in the cat app. Most
importantly, it correctly displays characters at the end of the read
buffer, where previously multibyte characters were being rendered as
U_SPECIAL. It also implements the buffer size argument (-b) that the
--help mentions. The size of the buffer must be at least 4 though in
order to accommodate multibyte characters. Finally head (-H) and tail
(-t) were implemented as per --help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
/* Prototypes for the cat command, excluding entry points */
5
5
 
6
 
static unsigned int cat_file(const char *, size_t, bool);
 
6
static unsigned int cat_file(const char *, size_t, bool, off64_t, off64_t, bool);
7
7
 
8
8
#endif /* CAT_H */
9
9