1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

things that happened in 2008

This commit is contained in:
psyc://psyced.org/~lynX 2009-01-26 21:12:53 +01:00
parent 8f98522570
commit 94530cc322
136 changed files with 3222 additions and 2873 deletions

View file

@ -1,4 +1,4 @@
// $Id: auto.h,v 1.14 2007/09/07 09:07:32 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: auto.h,v 1.15 2008/04/18 13:34:39 lynx Exp $ // vim:syntax=lpc:ts=8
#define _INCLUDE_AUTO_H
// first identify the driver
@ -47,8 +47,3 @@
// more useful perlisms
#define chop(STRING) slice_from_end(STRING, 0, 2)
#define chomp(STRING) (char_from_end(STRING, 1) == '\n' ? chop(STRING) : STRING)
// extracts hh:mm:ss format from ctime output
#define hhmmss(CTIME) CTIME[11..18]
// extracts hh:mm format from ctime output (for idle times)
#define hhmm(CTIME) CTIME[11..15]

View file

@ -1,4 +1,4 @@
// $Id: http.h,v 1.6 2008/04/09 08:29:37 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: http.h,v 1.7 2008/04/22 22:43:56 lynx Exp $ // vim:syntax=lpc:ts=8
/*
* NAME: http.h
* DESCRIPTION: macros for HTTP
@ -38,4 +38,10 @@
# define hthead(TITLE) "<title>" CHATNAME " - "+( TITLE )+"</title>"
#endif
// local debug messages - turn them on by using psyclpc -DDhttp=<level>
#ifdef Dhttp
# undef DEBUG
# define DEBUG Dhttp
#endif
#endif

View file

@ -1,4 +1,4 @@
// $Id: net.h,v 1.142 2008/04/11 18:48:26 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: net.h,v 1.148 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
#ifndef _INCLUDE_NET_H
#define _INCLUDE_NET_H
@ -36,6 +36,41 @@
# endif
#endif
// switching to UTF-8 should work now (if you keep .fmt files disabled!)
#ifndef SYSTEM_CHARSET
# define SYSTEM_CHARSET "UTF-8"
//define SYSTEM_CHARSET "ISO-8859-15"
#endif
#if defined(SYSTEM_CHARSET) && SYSTEM_CHARSET != "UTF-8"
# define TO_UTF8(s) convert_charset((s), SYSTEM_CHARSET, "UTF-8")
# define FROM_UTF8(s) convert_charset((s), "UTF-8", SYSTEM_CHARSET)
#else
# define TO_UTF8(s) (s)
# define FROM_UTF8(s) (s)
#endif
// this stuff is so popular.. can i really put it anywhere else?
#ifndef DEFAULT_CONTENT_TYPE
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
#endif
#if __EFUN_DEFINED__(stringprep)
// stringprep needs utf8 arguments
// this results in lots of conversions some of which look like
// system->utf­>system->utf. luckily UTF8 is our system charset.
// so FROM_UTF8 and TO_UTF8 are normally nullmacros (see above)
# include <idn.h>
// beware, these macros dont have error handling...
# define NODEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_NODEPREP))
# define NAMEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
# define RESOURCEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
#else
# define NODEPREP(s) lower_case(s)
# define NAMEPREP(s) lower_case(s)
# define RESOURCEPREP(s) (s)
#endif
#include "debug.h"
#ifdef PRO_PATH
@ -88,44 +123,10 @@
# else
# define HTTPS_URL 0 // so that you can do
// ((tls_available() && HTTPS_URL) || HTTP_URL)
// ... what about ifdef __TLS__ ?
# endif
#endif
// switching to UTF-8 should work now (if you keep .fmt files disabled!)
#ifndef SYSTEM_CHARSET
# define SYSTEM_CHARSET "UTF-8"
//define SYSTEM_CHARSET "ISO-8859-15"
#endif
#if defined(SYSTEM_CHARSET) && SYSTEM_CHARSET != "UTF-8"
# define TO_UTF8(s) convert_charset((s), SYSTEM_CHARSET, "UTF-8")
# define FROM_UTF8(s) convert_charset((s), "UTF-8", SYSTEM_CHARSET)
#else
# define TO_UTF8(s) (s)
# define FROM_UTF8(s) (s)
#endif
// this stuff is so popular.. can i really put it anywhere else?
#ifndef DEFAULT_CONTENT_TYPE
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
#endif
#if __EFUN_DEFINED__(stringprep)
// stringprep needs utf8 arguments
// this results in lots of conversions some of which look like
// system->utf­>system->utf. luckily UTF8 is our system charset.
// so FROM_UTF8 and TO_UTF8 are normally nullmacros (see above)
# include <idn.h>
// beware, these macros dont have error handling...
# define NODEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_NODEPREP))
# define NAMEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
# define RESOURCEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
#else
# define NODEPREP(s) lower_case(s)
# define NAMEPREP(s) lower_case(s)
# define RESOURCEPREP(s) (s)
#endif
#ifdef MUD
# define NO_NEWBIES
#endif
@ -142,6 +143,10 @@
# define DEFAULT_USER_OBJECT PSYC_PATH "user"
#endif
#ifndef MAX_VISIBLE_USERS
# define MAX_VISIBLE_USERS 44
#endif
#ifndef PRO_PATH
// very specific to the way we do web applications
# define htok this_interactive()->http_ok
@ -196,18 +201,18 @@
// wir können viel herumphilosophieren was richtig wäre, aber tatsächlich
// effizienter verteilen werden wir auf kurze sicht eh nicht, so lets use this:
# define SMART_UNICAST_FRIENDS
# define NOT_EXPERIMENTAL // code that was experimental just until recently
# define SIGS
# define SWITCH2PSYC
# define WANT_S2S_TLS
# define WANT_S2S_SASL
# define TRUSTINESS
# define ENTER_MEMBERS
# define PERSISTENT_MASTERS
# define NEW_LINK
# define NEW_UNLINK
# define NEW_RENDER
# define MUCSUC
#endif
#define GAMMA // code that has left BETA and is in production use
#ifndef _flag_disable_log_hosts
# define _flag_log_hosts
@ -217,7 +222,6 @@
// fippo's brilliant single-user channel emulation for jabber MUCs
// unfortunately it provides no advantages over the old method, yet.
// would be cool to cache a member list at least! TODO
# define MUCSUC
# define PERSISTENT_SLAVES
// efine IRC_FRIENDCHANNEL // hopelessly needs more work
# ifdef HTTP_PATH
@ -240,6 +244,6 @@
#endif
// still using rawp anywhere?
#define rawp(TEXT) { P1(("rawp? "+TEXT)) emit(TEXT); }
//#define rawp(TEXT) { P1(("rawp? "+TEXT)) emit(TEXT); }
#endif

View file

@ -1,4 +1,4 @@
// $Id: person.h,v 1.27 2007/09/18 09:49:17 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: person.h,v 1.29 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
//
#ifndef _INCLUDE_PERSON_H
#define _INCLUDE_PERSON_H
@ -15,7 +15,7 @@
#define FRIEND_NICK 0
#define FRIEND_AVAILABILITY 1
#if !defined(VOLATILE) && !defined(RELAY)
#if !defined(VOLATILE) && !defined(RELAY) && !defined(_flag_disable_module_nickspace)
# define ALIASES
#endif
@ -57,6 +57,15 @@
t = time() - v("aliveTime");\
t = t < 30 ? 0 : t < 300 ? 300 : (t + random(200) - 100);
// used by myLogAppend below:
#ifndef _limit_amount_log
# define _limit_amount_log 777
#endif
#ifndef _limit_amount_log_persistent
# define _limit_amount_log_persistent 100
#endif
// should "new" become part of the lastlog.c mechanism? how?
// should we simply use timestamp of last logout? that works
// better with places for history-while-i-was-away too. TODO

View file

@ -1,5 +1,5 @@
// vim:noexpandtab:syntax=lpc
// $Id: place.gen,v 1.135 2008/04/16 16:59:41 lynx Exp $
// $Id: place.gen,v 1.137 2008/09/12 15:37:39 lynx Exp $
//
// documentation on http://about.psyc.eu/Create_Place
//
@ -56,8 +56,8 @@
# ifdef NAME
# define REDIRECT CONNECT
# ifndef CONNECT
# ifdef SERVER_URL
# define CONNECT SERVER_URL "@" NAME
# ifdef _uniform_node
# define CONNECT _uniform_node "@" NAME
# else
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
# endif
@ -72,8 +72,8 @@
#ifdef SLAVE
# ifndef CONNECT
# ifdef NAME
# ifdef SERVER_URL
# define CONNECT SERVER_URL "@" NAME
# ifdef _uniform_node
# define CONNECT _uniform_node "@" NAME
# else
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
# endif
@ -311,11 +311,11 @@ void create() {
P1(("PLACE %O MASTER\n", ME))
# endif
# endif
# ifdef SERVER_URL
# if CONNECT == SERVER_URL
D1(D("link [" CONNECT "] == host ["+ SERVER_URL +"]\n");)
# ifdef _uniform_node
# if CONNECT == _uniform_node
D1(D("link [" CONNECT "] == host ["+ _uniform_node +"]\n");)
# else
D1(D("link [" CONNECT "] != host ["+ SERVER_URL +"]\n");)
D1(D("link [" CONNECT "] != host ["+ _uniform_node +"]\n");)
# endif
# endif
#endif
@ -559,6 +559,11 @@ msg(source, mc, data, vars) {
# ifdef ON_ANY
ON_ANY
# endif
# ifdef ON_CONVERSE
if (abbrev("_message", mc)) {
ON_CONVERSE
}
# endif
# ifdef REDIRECT
sendmsg(source, "_failure_redirect_temporary",
"[_nick_place] is currently unable to fulfil this operation. Please direct your request to [_source_redirect]",
@ -574,11 +579,6 @@ msg(source, mc, data, vars) {
return 0;
# else
::msg(source, mc, data, vars);
# ifdef ON_CONVERSE
if (abbrev("_message", mc)) {
ON_CONVERSE
}
# endif
# endif
}
#endif

View file

@ -1,7 +1,8 @@
// $Id: presence.h,v 1.9 2007/07/25 09:57:32 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: presence.h,v 1.11 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
//
#ifndef _INCLUDE_PRESENCE_H
#define _INCLUDE_PRESENCE_H
#ifndef _flag_disable_module_presence
// similar to what is defined as "availability"
// in http://www.psyc.eu/presence
@ -22,10 +23,12 @@
#define AVAILABILITY_REALTIME 9 // as yet unused, name?
// more unused stuff from http://www.psyc.eu/presence
// see also english wording currently in net/library/share.c
#define MOOD_JUCHEI 8
#define MOOD_BASSTSCHO 6
#define MOOD_NAJA 4
#define MOOD_LEXTSMIAMOARSCHI 2
// see also english wording currently in net/library/share.c
#define MOOD_UNSPECIFIED 0
#endif // _flag_disable_module_presence
#endif

View file

@ -1,4 +1,4 @@
// $Id: proto.h,v 1.20 2007/09/30 17:06:11 lynx Exp $ // vim:syntax=lpc:ts=8
// $Id: proto.h,v 1.22 2008/05/07 10:50:29 lynx Exp $ // vim:syntax=lpc:ts=8
//
// sometimes prototypes are needed. i keep them here and include
// them also in the files that *define* the function so that the
@ -14,7 +14,9 @@
void dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
void dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
#endif
#ifndef hex2int
int hex2int(string hex);
#endif
varargs string isotime(mixed ctim, int long);
int legal_host(string ip, int port, string scheme, int udpflag);
#ifdef varargs
@ -37,9 +39,11 @@ string timedelta(int secs);
#else
// danny, do you really need this?
void _psyc_dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
void _psyc_dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
#ifndef hex2int
int _psyc_hex2int(string hex);
#endif
int _psyc_legal_host(string ip, int port, string scheme, int udpflag);
#ifdef varargs
void _psyc_log_file(string file,string str,
@ -47,11 +51,16 @@ void _psyc_log_file(string file,string str,
#else
void _psyc_log_file(string file, string str, varargs array(mixed) args);
#endif
string _psyc_make_json(mixed d);
void _psyc_monitor_report(string mc, string text);
object* _psyc_objects_people();
varargs string _psyc_psyc_name(mixed source, vastring localpart);
string _psyc_query_server_unl();
varargs mixed _psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
mixed source, int showingLog, closure callback, varargs array(mixed) extra);
varargs void _psyc_shout(mixed who, string what, string text, mapping vars);
varargs int _psyc_server_shutdown(string reason, int restart, int pass);
string _psyc_timedelta(int secs);
#endif

View file

@ -48,7 +48,18 @@
// here are the macros to implement method inheritance in a loop around
// a switch (see http://about.psyc.eu/Inheritance and "try and slice")
#ifdef EXPERIMENTAL
// changes for try/slice are so profound in some parts, that running with it
// disabled is actually more "experimental" and flaky. PSYC_TRY() is also
// used for varnames in spyc/dispatch.i, so it's not just the methods here.
#ifndef _flag_disable_inheritance_method
# if DEBUG > 1
# define PSYC_SLICE_DEBUG \
log_file("SLICE", "%s:%O slicing %O in %O\n", \
__FILE__, __LINE__, family, ME);
# else
# define PSYC_SLICE_DEBUG
# endif
# define PSYC_TRY(mc) \
family = mc; \
while (family) { \
@ -57,8 +68,7 @@
# define PSYC_SLICE_AND_REPEAT \
default: \
log_file("SLICE", "%s:%O slicing %O in %O\n", \
__FILE__, __LINE__, family, ME); \
PSYC_SLICE_DEBUG \
glyph = rmember(family, C_GLYPH_SEPARATOR_KEYWORD); \
if (glyph > 1) family = family[.. glyph-1]; \
else family = 0; \
@ -66,7 +76,6 @@
if (glyph == -4) family = 0; // got here by break;
#else
// this disables method inheritance
# define PSYC_TRY(mc) switch(mc)
# define PSYC_SLICE_AND_REPEAT
#endif

View file

@ -21,6 +21,7 @@
#define HTTPS_SERVICE 443 // http over TLS/SSL
#define SMTPS_SERVICE 465
#define NNTPS_SERVICE 563 // nntp over TLS/SSL
#define FLASHPOL_SERVICE 843 // flash crossdomain policy server
#define TELNETS_SERVICE 992
#define IRCS_SERVICE 994 // irc protocol over TLS/SSL
#define POP3S_SERVICE 995

View file

@ -6,7 +6,6 @@
virtual inherit NET_PATH "textc";
#endif
// #ifndef DEBUG
#if 1
# define T(mc, fmt) \

View file

@ -23,4 +23,5 @@
// (not provided by parse_uniform)
#define USize 15
#define UName(uniform) (uniform[UUser] || uniform[UResource][1 ..])
#endif