perlvariables - iteration N

Later commits reworked a lot of this, but the use of GValue over void*
was kept.
Start of perlvariables iteration N+1

New plan: the C <-> perl interface deals entirely with strings. Storage
is entirely perl-side. C does not know and doesn't care about the
underlying perl-side types. Note that this means an "int" variable in C
land and an "int" variable in perl land have no relation.
g_strdup validsettings

This'll allow perl to set it too.
Fix error messages a bit
dlsym the functions we need after use Glib and before use BarnOwl

After use Glib so the library is loaded. Before use BarnOwl so we try to
use them before they're available.
And now... the moment you've all been waiting for...

Expose OWL_VARIABLE_OTHER variables to perl. Rewrite all perl variable
entry points to use that one. From now on, C only thinks of these
variables as strings.

(This has one regression to be fixed in a later commit: you can't
set/unset with no arguments since we don't know how to set from
boolean.)
Allow perl variables to participate in argumentless set/unset
Pipe all C-created variables through function calls

Gets us some long-overdue type checking in the various type-specific
callbacks.
Fix the unit tests

The arguments got reordered slightly to match the nasty macros.
Merge owl_variable_free and owl_variable_cleanup

We don't do the init/cleanup thing anymore.
Make GClosure invokes more mechanical

We don't really need some of those g_value_unsets, but we may as well
avoid making assumptions. Someone else might copy-and-paste the code
later and get it wrong.
Add new_variable_full

Route everything through that.
Add new_variable_enum

This seems to work. Yay.
Permit validsettings for string

Also die in new_variable_int and new_variable_bool if validsettings are
given.
Moved log generation code to perl.
Made owl_util_makepath available from perl

There's probably a better way to do this.  Maybe

sub makepath {
        my $filename = shift;
        $filename =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1))[7]
        : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7] ) }ex;
        return $filename;
}
(http://docstore.mik.ua/orelly/perl/cookbook/ch07_04.htm) or something.

Additionally, I'm not sure why

 PREINIT:
   char *rv = NULL;
 CODE:
 {
   rv = foo();
   RETVAL = rv;
 }
 OUTPUT:
   RETVAL
 CLEANUP:
   g_free(rv);

is the paradigm for functions returning strings, when foo returns `char
*` and not `const char *`.  I've removed the `= NULL` part of the
initlization, which I assume is left over from when we had to NULL-check
things before freeing them, but I've copied the rest of the code.
Moved log file name generation to perl

I don't think that the class/personal distinction is the best for
general protocols, but I don't know what should replace it.  I've made
class-logging default to only zephyr (a slight change from previous
behavior, where jabber MUC's would be logged to $classlogpath, as well
as all non-private non-login messages from other protocols), but made
logging path generation overridable.

XXX Decide whether or not to filter out more 'bad' characters.
Perhaps we should remove '!' because it indicates history in some shells
and makes things obnoxious.
* '~' indicates homedirs in many shells.  I strip it out everywhere
  because I'm lazy and don't want to make a separate regex to strip it
  out only if it's the first character.
* '/' is for separating directories, and we don't want to accidentally
  make subdirectories

We first NFKC for zephyrs, and then apply lc.  The zephyr servers
apply case-folded NFKC (so says
http://zephyr.1ts.org/browser/zephyr/server/zstring.c).  We should
probably use Unicode::CaseFold instead of lc.  I'm also not sure if the
order of case-adjustment and normalization matters.

We first NFKC, then apply lc, to jabbers, as per
http://xmpp.org/internet-drafts/attic/draft-ietf-xmpp-nodeprep-03.html

We now use lc instead of g_utf8_strdown to normalize AIM screennames.
Scrapped the last bits of C code dealing with jabber.

We still have an OWL_PROTOCOL_JABBER in owl.h, but it does no harm being
there, and we don't use any of the other ones except for AIM.  I figure
there's no harm in waiting and ripping all of them out at the same time
in perl/AIM
Moved outgoing zephyr error logging to perl
Moved the checking of whether or not to log messages to perl