/library/server/fcgi/implementation/linux/fcgi_c_api.e
http://github.com/jocelyn/EiffelWebReloaded · Specman e · 97 lines · 74 code · 12 blank · 11 comment · 2 complexity · 4e09ddc1d00db8a6530cb24e936dd0ae MD5 · raw file
- note
- description: "Wrappers around FastCGI C API."
- legal: "See notice at end of class."
- status: "See notice at end of class."
- date: "$Date$"
- revision: "$Revision$"
- class
- FCGI_C_API
- feature -- Connection
- accept: INTEGER
- -- Accept a Fast CGI connection.
- -- Return 0 for successful calls, -1 otherwise.
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "return FCGI_Accept();"
- end
- environ: POINTER
- -- Get the (char**) environ variable from the DLL.
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "return (char**) environ;"
- end
- finish
- -- Finished current request from HTTP server started from
- -- the most recent call to `fcgi_accept'.
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "FCGI_Finish();"
- end
- set_exit_status (v: INTEGER)
- -- Set the exit status for the most recent request
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "FCGI_SetExitStatus($v);"
- end
- feature -- Input
- read_content_into (a_buffer: POINTER; a_length: INTEGER): INTEGER
- -- Read content stream into `a_buffer' but no more than `a_length' character.
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "[
- {
- size_t n;
- if (! FCGI_feof(FCGI_stdin)) {
- n = FCGI_fread($a_buffer, 1, $a_length, FCGI_stdin);
- } else {
- n = 0;
- }
- return n;
- }
- ]"
- end
- gets (s: POINTER): POINTER
- -- gets() reads a line from stdin into the buffer pointed to
- -- by s until either a terminating newline or EOF, which it
- -- replaces with '\0'
- -- No check for buffer overrun is performed
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "return FCGI_gets($s);"
- end
- feature -- Output
- put_string (v: POINTER; n: INTEGER)
- external
- "C inline use %"fcgi_stdio.h%""
- alias
- "FCGI_fwrite($v, 1, $n, FCGI_stdout);"
- end
- note
- copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
- license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
- source: "[
- Eiffel Software
- 5949 Hollister Ave., Goleta, CA 93117 USA
- Telephone 805-685-1006, Fax 805-685-6869
- Website http://www.eiffel.com
- Customer support http://support.eiffel.com
- ]"
- end