Updated libfcgi source code for Windows AND Linux.
Cleaning some code and feature clauses.
This commit is contained in:
@@ -64,6 +64,18 @@ feature -- Input
|
|||||||
]"
|
]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature {FCGI_IMP} -- Internal
|
||||||
|
|
||||||
|
feof (v: POINTER): INTEGER
|
||||||
|
-- FCGI_feof()
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_feof"
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Input
|
||||||
|
|
||||||
gets (s: POINTER): POINTER
|
gets (s: POINTER): POINTER
|
||||||
-- gets() reads a line from stdin into the buffer pointed to
|
-- gets() reads a line from stdin into the buffer pointed to
|
||||||
-- by s until either a terminating newline or EOF, which it
|
-- by s until either a terminating newline or EOF, which it
|
||||||
@@ -84,6 +96,24 @@ feature -- Output
|
|||||||
"FCGI_fwrite($v, 1, $n, FCGI_stdout);"
|
"FCGI_fwrite($v, 1, $n, FCGI_stdout);"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
stdout: POINTER
|
||||||
|
-- FCGI_stdout() return pointer on output FCGI_FILE
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_stdout"
|
||||||
|
end
|
||||||
|
|
||||||
|
stdin: POINTER
|
||||||
|
-- FCGI_stdin() return pointer on input FCGI_FILE
|
||||||
|
external
|
||||||
|
"C inline use %"fcgi_stdio.h%""
|
||||||
|
alias
|
||||||
|
"FCGI_stdin"
|
||||||
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ feature -- Access
|
|||||||
Result := fcgi.environ
|
Result := fcgi.environ
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fcgi_end_of_input: BOOLEAN
|
||||||
|
do
|
||||||
|
Result := fcgi.feof (fcgi.stdin) = 0
|
||||||
|
end
|
||||||
|
|
||||||
feature -- FCGI Connection
|
feature -- FCGI Connection
|
||||||
|
|
||||||
fcgi_listen: INTEGER
|
fcgi_listen: INTEGER
|
||||||
@@ -72,15 +77,6 @@ feature -- FCGI output
|
|||||||
{FCGI_C_API}.put_string (l_c_str.item, l_c_str.count)
|
{FCGI_C_API}.put_string (l_c_str.item, l_c_str.count)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fcgi_printf (fmt: STRING; args: FINITE[ANY])
|
|
||||||
-- -- Put args, formatted per 'fmt' on the FastCGI stdout.
|
|
||||||
-- local
|
|
||||||
-- l_c_str: C_STRING
|
|
||||||
-- do
|
|
||||||
-- create l_c_str.make (apf.aprintf (fmt, args))
|
|
||||||
-- {FCGI_C_API}.put_string (l_c_str.item, l_c_str.count)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
feature -- FCGI Input
|
feature -- FCGI Input
|
||||||
|
|
||||||
copy_from_stdin (n: INTEGER; tf: FILE)
|
copy_from_stdin (n: INTEGER; tf: FILE)
|
||||||
@@ -90,15 +86,12 @@ feature -- FCGI Input
|
|||||||
num, readsize, writecount: INTEGER
|
num, readsize, writecount: INTEGER
|
||||||
done: BOOLEAN
|
done: BOOLEAN
|
||||||
do
|
do
|
||||||
--put_trace ("copy_from_stdin, n=" +n.out)
|
|
||||||
readsize := n.min (K_input_bufsize)
|
readsize := n.min (K_input_bufsize)
|
||||||
--put_trace ("copy_from_stdin, readsize=" +readsize.out)
|
|
||||||
l_c_str := c_buffer
|
l_c_str := c_buffer
|
||||||
from
|
from
|
||||||
until done or writecount >= n
|
until done or writecount >= n
|
||||||
loop
|
loop
|
||||||
num := {FCGI_C_API}.read_content_into (l_c_str.item, readsize)
|
num := {FCGI_C_API}.read_content_into (l_c_str.item, readsize)
|
||||||
--put_trace ("copy_from_stdin, num=" +num.out)
|
|
||||||
if num = 0 then
|
if num = 0 then
|
||||||
-- EOF
|
-- EOF
|
||||||
done := True
|
done := True
|
||||||
|
|||||||
@@ -46,22 +46,6 @@ feature -- Connections
|
|||||||
|
|
||||||
feature -- Input
|
feature -- Input
|
||||||
|
|
||||||
fread (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
|
||||||
-- FCGI_fread() read from input `fp' and put into `v'
|
|
||||||
external
|
|
||||||
"dll libfcgi.dll signature (EIF_POINTER, EIF_INTEGER, EIF_INTEGER, EIF_POINTER): EIF_INTEGER use fcgi_stdio.h "
|
|
||||||
alias
|
|
||||||
"FCGI_fread"
|
|
||||||
end
|
|
||||||
|
|
||||||
feof (v: POINTER): INTEGER
|
|
||||||
-- FCGI_feof()
|
|
||||||
external
|
|
||||||
"dll libfcgi.dll signature (EIF_POINTER): EIF_INTEGER use fcgi_stdio.h "
|
|
||||||
alias
|
|
||||||
"FCGI_feof"
|
|
||||||
end
|
|
||||||
|
|
||||||
read_content_into (a_buffer: POINTER; a_length: INTEGER): INTEGER
|
read_content_into (a_buffer: POINTER; a_length: INTEGER): INTEGER
|
||||||
-- Read content stream into `a_buffer' but no more than `a_length' character.
|
-- Read content stream into `a_buffer' but no more than `a_length' character.
|
||||||
local
|
local
|
||||||
@@ -77,6 +61,26 @@ feature -- Input
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature {FCGI_IMP} -- Internal
|
||||||
|
|
||||||
|
feof (v: POINTER): INTEGER
|
||||||
|
-- FCGI_feof()
|
||||||
|
external
|
||||||
|
"dll libfcgi.dll signature (EIF_POINTER): EIF_INTEGER use fcgi_stdio.h "
|
||||||
|
alias
|
||||||
|
"FCGI_feof"
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Input
|
||||||
|
|
||||||
|
fread (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
||||||
|
-- FCGI_fread() read from input `fp' and put into `v'
|
||||||
|
external
|
||||||
|
"dll libfcgi.dll signature (EIF_POINTER, EIF_INTEGER, EIF_INTEGER, EIF_POINTER): EIF_INTEGER use fcgi_stdio.h "
|
||||||
|
alias
|
||||||
|
"FCGI_fread"
|
||||||
|
end
|
||||||
|
|
||||||
gets (s: POINTER): POINTER
|
gets (s: POINTER): POINTER
|
||||||
-- gets() reads a line from stdin into the buffer pointed to
|
-- gets() reads a line from stdin into the buffer pointed to
|
||||||
-- by `s' until either a terminating newline or EOF, which it
|
-- by `s' until either a terminating newline or EOF, which it
|
||||||
@@ -97,6 +101,8 @@ feature -- Output
|
|||||||
i := fwrite (v, 1, n, stdout)
|
i := fwrite (v, 1, n, stdout)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Output
|
||||||
|
|
||||||
fwrite (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
fwrite (v: POINTER; a_size: INTEGER; n: INTEGER; fp: POINTER): INTEGER
|
||||||
-- FCGI_fwrite() ouput `v' to `fp'
|
-- FCGI_fwrite() ouput `v' to `fp'
|
||||||
external
|
external
|
||||||
|
|||||||
Reference in New Issue
Block a user