00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AEGET_HTTP_H
00022 #define AEGET_HTTP_H
00023
00024 #include <libaegis/change.h>
00025
00026 class nstring;
00027 struct project_ty;
00028 struct string_ty;
00029 class nstring;
00030 struct string_list_ty;
00031
00032 enum http_error_t
00033 {
00034 http_error_continue = 100,
00035 http_error_switching_protocols = 101,
00036 http_error_ok = 200,
00037 http_error_created = 201,
00038 http_error_accepted = 202,
00039 http_error_non_authoritative_information = 203,
00040 http_error_no_content = 204,
00041 http_error_reset_content = 205,
00042 http_error_partial_content = 206,
00043 http_error_multiple_choices = 300,
00044 http_error_moved_permanently = 301,
00045 http_error_moved_temporarily = 302,
00046 http_error_see_other = 303,
00047 http_error_not_modified = 304,
00048 http_error_use_proxy = 305,
00049 http_error_bad_request = 400,
00050 http_error_unauthorized = 401,
00051 http_error_payment_required = 402,
00052 http_error_forbidden = 403,
00053 http_error_not_found = 404,
00054 http_error_method_not_allowed = 405,
00055 http_error_not_acceptable = 406,
00056 http_error_proxy_authentication_required = 407,
00057 http_error_request_time_out = 408,
00058 http_error_conflict = 409,
00059 http_error_gone = 410,
00060 http_error_length_required = 411,
00061 http_error_precondition_failed = 412,
00062 http_error_request_entity_too_large = 413,
00063 http_error_request_url_too_large = 414,
00064 http_error_unsupported_media_type = 415,
00065 http_error_internal_server = 500,
00066 http_error_not_implemented = 501,
00067 http_error_bad_gateway = 502,
00068 http_error_out_of_resources = 503,
00069 http_error_gateway_time_out = 504,
00070 http_error_version_not_supported = 505,
00071 };
00072
00073 extern bool http_fatal_noerror;
00074
00075 void http_fatal(http_error_t oops, const char *fmt, ...) ATTR_PRINTF(2, 3);
00076 const char *http_getenv(const char *);
00077 void html_escape_string(string_ty *);
00078 void html_escape_string(const nstring &);
00079 void html_escape_charstar(const char *);
00080 void html_encode_string(string_ty *);
00081 void html_encode_string(const nstring &);
00082 void html_encode_charstar(const char *);
00083 void http_content_type_header(string_ty *);
00084
00091 void html_header(project_ty *, change::pointer);
00092
00097 void html_header_ps(project_ty *, change::pointer);
00098
00105 void html_footer(project_ty *, change::pointer);
00106
00112 void emit_change(change::pointer);
00113
00119 void emit_change_but1(change::pointer);
00120
00121 void
00122 emit_change_uuid_href(change::pointer, const nstring &, const nstring &,
00123 const nstring &);
00124
00130 const char *http_script_name(void);
00131
00136 void emit_project_href(project_ty *pp);
00137 void emit_project_href(project_ty *pp, const char *modifier, ...)
00138 ATTR_PRINTF(2, 3);
00139
00144 void emit_change_href(change::pointer cp, const char *modifier);
00145
00146
00151 void emit_change_href_n(project_ty *pp, long change_number,
00152 const char *modifier);
00153
00165 void emit_file_href(change::pointer cp, const nstring &filename,
00166 const char *modifier);
00167
00181 void emit_file_href(change::pointer cp, string_ty *filename,
00182 const char *modifier);
00183
00188 void emit_rect_image(int width, int height, const char *label, int hspace = -1);
00189
00194 void emit_rect_image_rgb(int width, int height, const char *color,
00195 int hspace = -1);
00196
00208 bool modifier_test(string_list_ty *modifiers, const char *name);
00209
00222 bool modifier_test_and_clear(string_list_ty *modifiers, const char *name);
00223
00232 void emit_rss_icon_with_link(project_ty *pp, const nstring &rss_filename);
00233
00242 void emit_rss_meta_data(project_ty *pp, const nstring &rss_filename);
00243
00244 #define HISTOGRAM_HEIGHT 12
00245 #define HISTOGRAM_WIDTH 120
00246
00247 #endif // AEGET_HTTP_H