KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/ss/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/ss/ct_c.sed
#
# This script parses a command_table file into something which is a bit 
# easier for an awk script to understand.
#
# Input syntax: a .ct file
#
# Output syntax:
# (for the command_table line)
#	command_table  <command_table>
#
#(for each request definition)
#	BOR
#	sub: <subroutine name>
#	hlp: <help text>
#	cmd: <command>
#	opt: <option>
#	EOR
# (there may be more than one 'cmd' or 'opt' line
#
# A number sent to the output represents a parse error --- it will be 
# followed by the next line which will have the form:
#	ERROR: <error text>
#
# The design of this output syntax is such that it should be easy for
# an awk script to parse.

#
# The first section of this script is just to cannoicalize the file.  
# It removes comments, and puts each command_table request onto a single
# line
#
:FIRST
y/	/ /
s/^ *//
s/#.*$//
/; *$/!{
N
y/	/ /
s/\n */ /
bFIRST
}
s/, */, /g
#
# Now we take care of some syntatic sugar.....
#
/^unimplemented/ {
	s/^unimplemented [A-Za-z_0-9]*/request ss_unimplemented/
	s/;/, (dont_list, dont_summarize);/
}
/^unknown/ {
	s/^unknown /request ss_unknown, "", /
}
#
# Dispatch based on the keyword....  illegal keywords are prefixed by ERROR:
# and are handled by the awk script.
#
/^command_table /bCMD
/^request /bREQUEST
/^end;/bEND
s/ .*//
s/^/ERROR: unknown keyword: /
=
b
#
# Handle the command_table keyword
#
:CMD
s/;$//
p
d
b
#
# Handle the request keyword --- this is the heart of the sed script.
# 
:REQUEST
s/^request *//
h
i\
BOR
# First, parse out the subroutine name
s/^/sub: /
s/,.*//
p
# Next, parse out the help message, being careful to handle a quoted string
g
s/^[^,]*, *//
h
/^"/ {
	s/^"//
	s/".*//
	x
	s/^"[^"]*", *//
	x
	b EMITHLP
}
s/[^a-zA-Z0-9].*//
x
s/[a-zA-Z0-9]*, *//
x
:EMITHLP
s/^/hlp: /
p
# Next take care of the command names
:CMDLIST
g
/^(/b OPTIONS
/^;/b EOR
/^"/ {
	s/^"//
	s/".*//
	x
	s/^"[^"]*"//
	s/, *//
	x
	b EMITREQ
}
s/[^A-Za-z_0-9].*//
x
s/[A-Za-z_0-9]*//
s/, *//
x
:EMITREQ
s/^/cmd: /
p
b CMDLIST
#
# Here we parse the list of options.
#
: OPTIONS
g
s/^(//
h
: OPTLIST
/^)/ b EOR
/^[^A-Za-z_0-9]/ {
	=
	c\
ERROR: parse error in options list
}
s/[^A-Za-z_0-9].*//
x
s/[A-Za-z_0-9]*//
s/, *//
x
s/^/opt: /
p
g
b OPTLIST
: EOR
c\
EOR\

d
b
#
# Handle the end keyword --- it's basically ignored.
#
:END
d
b

Anon7 - 2021