Code cleanup
This commit is contained in:
parent
8a4829b15c
commit
0a037a5c67
11
src/cat.c
11
src/cat.c
|
@ -1,5 +1,5 @@
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
/* Copyright (c) 2007 Pierre Pronchery <khorben@defora.org> */
|
/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
|
||||||
/* This file is part of DeforaOS Unix utils */
|
/* This file is part of DeforaOS Unix utils */
|
||||||
/* utils is not free software; you can redistribute it and/or modify it under
|
/* utils is not free software; you can redistribute it and/or modify it under
|
||||||
* the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
* the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||||
|
@ -34,8 +34,11 @@ typedef enum _OutputDelay {
|
||||||
* returns:
|
* returns:
|
||||||
* 0 successful
|
* 0 successful
|
||||||
* 2 an error occured */
|
* 2 an error occured */
|
||||||
static int _cat_error(char * message, int ret);
|
static int _cat_error(char const * message, int ret);
|
||||||
static void _cat_file(FILE * fp, OutputDelay od);
|
static void _cat_file(FILE * fp, OutputDelay od);
|
||||||
|
static int _write_nonbuf(int c);
|
||||||
|
static int _write_buf(int c);
|
||||||
|
|
||||||
static int _cat(OutputDelay od, int argc, char * argv[])
|
static int _cat(OutputDelay od, int argc, char * argv[])
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -63,15 +66,13 @@ static int _cat(OutputDelay od, int argc, char * argv[])
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _cat_error(char * message, int ret)
|
static int _cat_error(char const * message, int ret)
|
||||||
{
|
{
|
||||||
fputs("cat: ", stderr);
|
fputs("cat: ", stderr);
|
||||||
perror(message);
|
perror(message);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _write_nonbuf(int c);
|
|
||||||
static int _write_buf(int c);
|
|
||||||
static void _cat_file(FILE * fp, OutputDelay od)
|
static void _cat_file(FILE * fp, OutputDelay od)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user