#include <stdio.h>#include <errno.h>#include <string.h>#include <netinet/in.h>#include <sys/types.h>#include <sys/socket.h>#include <unistd.h>#include <time.h>#include <stdarg.h>#include <stdlib.h>#include <ekg/debug.h>#include <ekg/dynstuff.h>#include <ekg/log.h>#include <ekg/plugins.h>#include <ekg/strings.h>#include <ekg/stuff.h>#include <ekg/userlist.h>#include <ekg/vars.h>#include <ekg/windows.h>#include <ekg/xmalloc.h>Struktury danych | |
| struct | ncurses_window_t |
| struct | client_t |
Definicje | |
| #define | LOCALHOST "localhost" |
| #define | HTTPRCXAJAX_DEFPORT "8080" |
| #define | ISBOLD (att & FSTR_BOLD) |
| #define | ISBLINK (att & FSTR_BLINK) |
| #define | ISUNDERLINE (att & FSTR_UNDERLINE) |
| #define | ISREVERSE (att & FSTR_REVERSE) |
| #define | ISNORMAL (att & FSTR_NORMAL) |
| #define | ISONLYNORMAL ((att & FSTR_NORMAL) && !(att & (FSTR_BOLD|FSTR_BLINK|FSTR_REVERSE|FSTR_UNDERLINE))) |
| #define | FORE (att & FSTR_FOREMASK) |
| #define | BACK ((att & FSTR_BACKMASK)>>3) |
| #define | ADDJS(x) string_append(asc, x) |
| #define | ADDJSf(x...) string_append_format(asc, x) |
| #define | httprc_write(watch, args...) do { string_append_format(watch->buf, args); } while (0) |
| #define | httprc_write2(watch, str) do { string_append_n(watch->buf, str, -1); } while (0) |
| #define | httprc_write3(watch, str, len) do { string_append_raw(watch->buf, str, len); } while (0) |
| #define | HTTP_HEADER(ver, scode, eheaders) |
| #define | WATCH_FIND(w, fd) |
Wyliczenia | |
| enum | http_method_t { HTTP_METHOD_UNKNOWN = -1, HTTP_METHOD_OPTIONS = 0, HTTP_METHOD_GET, HTTP_METHOD_HEAD, HTTP_METHOD_POST, HTTP_METHOD_PUT, HTTP_METHOD_DELETE, HTTP_METHOD_TRACE, HTTP_METHOD_CONNECT } |
Funkcje | |
| PLUGIN_DEFINE (httprc_xajax, PLUGIN_UI, NULL) | |
| client_t * | find_client_by_cookie (list_t clients, char *cookie) |
| char * | generate_cookie (void) |
| char * | escape_single_quote (char *p, int inuni) |
| char * | http_fstring (int winid, char *parent, fstring_t *line, int inuni) |
| int | http_watch_send (int type, int fd, const char *watch, void *data) |
| int | httprc_xajax_def_action (void *data, va_list ap) |
| const char * | http_timestamp (time_t t) |
| int | http_watch_read (int type, int fd, watch_type_t watch, void *data) |
| int | http_watch_accept (int type, int fd, watch_type_t watch, void *data) |
| int | httprc_xajax_plugin_init (int prio) |
| static int | httprc_xajax_plugin_destroy () |
Zmienne | |
| list_t | clients = NULL |
| #define ADDJS | ( | x | ) | string_append(asc, x) |
| #define ADDJSf | ( | x... | ) | string_append_format(asc, x) |
| #define BACK ((att & FSTR_BACKMASK)>>3) |
| #define FORE (att & FSTR_FOREMASK) |
| #define HTTP_HEADER | ( | ver, | ||
| scode, | ||||
| eheaders | ||||
| ) |
httprc_write(send_watch, \ "%s %d %s\r\n" /* statusline: $PROTOCOL $SCODE $RESPONSE */\ "Server: ekg2-CVS-httprc_xajax plugin\r\n" /* server info */ \ "%s\r\n", /* headers */ \ ver == 0 ? "HTTP/1.0" : ver == 1 ? "HTTP/1.1" : "", /* PROTOCOL */ \ scode, /* Status code */ \ /* some typical responses */ \ scode == 100 ? "Continue" : \ scode == 101 ? "Switching Protocols" : \ scode == 200 ? "OK" : \ scode == 302 ? "Found" : \ "", \ eheaders ? eheaders : "\r\n" \ ); clen = (send_watch->buf ? send_watch->buf->len : 0) - clen;
| #define HTTPRCXAJAX_DEFPORT "8080" |
| #define ISBLINK (att & FSTR_BLINK) |
| #define ISBOLD (att & FSTR_BOLD) |
| #define ISNORMAL (att & FSTR_NORMAL) |
| #define ISONLYNORMAL ((att & FSTR_NORMAL) && !(att & (FSTR_BOLD|FSTR_BLINK|FSTR_REVERSE|FSTR_UNDERLINE))) |
| #define ISREVERSE (att & FSTR_REVERSE) |
| #define ISUNDERLINE (att & FSTR_UNDERLINE) |
| #define LOCALHOST "localhost" |
| #define WATCH_FIND | ( | w, | ||
| fd | ||||
| ) |
do { \ w = watch_find(&httprc_xajax_plugin, fd, WATCH_WRITE);\ if (!w) { \ w = watch_add_line(&httprc_xajax_plugin, fd, WATCH_WRITE_LINE, http_watch_send, NULL); \ } \ } while(0)
| enum http_method_t |
| char* escape_single_quote | ( | char * | p, | |
| int | inuni | |||
| ) |
| char* generate_cookie | ( | void | ) |
| char* http_fstring | ( | int | winid, | |
| char * | parent, | |||
| fstring_t * | line, | |||
| int | inuni | |||
| ) |
| const char* http_timestamp | ( | time_t | t | ) |
| int http_watch_accept | ( | int | type, | |
| int | fd, | |||
| watch_type_t | watch, | |||
| void * | data | |||
| ) |
| int http_watch_read | ( | int | type, | |
| int | fd, | |||
| watch_type_t | watch, | |||
| void * | data | |||
| ) |
| int http_watch_send | ( | int | type, | |
| int | fd, | |||
| const char * | watch, | |||
| void * | data | |||
| ) |
| int httprc_xajax_def_action | ( | void * | data, | |
| va_list | ap | |||
| ) |
| static int httprc_xajax_plugin_destroy | ( | ) | [static] |
| int httprc_xajax_plugin_init | ( | int | prio | ) |
| PLUGIN_DEFINE | ( | httprc_xajax | , | |
| PLUGIN_UI | , | |||
| NULL | ||||
| ) |
1.7.1