mirror of
https://github.com/bdnugget/kcgi.git
synced 2026-11-07 05:47:27 +00:00
Add kcgi_strerror(3).
This commit is contained in:
1 parent
533058cda1
commit
c926852dd4
4 files changed
+68
No files matched your search
@@ -288,6 +288,26 @@ const char *const ksuffixes[KMIME__MAX] = {
|
||||
"xml", /* KMIME_TEXT_XML */
|
||||
};
|
||||
|
||||
const char *const kerrors[] = {
|
||||
"success", /* KCGI_OK */
|
||||
"cannot allocate memory", /* KCGI_ENOMEM */
|
||||
"FastCGI exit", /* KCGI_EXIT */
|
||||
"end-point connection closed", /* KCGI_HUP */
|
||||
"too many open sockets", /* KCGI_ENFILE */
|
||||
"failed to fork child", /* KCGI_EAGAIN */
|
||||
"internal error", /* KCGI_FORM */
|
||||
"system error", /* KCGI_SYSTEM */
|
||||
};
|
||||
|
||||
const char *
|
||||
kcgi_strerror(enum kcgi_err er)
|
||||
{
|
||||
|
||||
assert(er <= KCGI_SYSTEM);
|
||||
assert(er >= KCGI_OK);
|
||||
return(kerrors[er]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Safe strdup(): don't return on exhaustion.
|
||||
*/
|
||||
|
||||
@@ -510,6 +510,8 @@ struct ktemplatex {
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
const char *kcgi_strerror(enum kcgi_err);
|
||||
|
||||
enum kcgi_err khttp_body(struct kreq *);
|
||||
enum kcgi_err khttp_body_compress(struct kreq *, int);
|
||||
void khttp_free(struct kreq *);
|
||||
|
||||
@@ -303,6 +303,9 @@ string) for the full HTTP message body.
|
||||
.Xr kcgijson 3 ,
|
||||
.Xr kcgiregress 3 ,
|
||||
.Xr kcgixml 3 ,
|
||||
.Xr kcgi_buf_write 3 ,
|
||||
.Xr kcgi_strerror 3 ,
|
||||
.Xr kcgi_writer_disable 3 ,
|
||||
.Xr khttp_body 3 ,
|
||||
.Xr khttp_fcgi_free 3 ,
|
||||
.Xr khttp_fcgi_init 3 ,
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (c) 2018 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
.\" copyright notice and this permission notice appear in all copies.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate$
|
||||
.Dt KCGI_STRERROR 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm kcgi_strerror
|
||||
.Nd get kcgi error message string
|
||||
.Sh LIBRARY
|
||||
.Lb libkcgi
|
||||
.Sh SYNOPSIS
|
||||
.In sys/types.h
|
||||
.In stdarg.h
|
||||
.In stdint.h
|
||||
.In kcgi.h
|
||||
.Ft const char *
|
||||
.Fo kcgi_strerror
|
||||
.Fa "enum kcgi_err er"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn kcgi_strerror
|
||||
function provides a English-language string representation of
|
||||
.Fa er .
|
||||
The string should not be modified in any way.
|
||||
This function can be called at any time.
|
||||
.Sh AUTHORS
|
||||
This function was written by
|
||||
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
|
||||
Reference in new issue
Block a user