mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 15:02:01 +00:00
[ROSAPPS]
Get kitty back to rosapps svn path=/trunk/; revision=66990
This commit is contained in:
parent
7ee7d29258
commit
a8e04976ec
6 changed files with 91 additions and 0 deletions
|
@ -12,5 +12,6 @@ add_subdirectory(kill)
|
|||
#add_subdirectory(rosddt)
|
||||
#add_subdirectory(screenshot)
|
||||
#add_subdirectory(systeminfo)
|
||||
#add_subdirectory(tcat)
|
||||
add_subdirectory(tlist)
|
||||
add_subdirectory(utils)
|
||||
|
|
52
rosapps/applications/sysutils/tcat/cat.c
Normal file
52
rosapps/applications/sysutils/tcat/cat.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* FILE : cat.c
|
||||
* NATIVE NAME: tcat "tappak's cat" :)
|
||||
* AUTHOR : Semyon Novikov (tappak)
|
||||
* PROJECT : ReactOS Operating System
|
||||
* DESCRIPTION: file concatenation tool
|
||||
* DATE : 2004-01-21
|
||||
* LICENSE : GPL
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define F_O_ERR "can not open file"
|
||||
|
||||
void help(void)
|
||||
{
|
||||
puts("File concatenation tool");
|
||||
puts("Usage: cat [file]");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *srcf;
|
||||
char *keys[]={"--help","/help"};
|
||||
int i=0,ret=0;
|
||||
switch(argc)
|
||||
{
|
||||
case 1:puts("Usage: cat [file]");break;
|
||||
case 2:
|
||||
if ((!strcmp(argv[1],keys[0]))||(!strcmp(argv[1],keys[1])))
|
||||
help();
|
||||
else
|
||||
{
|
||||
if((srcf=fopen(argv[1],"r"))!=NULL)
|
||||
{
|
||||
while(i!=EOF)
|
||||
{ i=fgetc(srcf);
|
||||
putchar(i);
|
||||
}
|
||||
fclose(srcf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s %s %s\n",argv[0],F_O_ERR,argv[1]);
|
||||
ret=-1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
6
rosapps/applications/sysutils/tcat/tcat.rbuild
Normal file
6
rosapps/applications/sysutils/tcat/tcat.rbuild
Normal file
|
@ -0,0 +1,6 @@
|
|||
<module name="tcat" type="win32cui" installbase="system32" installname="tcat.exe">
|
||||
<library>ntdll</library>
|
||||
<library>user32</library>
|
||||
|
||||
<file>cat.c</file>
|
||||
</module>
|
|
@ -1,4 +1,5 @@
|
|||
#add_subdirectory(binpatch)
|
||||
add_subdirectory(cat)
|
||||
#add_subdirectory(driver)
|
||||
#add_subdirectory(infinst)
|
||||
#add_subdirectory(nts2w32err)
|
||||
|
|
5
rosapps/applications/sysutils/utils/cat/CMakeLists.txt
Normal file
5
rosapps/applications/sysutils/utils/cat/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
add_executable(cat cat.c)
|
||||
set_module_type(cat win32cui)
|
||||
add_importlibs(cat ntdll user32 msvcrt kernel32)
|
||||
add_cd_file(TARGET cat DESTINATION reactos/bin FOR all)
|
26
rosapps/applications/sysutils/utils/cat/cat.c
Normal file
26
rosapps/applications/sysutils/utils/cat/cat.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i;
|
||||
FILE* in;
|
||||
char ch;
|
||||
|
||||
for (i=1; i<argc; i++)
|
||||
{
|
||||
in = fopen(argv[i],"r");
|
||||
if (in == NULL)
|
||||
{
|
||||
printf("Failed to open file %s\n", argv[i]);
|
||||
return(0);
|
||||
}
|
||||
|
||||
while ((ch = fgetc(in)) != EOF)
|
||||
{
|
||||
putchar(ch);
|
||||
}
|
||||
fclose(in);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue