mirror of
https://github.com/reactos/reactos.git
synced 2024-09-20 17:51:53 +00:00
[ROSAPPS] Remove 'man' utility
This commit is contained in:
parent
f1519ec1b6
commit
b34b47056a
|
@ -4,7 +4,6 @@ add_subdirectory(gettype)
|
|||
add_subdirectory(kill)
|
||||
add_subdirectory(logevent)
|
||||
add_subdirectory(lsdd)
|
||||
add_subdirectory(man)
|
||||
if(ARCH STREQUAL "i386")
|
||||
add_subdirectory(pedump)
|
||||
endif()
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
add_executable(man man.c)
|
||||
set_module_type(man win32cui)
|
||||
add_importlibs(man user32 msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET man DESTINATION reactos/system32 FOR all)
|
|
@ -1,259 +0,0 @@
|
|||
/*
|
||||
* FILE : man.c
|
||||
* NATIVE NAME: ReactOS manual browser
|
||||
* AUTHOR : Semyon Novikov (tappak)
|
||||
* PROJECT : ReactOS Operating System
|
||||
* DESCRIPTION: manual file browser (Use Linux man file syntax)
|
||||
* DATE : 2004-03-29
|
||||
* LICENSE : GPL
|
||||
*/
|
||||
|
||||
/* Known issues.
|
||||
* 1. Scroll screen
|
||||
* 2. Non ENVIRONMENT manpath varrible
|
||||
* 3. At the end of man page must be ./" tag!
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <wincon.h>
|
||||
|
||||
#define MAXLINE 256
|
||||
#define BOLD 7|9
|
||||
#define ITALIC 3|9
|
||||
#define NORMAL 7|0
|
||||
|
||||
/*===[functions]===*/
|
||||
void SetCl(WORD cl);
|
||||
int OpenF(char* name);
|
||||
int CloseF(void);
|
||||
void Usage(void);
|
||||
int AnalyzeArgv(char *);
|
||||
int AnalyzeFile();
|
||||
/*=================*/
|
||||
|
||||
/*====[Globals]====*/
|
||||
FILE* manfile;
|
||||
char OpenFlag=0;
|
||||
char manpath[MAX_PATH];
|
||||
/*=================*/
|
||||
|
||||
void
|
||||
SetCl(WORD cl)
|
||||
{
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),cl);
|
||||
}
|
||||
|
||||
int
|
||||
OpenF(char* name)
|
||||
{
|
||||
int ret = 0;
|
||||
char *cp;
|
||||
|
||||
/* C:\man\\... */
|
||||
cp = getenv("SystemDrive");
|
||||
if (cp && *cp)
|
||||
{
|
||||
strcpy(manpath, cp);
|
||||
strcat(manpath, "\\man\\");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(manpath, "C:\\man\\");
|
||||
}
|
||||
strcat(manpath, name);
|
||||
|
||||
manfile = fopen(manpath, "r");
|
||||
if (manfile != NULL)
|
||||
{
|
||||
OpenFlag = 1;
|
||||
AnalyzeFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
CloseF()
|
||||
{
|
||||
int retval=0;
|
||||
|
||||
if(fclose(manfile))
|
||||
OpenFlag=0;
|
||||
else retval=-1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
Usage()
|
||||
{
|
||||
puts("usage: man [command]");
|
||||
puts("see \"man man\" for details");
|
||||
}
|
||||
|
||||
int
|
||||
AnalyzeArgv(char *argument)
|
||||
{
|
||||
int element;
|
||||
char HelpFlag=0;
|
||||
char *keys[]={"--help","/h","/?","-h"};
|
||||
char *sections[]={".1",".2",".3",".4",".5",".6",".7",".8",".9"};
|
||||
char *filename=(char*)malloc(sizeof(char)*MAXLINE);
|
||||
|
||||
strcpy(filename,argument); //save argument value
|
||||
|
||||
for(element=0;element<_countof(keys);element++)
|
||||
{
|
||||
if(!strcmp(keys[element],argument))
|
||||
{
|
||||
Usage();
|
||||
HelpFlag=1;
|
||||
}
|
||||
}
|
||||
|
||||
element = 0;
|
||||
|
||||
if(!HelpFlag)
|
||||
{
|
||||
|
||||
if(OpenF(filename))
|
||||
{
|
||||
while(element<_countof(sections)&&OpenF(strcat(filename,sections[element])))
|
||||
{
|
||||
strcpy(filename,argument);
|
||||
element++;
|
||||
}
|
||||
|
||||
if(element>=_countof(sections)) printf("No manual for %s\n",argument);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
void sh_outp(char *cur_string)
|
||||
{
|
||||
int symbol;
|
||||
putchar('\n');
|
||||
putchar('\n');
|
||||
for(symbol=3;putchar(cur_string[symbol]); symbol++);
|
||||
}
|
||||
|
||||
void th_outp(char *cur_string, char *THtag)
|
||||
{
|
||||
int symbol;
|
||||
putchar('\n');
|
||||
putchar('\n');
|
||||
putchar('\t');
|
||||
putchar('\t');
|
||||
SetCl(ITALIC);
|
||||
for(symbol=3;putchar(THtag[symbol]); symbol++);
|
||||
putchar('\n');
|
||||
SetCl(NORMAL);
|
||||
}
|
||||
|
||||
void text_outp(char *cur_string)
|
||||
{
|
||||
int symbol=0;
|
||||
|
||||
if(cur_string[0]=='.')
|
||||
while(cur_string[symbol]!=' ')
|
||||
symbol++;
|
||||
|
||||
for(;cur_string[symbol]!='\n'; symbol++)
|
||||
putchar(cur_string[symbol]);
|
||||
|
||||
putchar(' ');
|
||||
}
|
||||
|
||||
int
|
||||
AnalyzeFile()
|
||||
{
|
||||
char *cur_string=(char*)malloc(sizeof(char)*MAXLINE);
|
||||
char *THtag=(char*)malloc(sizeof(char)*MAXLINE);
|
||||
|
||||
|
||||
|
||||
|
||||
while(fgets(cur_string,MAXLINE,manfile))
|
||||
|
||||
/* TAGs processing */
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='S')&&
|
||||
(cur_string[2]=='H')) // .SH tag
|
||||
{
|
||||
SetCl(BOLD);
|
||||
sh_outp(cur_string);
|
||||
SetCl(NORMAL);
|
||||
}
|
||||
else
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='I')&&
|
||||
(cur_string[2]==' ')) // .I tag
|
||||
{
|
||||
SetCl(ITALIC);
|
||||
text_outp(cur_string);
|
||||
SetCl(NORMAL);
|
||||
}
|
||||
else
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='/')&&
|
||||
(cur_string[2]=='\"')); // ./" tag (comment)
|
||||
|
||||
else
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='T')&&
|
||||
(cur_string[2]=='H')) // .TH tag
|
||||
{
|
||||
strcpy(THtag,cur_string);
|
||||
}
|
||||
else
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='B')&&
|
||||
(cur_string[2]==' ')) // .B tag
|
||||
{
|
||||
SetCl(BOLD);
|
||||
text_outp(cur_string);
|
||||
SetCl(NORMAL);
|
||||
}
|
||||
else
|
||||
if((cur_string[0]=='.')&&(cur_string[1]=='N')&&
|
||||
(cur_string[2]=='L'))
|
||||
{
|
||||
putchar('\n');
|
||||
putchar(' ');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
text_outp(cur_string); // print plane text
|
||||
}
|
||||
th_outp(cur_string, THtag);
|
||||
/* END of TAGs processing */
|
||||
|
||||
free(cur_string);
|
||||
free(THtag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
switch(argc)
|
||||
{
|
||||
case 1: Usage(); break;
|
||||
case 2: AnalyzeArgv(argv[1]);break;
|
||||
default: Usage();break;
|
||||
}
|
||||
|
||||
if(OpenFlag)CloseF();
|
||||
SetCl(NORMAL);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
@echo off
|
||||
rem []------[ReactOS MAN Project ]--------[]
|
||||
rem Project: ReactOS manual browser
|
||||
rem File: man.cmd
|
||||
rem Purpose: Clone of UNIX man
|
||||
rem Programmers: Semyon Novikov
|
||||
rem Version: 0.1.2
|
||||
rem OS: WinNT/ReactOS/os2 eCs(testing)
|
||||
rem License: GPL
|
||||
rem []------------------------------------[]
|
||||
|
||||
|
||||
rem []==[Config area]==[]
|
||||
set MANED=edit
|
||||
set MANMORE=cat
|
||||
set MAN=%WINDIR%\man
|
||||
rem []==[End of config area]==[]
|
||||
|
||||
goto chk_param
|
||||
|
||||
:chk_param
|
||||
|
||||
if "%4"=="/create" attrib -r %MAN%\%SECTION%\%1.man
|
||||
if "%4"=="/create" %ED% %MAN%\%SECTION%\%1.man
|
||||
if "%4"=="/create" goto end
|
||||
|
||||
if "%2"=="/e" set ED=%MANED%
|
||||
if "%2"=="/e" goto locate
|
||||
|
||||
if "%3"=="/e" set ED=%MANED%
|
||||
if "%3"=="/e" goto chk_section
|
||||
|
||||
if "%2"=="" set ED=%MANMORE%
|
||||
if "%2"=="" goto locate
|
||||
|
||||
:chk_section
|
||||
set SECTION=%2
|
||||
set ED=%MANMORE%
|
||||
if "%3"=="/e" set ED=%MANED%
|
||||
goto open_page
|
||||
|
||||
:locate
|
||||
if exist %MAN%\1\%1.man set SECTION=1
|
||||
if exist %MAN%\2\%1.man set SECTION=2
|
||||
if exist %MAN%\3\%1.man set SECTION=3
|
||||
if exist %MAN%\4\%1.man set SECTION=4
|
||||
if exist %MAN%\5\%1.man set SECTION=5
|
||||
|
||||
:open_page
|
||||
if not exist %MAN%\%SECTION%\%1.man echo No manual for %1
|
||||
if exist %MAN%\%SECTION%\%1.man cls
|
||||
if exist %MAN%\%SECTION%\%1.man %ED% %MAN%\%SECTION%\%1.man
|
||||
|
||||
:end
|
|
@ -1,13 +0,0 @@
|
|||
[]==============================[chkdsk.exe]===============================[]
|
||||
Author: Mark Russinovich
|
||||
Purpose: Disk checking tool
|
||||
Port on ROS: Emanuele Aliberti
|
||||
License: GPL
|
||||
|
||||
Usage: %s [drive:] [-F] [-V] [-R] [-C]\n\n\
|
||||
[drive:] Specifies the drive to check.\n\
|
||||
-F Fixes errors on the disk.\n\
|
||||
-V Displays the full path of every file on the disk.\n\
|
||||
-R Locates bad sectors and recovers readable information.\n\
|
||||
-C Checks the drive only if it is dirty.\n\n"
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[]===============================[chklib.exe]================================[]
|
||||
|
||||
Purpose: Check a Dynamic Link Library (DLL) for loading
|
||||
Author: Emanuele Aliberti
|
||||
License: GPL
|
||||
|
||||
Usage: chklib.exe module [symbol [, ...]]
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
[]=================================[format.com]==============================[]
|
||||
|
||||
Author: Mark Russinovich
|
||||
Purpose: Disk Format Utility
|
||||
Port on ROS: Emanuele Aliberti
|
||||
License: GPL
|
||||
|
||||
Usage: format.com drive: [-FS:file-system] [-V:label] [-Q] [-A:size] [-C]
|
||||
|
||||
[drive:] Specifies the drive to format.
|
||||
-FS:file-system Specifies the type of file system (e.g. FAT).
|
||||
-V:label Specifies volume label.
|
||||
-Q Performs a quick format.
|
||||
-A:size Overrides the default allocation unit size.
|
||||
Default settings are strongly recommended for general
|
||||
use NTFS supports 512, 1024, 2048, 4096, 8192, 16K,
|
||||
32K, 64K. FAT supports 8192, 16K, 32K, 64K, 128K, 256K.
|
||||
NTFS compression is not supported for allocation
|
||||
unit sizes above 4096.
|
||||
-C Files created on the new volume will be compressed by
|
||||
default.
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
[]=========================[ReactOS Man project]========================[]
|
||||
|
||||
Author: Semyon Novikov <tappak>
|
||||
Purpose: ReactOS manual browser and manual pages
|
||||
License: GPL
|
||||
|
||||
1. Built in cmd.exe commands
|
||||
2. Console utils
|
||||
3. GUI utils
|
||||
4. Developer tools
|
||||
5. Games & other
|
||||
|
||||
options: /e - open with editor
|
||||
/create - create new page
|
||||
|
||||
Usage: man [command] [section] [/e] [/create]
|
||||
Example: o man man
|
||||
o man man /e
|
||||
o man man 2
|
||||
o man quake3 5 /e /create
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[]==============================[ping.exe]=======================================[]
|
||||
|
||||
Ptoject: ReactOS ping utility
|
||||
Purpose: Network test utility
|
||||
Programmers: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||
|
||||
Usage: ping [-t] [-n count] [-l size] [-w timeout] destination-host\n\n
|
||||
-t Ping the specified host until stopped.
|
||||
To stop - type Control-C.
|
||||
-n count Number of echo requests to send.
|
||||
-l size Send buffer size.
|
||||
-w timeout Timeout in milliseconds to wait for each reply.
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[]=====================[ReactOS GUI task Manager]======================[]
|
||||
Author: Brian Palmer
|
||||
Purpose: ROS task manager
|
||||
License: GPL
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
.\" Process this file with
|
||||
.\" groff -man -Tascii foo.1
|
||||
.\"
|
||||
.TH FOO 1 "MARCH 1995" Linux "User Manuals"
|
||||
.SH NAME
|
||||
foo \- frobnicate the bar library
|
||||
.SH SYNOPSIS
|
||||
.B foo [-bar] [-c
|
||||
.I config-file
|
||||
.B ]
|
||||
.I file
|
||||
.B ...
|
||||
.SH DESCRIPTION
|
||||
.B foo
|
||||
frobnicates the bar library by tweaking internal
|
||||
symbol tables. By default it parses all baz segments
|
||||
and rearranges them in reverse order by time for the
|
||||
.BR xyzzy (1)
|
||||
linker to find them. The symdef entry is then compressed
|
||||
using the WBG (Whiz-Bang-Gizmo) algorithm.
|
||||
All files are processed in the order specified.
|
||||
.SH OPTIONS
|
||||
.IP -b
|
||||
Do not write 'busy' to stdout while processing.
|
||||
.IP "-c config-file"
|
||||
Use the alternate system wide
|
||||
.I config-file
|
||||
instead of
|
||||
.IR /etc/foo.conf .
|
||||
This overrides any
|
||||
.B FOOCONF
|
||||
environment variable.
|
||||
.IP -a
|
||||
In addition to the baz segments, also parse the
|
||||
blurfl headers.
|
||||
.IP -r
|
||||
Recursive mode. Operates as fast as lightning
|
||||
at the expense of a megabyte of virtual memory.
|
||||
.SH FILES
|
||||
.I /etc/foo.conf
|
||||
.RS
|
||||
The system wide configuration file. See
|
||||
.BR foo (5)
|
||||
for further details.
|
||||
.RE
|
||||
.I ~/.foorc
|
||||
.RS
|
||||
Per user configuration file. See
|
||||
.BR foo (5)
|
||||
for further details.
|
||||
.SH ENVIRONMENT
|
||||
.IP FOOCONF
|
||||
If non-null the full pathname for an alternate system wide
|
||||
.IR foo.conf .
|
||||
Overridden by the
|
||||
.B -c
|
||||
option.
|
||||
.SH DIAGNOSTICS
|
||||
The following diagnostics may be issued on stderr:
|
||||
|
||||
Bad magic number.
|
||||
.RS
|
||||
The input file does not look like an archive file.
|
||||
.RE
|
||||
Old style baz segments.
|
||||
.RS
|
||||
.B foo
|
||||
can only handle new style baz segments. COBOL
|
||||
object libraries are not supported in this version.
|
||||
.SH BUGS
|
||||
The command name should have been chosen more carefully
|
||||
to reflect its purpose.
|
||||
.SH AUTHOR
|
||||
Jens Schweikhardt <schweikh@noc.dfn.de>
|
||||
.SH "SEE ALSO"
|
||||
.BR bar (1),
|
||||
.BR foo (5),
|
||||
.BR xyzzy (1)
|
|
@ -1,100 +0,0 @@
|
|||
./" My first man page for ReactOS :)
|
||||
.TH ReactOS manual project 2004
|
||||
|
||||
.SH NAME
|
||||
man.exe - manual browser for ReactOS
|
||||
.SH SYNOPSIS
|
||||
.B man [
|
||||
.I manual page
|
||||
.B ]
|
||||
.SH DESCRIPTION
|
||||
This project is UNIX(tm) man compatible tool for ReactOS.
|
||||
.NL
|
||||
Manual browser support next tags:
|
||||
.NL
|
||||
.I ./"
|
||||
as comment tag
|
||||
.NL
|
||||
.I .NL
|
||||
as "new line" tag (ReactOS only)
|
||||
.NL
|
||||
.I .B
|
||||
as "bold" tag
|
||||
.NL
|
||||
.I .I
|
||||
as "italic" tag
|
||||
.NL
|
||||
.I .SH
|
||||
as part tag
|
||||
.NL
|
||||
.I .TH
|
||||
as page descriptor
|
||||
.NL
|
||||
.SH OPTIONS
|
||||
At this moment man support only
|
||||
.B "/?, /h, -h, --help"
|
||||
arguments :)
|
||||
.SH FILES
|
||||
Now all of manual pages must be in
|
||||
.B c:\man\
|
||||
directory. This is hack or
|
||||
bug, i don't know... We planed use ENVIRONMENT
|
||||
varrible to set manual path.
|
||||
.NL
|
||||
Manual files should have extension which marks section of his content.
|
||||
.NL
|
||||
.SH SECTIONS
|
||||
.B (1)
|
||||
basic commands. (dir,del,man,etc...)
|
||||
.NL
|
||||
.B (2)
|
||||
kernel calls
|
||||
.NL
|
||||
.B (3)
|
||||
calls from system librares
|
||||
.NL
|
||||
.B (4)
|
||||
device files or devices
|
||||
.NL
|
||||
.B (5)
|
||||
file syntax description
|
||||
.NL
|
||||
.B (6)
|
||||
games
|
||||
.NL
|
||||
.B (7)
|
||||
different information (such as licences, manifestos, etc...)
|
||||
.NL
|
||||
.B (8)
|
||||
administration tools (Admin or root only)
|
||||
.NL
|
||||
.B (9)
|
||||
additional kernel information
|
||||
.NL
|
||||
|
||||
.SH ENVIRONMENT
|
||||
Comming soon
|
||||
.SH BUGS
|
||||
Heh... A lot of. For example:
|
||||
.NL
|
||||
.I Scroll-bug
|
||||
man can't correctly scroll screen
|
||||
.NL
|
||||
.I .NL hack
|
||||
tag who absent in original man
|
||||
.NL
|
||||
.I ./" hack
|
||||
at the end of man file must be ./" tag
|
||||
.NL
|
||||
.I putchar() method
|
||||
all text displays with putchar() function.
|
||||
.NL
|
||||
And we have non correct word carry.
|
||||
|
||||
.SH AUTHOR
|
||||
Semyon <tappak> Novikov
|
||||
.NL
|
||||
.I <tappak@freemail.ru>
|
||||
.NL
|
||||
Sorry for my English. I'm just a Russian first-year student.
|
||||
./"
|
|
@ -1,7 +0,0 @@
|
|||
.B bold
|
||||
.I italic
|
||||
.SH section (BOLD string without /n)
|
||||
.TH at the end (page comment)
|
||||
.NL
|
||||
.\" comment
|
||||
|
Loading…
Reference in a new issue