ekg2  GIT master
Struktury danych | Definicje | Wyliczenia | Funkcje | Zmienne
Dokumentacja pliku httprc_xajax.c
#include "ekg2.h"
#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>
Wykres zależności załączania dla httprc_xajax.c:

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

static int httprc_xajax_plugin_destroy ()
 
client_tfind_client_by_cookie (list_t clients, char *cookie)
 
char * generate_cookie (void)
 
char * escape_single_quote (char *p)
 
char * http_fstring (int winid, char *parent, const fstring_t *line)
 
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)
 

Zmienne

plugin_t httprc_xajax_plugin = { .name = "httprc_xajax", .pclass = PLUGIN_UI , .destroy = httprc_xajax_plugin_destroy, .theme_init = NULL }
 
list_t clients = NULL
 

Dokumentacja definicji

◆ ADDJS

#define ADDJS (   x)    string_append(asc, x)

◆ ADDJSf

#define ADDJSf (   x...)    string_append_format(asc, x)

◆ BACK

#define BACK   ((att & FSTR_BACKMASK)>>3)

◆ FORE

#define FORE   (att & FSTR_FOREMASK)

◆ HTTP_HEADER

#define HTTP_HEADER (   ver,
  scode,
  eheaders 
)
Wartość:
httprc_write(send_watch, \
"%s %d %s\r\n" /* statusline: $PROTOCOL $SCODE $RESPONSE */\
"Server: ekg2-GIT-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 httprc_write(watch, args...)
Definition: httprc_xajax.c:180

◆ httprc_write

#define httprc_write (   watch,
  args... 
)    do { string_append_format(watch->buf, args); } while (0)

◆ httprc_write2

#define httprc_write2 (   watch,
  str 
)    do { string_append_n(watch->buf, str, -1); } while (0)

◆ httprc_write3

#define httprc_write3 (   watch,
  str,
  len 
)    do { string_append_raw(watch->buf, str, len); } while (0)

◆ HTTPRCXAJAX_DEFPORT

#define HTTPRCXAJAX_DEFPORT   "8080"

◆ ISBLINK

#define ISBLINK   (att & FSTR_BLINK)

◆ ISBOLD

#define ISBOLD   (att & FSTR_BOLD)

◆ ISNORMAL

#define ISNORMAL   (att & FSTR_NORMAL)

◆ ISONLYNORMAL

#define ISONLYNORMAL   ((att & FSTR_NORMAL) && !(att & (FSTR_BOLD|FSTR_BLINK|FSTR_REVERSE|FSTR_UNDERLINE)))

◆ ISREVERSE

#define ISREVERSE   (att & FSTR_REVERSE)

◆ ISUNDERLINE

#define ISUNDERLINE   (att & FSTR_UNDERLINE)

◆ LOCALHOST

#define LOCALHOST   "localhost"

◆ WATCH_FIND

#define WATCH_FIND (   w,
  fd 
)
Wartość:
do { \
if (!w) { \
} \
} while(0)
int http_watch_send(int type, int fd, const char *watch, void *data)
Definition: httprc_xajax.c:208
#define NULL
Definition: oralog.c:49
Definition: sources.h:66
plugin_t httprc_xajax_plugin
Definition: httprc_xajax.c:43
watch_t * watch_find(plugin_t *plugin, int fd, watch_type_t type)
Definition: sources.c:1187
#define watch_add_line(p, fd, type, handler, data)
Definition: sources.h:119
Definition: sources.h:63

Dokumentacja typów wyliczanych

◆ http_method_t

Wartości wyliczeń
HTTP_METHOD_UNKNOWN 
HTTP_METHOD_OPTIONS 
HTTP_METHOD_GET 
HTTP_METHOD_HEAD 
HTTP_METHOD_POST 
HTTP_METHOD_PUT 
HTTP_METHOD_DELETE 
HTTP_METHOD_TRACE 
HTTP_METHOD_CONNECT 

Dokumentacja funkcji

◆ escape_single_quote()

char* escape_single_quote ( char *  p)

◆ find_client_by_cookie()

client_t* find_client_by_cookie ( list_t  clients,
char *  cookie 
)

◆ generate_cookie()

char* generate_cookie ( void  )

◆ http_fstring()

char* http_fstring ( int  winid,
char *  parent,
const fstring_t line 
)

◆ http_timestamp()

const char* http_timestamp ( time_t  t)

◆ http_watch_accept()

int http_watch_accept ( int  type,
int  fd,
watch_type_t  watch,
void *  data 
)

◆ http_watch_read()

int http_watch_read ( int  type,
int  fd,
watch_type_t  watch,
void *  data 
)

◆ http_watch_send()

int http_watch_send ( int  type,
int  fd,
const char *  watch,
void *  data 
)

◆ httprc_xajax_def_action()

int httprc_xajax_def_action ( void *  data,
va_list  ap 
)

◆ httprc_xajax_plugin_destroy()

static int httprc_xajax_plugin_destroy ( )
static

◆ httprc_xajax_plugin_init()

int httprc_xajax_plugin_init ( int  prio)

Dokumentacja zmiennych

◆ clients

list_t clients = NULL

◆ httprc_xajax_plugin

plugin_t httprc_xajax_plugin = { .name = "httprc_xajax", .pclass = PLUGIN_UI , .destroy = httprc_xajax_plugin_destroy, .theme_init = NULL }