summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:46 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:46 +0200
commitd3a0d11f93c1ebe38b4301c9bef952bfd24d01a1 (patch)
treefdcac37e722884d4a71e9dd96443ed76a3533103 /src
parented634bc556af8997b9d2d5bf7334073731936365 (diff)
tagging ychat-0.8.1ychat-0.8.1
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chat/chat.cpp2
-rwxr-xr-xsrc/configure139
-rwxr-xr-x[-rw-r--r--]src/msgs.h6
3 files changed, 70 insertions, 77 deletions
diff --git a/src/chat/chat.cpp b/src/chat/chat.cpp
index ed8f48d..d890d70 100755
--- a/src/chat/chat.cpp
+++ b/src/chat/chat.cpp
@@ -170,6 +170,7 @@ chat::login( map<string,string> &map_params )
map_params["tmpid"] = p_sess->get_tmpid();
p_user->set_tmpid( map_params["tmpid"] );
p_user->set_has_sess( true );
+ wrap::system_message("New tmpid: " + map_params["tmpid"] );
}
}
else // if ( p_user == NULL ) // If not in garbage create a new user!
@@ -223,6 +224,7 @@ chat::login( map<string,string> &map_params )
sess* p_sess = wrap::SMAN->create_session();
p_sess->set_user(p_user);
map_params["tmpid"] = p_sess->get_tmpid();
+ wrap::system_message("New tmpid: " + map_params["tmpid"] );
p_user->set_tmpid( map_params["tmpid"] );
p_user->set_col1( map_params["color1"] );
p_user->set_col2( map_params["color2"] );
diff --git a/src/configure b/src/configure
index 43854d8..55df52b 100755
--- a/src/configure
+++ b/src/configure
@@ -64,76 +64,42 @@ perl -e '
"/opt/local/lib"
);
- my %dependfiles = (
- database => ["data"],
- ycurses => ["curses", "ycui.cpp", "ycui.h"],
- logging => ["logd.cpp", "logd.h"],
- cli => ["cli"],
- opnssl => ["sock/sslsock.cpp", "sock/sslsock.h"]
- );
-
open FILE, "glob.h" or die "glob.h: $!\n";
- while(<FILE>) {
- if ( /\/\/#define DATABASE/ ) {
+ while(<FILE>)
+ {
+ if ( /\/\/#define DATABASE/ )
+ {
remove_from_array("mysql/mysql.h",\@headers);
remove_from_array("libmysqlclient.so",\@libs);
- mkdir "../backuped" unless -d "../backuped";
- `mv $_ ../backuped` for @{$dependfiles{database}};
- }
-
- elsif ( /^#define DATABASE/ && !-d "data") {
- `mv ../backuped/$_ .` for @{$dependfiles{database}};
- }
-
- if ( /\/\/#define LOGGING/ ) {
- mkdir "../backuped" unless -d "../backuped";
- `mv $_ ../backuped` for @{$dependfiles{logging}};
- }
-
- elsif ( /^#define LOGGING/ && !-f "logd.cpp") {
- `mv ../backuped/$_ .` for @{$dependfiles{logging}};
- }
-
- if ( /\/\/#define CLI/ ) {
- mkdir "../backuped" unless -d "../backuped";
- `mv $_ ../backuped` for @{$dependfiles{cli}};
}
- elsif ( /^#define CLI/ && !-d "cli") {
- `mv ../backuped/$_ .` for @{$dependfiles{cli}};
+ if ( /\/\/#define NCURSES/ )
+ {
+ remove_from_array("ncurses.h",\@headers);
+ remove_from_array("libncurses.so",\@libs);
}
- if ( /\/\/#define YCURSES/ ) {
- for ("ncurses", "menu", "panel") {
- remove_from_array("$_.h",\@headers);
- remove_from_array("lib$_.so",\@libs);
- }
-
- mkdir "../backuped" unless -d "../backuped";
- `mv $_ ../backuped` for @{$dependfiles{ycurses}};
- }
-
- elsif ( /^#define YCURSES/ && !-d "curses") {
- `mv ../backuped/$_ .` for @{$dependfiles{ycurses}};
- }
-
- if ( /\/\/#define OPENSSL/ ) {
+ if ( /\/\/#define OPENSSL/ )
+ {
remove_from_array("openssl/ssl.h",\@headers);
remove_from_array("lib$_.so",\@libs) for ("ssl", "crypto");
}
}
close FILE;
- if ( defined $ENV{YCHATHEADERPATHS} ) {
- map { print "Adding $_...\n"; unshift @headerpaths, $_ }
- split /:/, $ENV{YCHATHEADERPATHS};
+ if ( defined $ENV{YCHATHEADERPATHS} )
+ {
+ map { print "Adding $_...\n";
+ unshift @headerpaths, $_ } split /:/, $ENV{YCHATHEADERPATHS};
}
- if ( defined $ENV{YCHATLIBPATHS} ) {
- map { print "Adding $_...\n"; unshift @libpaths, $_ }
- split /:/, $ENV{YCHATLIBPATHS};
+ if ( defined $ENV{YCHATLIBPATHS} )
+ {
+ map { print "Adding $_...\n";
+ unshift @libpaths, $_ } split /:/, $ENV{YCHATLIBPATHS};
}
+
print "Headers:\n";
my $testit = 0;
@@ -148,7 +114,10 @@ perl -e '
my $incadd = &make_add("-I", \%incadd);
my $libadd = &make_add("-L", \%libadd);
- for ( @libs ) { $libadd .= "-l$_ " if s/^lib// and s/\.so$//; }
+ for ( @libs )
+ {
+ $libadd .= "-l$_ " if s/^lib// and s/\.so$//;
+ }
print "Incadd: $incadd\n";
print "Libadd: $libadd\n";
@@ -175,7 +144,8 @@ perl -e '
chomp $cpp;
chomp $version;
- while (<Fin>) {
+ while (<Fin>)
+ {
s/^(CC=).*\n/$1$compiler/;
s/^(SRCS=).*/$1$cpp/;
s/ -frepo//; # unless $version =~ /3\.4/;
@@ -189,7 +159,8 @@ perl -e '
my $args = join(" -",@ARGV);
$args = "-".$args unless $args eq "";
- for my $cppfile (split / /, $cpp) {
+ for my $cppfile (split / /, $cpp)
+ {
my $ofile = $cppfile;
$ofile =~ s/\.cpp/\.o/;
print Fout "../obj/$ofile: $cppfile\n";
@@ -198,12 +169,14 @@ perl -e '
$class =~ s/\.o//;
my $text;
- if ( $class =~ /contrib\/.+/ ) {
+ if ( $class =~ /contrib\/.+/ )
+ {
my $dirname = `dirname $class`;
$text = "\t\@echo -n \"Contributed class $class \"\n";
}
- else {
+ else
+ {
$text = "\t\@echo -n \"Base class $class \"\n";
}
@@ -219,14 +192,16 @@ perl -e '
unlink("msgs.h");
open F, ">msgs.h" or die "msgs.h: $!\n";
- for (@msgs) {
+ for (@msgs)
+ {
s/(UNAME)(.+)$/UNAME "$uname"/;
s/(COMPOPT)(.+)$/COMPOPT "$compopt"/;
print F;
}
close F;
- if ( -d "mods" ) {
+ if ( -d "mods" )
+ {
chdir("mods");
my $cflags = "-fno-inline -fno-default-inline";
@@ -237,12 +212,15 @@ perl -e '
chdir("..");
}
- sub remove_from_array {
+ sub remove_from_array
+ {
my $elem = shift;
my $array = shift;
- for ( my $i = 0; $i <= $#$array; ++$i ) {
- if ( $$array[$i] eq $elem ) {
+ for ( my $i = 0; $i <= $#$array; ++$i )
+ {
+ if ( $$array[$i] eq $elem )
+ {
splice(@$array,$i,1);
last;
}
@@ -266,18 +244,24 @@ perl -e '
pop(@_);
}
- if ($print) {
+ if ($print)
+ {
print "Checking for $check...";
print "\n" if $testit;
}
- for (@_) {
- if ( -f "$_/$check" ) {
- if ($testit) {
+ for (@_)
+ {
+ if ( -f "$_/$check" )
+ {
+ if ($testit)
+ {
return $_ if test_include($_, $check);
return "";
+ }
- } else {
+ else
+ {
print "OK\n";
return "" if $_ eq "/usr/lib" or $_ eq "/usr/include";
return $_;
@@ -285,20 +269,23 @@ perl -e '
}
}
- for (@_) {
+ for (@_)
+ {
next unless -d $_;
opendir D, $_ or warn "$_: $!\n";
my @dir = readdir(D);
closedir D;
- for my $dir ( @dir ) {
+ for my $dir ( @dir )
+ {
next if $dir =~ /^\.+$/ or !-d "$_/$dir";
my $path = &check($deep-1, $check, "$_/$dir", "subsearch");
return $path if $path ne "";
}
}
- if ($print) {
+ if ($print)
+ {
print "NOT OK\n";
print "Please make sure that you have the needed software installed!\n";
print "If you have a special path for your includes then edit src/configure!\n";
@@ -325,7 +312,8 @@ perl -e '
return $ret;
}
- sub test_include {
+ sub test_include
+ {
my $shift = shift;
my $check = shift;
my $return = 0;
@@ -336,11 +324,14 @@ perl -e '
my $cmd = "`tail -n 1 ../g++.version` -I$shift __test.cpp -o /dev/null 2>/dev/null";
system $cmd;
- unless ($?) {
+ unless ($?)
+ {
print "OK\n";
$return = 1;
+ }
- } else {
+ else
+ {
print "Not OK\n";
}
diff --git a/src/msgs.h b/src/msgs.h
index 031debe..d3fc730 100644..100755
--- a/src/msgs.h
+++ b/src/msgs.h
@@ -123,10 +123,10 @@
#define XMLREAD "XML: Reading "
#define XMLERR "XML Error: "
#define XMLER1 "XML Error: Unable to load file "
-#define VERSION "0.8.2"
+#define VERSION "0.8.1"
#define BRANCH "RELEASE"
-#define BUILDNR 4003
-#define UNAME "FreeBSD 5.4-RELEASE-p3 i386"
+#define BUILDNR 3962
+#define UNAME "FreeBSD 5.4-RELEASE-p1 i386"
#define COMPOPT "Using built-in specs.; Configured with: FreeBSD/i386 system compiler; Thread model: posix; gcc version 3.4.2 [FreeBSD] 20040728; 3.4; g++"
#define YCUSAGE "Usage: ./ychat {h|v}|{o confkey confvalue}\n"