PageRenderTime 51ms CodeModel.GetById 48ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/library/server/fcgi/implementation/fake/fcgi_imp.e

http://github.com/jocelyn/EiffelWebReloaded
Specman e | 104 lines | 70 code | 19 blank | 15 comment | 5 complexity | 3530e66d7ed016a317e322402f091c7f MD5 | raw file
  1note
  2	description: "Implementation for the FCGI_I interface"
  3	legal: "See notice at end of class."
  4	status: "See notice at end of class."
  5	date: "$Date$"
  6	revision: "$Revision$"
  7
  8class FCGI_IMP
  9
 10inherit
 11	FCGI_I
 12
 13feature -- Access
 14
 15	environ: POINTER
 16			-- Get the (char**) environ variable from the DLL.
 17		external
 18			"C inline use %"fcgi_stdio.h%""
 19		alias
 20			"return (char**) environ;"
 21		end
 22
 23feature -- FCGI connection
 24
 25	fcgi_listen: INTEGER
 26			-- Listen to the FCGI input stream
 27			-- Return 0 for successful calls, -1 otherwise.
 28		do
 29			-- Set state on first call to prevent looping indefinitely
 30			if fcgi_has_run then
 31				Result := -1
 32			else --if not is_interactive then
 33				fcgi_has_run := True
 34			end
 35		end
 36
 37	fcgi_has_run: BOOLEAN
 38			-- For emulation only; Has fcgi_listen been called?
 39
 40	fcgi_finish
 41			-- Finish current request from HTTP server started from
 42			-- the most recent call to `fcgi_accept'.
 43		do
 44		end
 45
 46	set_fcgi_exit_status (v: INTEGER)
 47		do
 48		end
 49
 50feature -- FCGI output
 51
 52	put_string (a_str: STRING)
 53			-- Put `a_str' on the FastCGI stdout.
 54		do
 55			io.put_string (a_str)
 56		end
 57
 58--	fcgi_printf (fmt: STRING; args: FINITE[ANY])
 59--			-- Put args, formatted per 'fmt' on the FastCGI stdout.
 60--		do
 61--			apf.printf (fmt, args)
 62--		end
 63
 64feature -- FCGI Input
 65
 66	read_from_stdin (n: INTEGER)
 67			-- Read up to n bytes from stdin and store in input buffer
 68		do
 69		end
 70
 71	copy_from_stdin (n: INTEGER; tf: FILE)
 72			-- Read up to n bytes from stdin and write to given file
 73		do
 74		end
 75
 76feature -- Status
 77
 78	buffer_contents: STRING
 79		do
 80			if attached private_input_buffer as buf then
 81				Result := buf
 82			else
 83				Result := ""
 84			end
 85		end
 86
 87	buffer_capacity: INTEGER
 88		do
 89			if attached private_input_buffer as bug then
 90				Result := buf.capacity
 91			end
 92		end
 93
 94note
 95	copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
 96	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
 97	source: "[
 98			Eiffel Software
 99			5949 Hollister Ave., Goleta, CA 93117 USA
100			Telephone 805-685-1006, Fax 805-685-6869
101			Website http://www.eiffel.com
102			Customer support http://support.eiffel.com
103		]"
104end