* don't link unused libs
authorWilfried Göesgens <willi@citadel.org>
Mon, 4 Feb 2008 10:26:44 +0000 (10:26 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 4 Feb 2008 10:26:44 +0000 (10:26 +0000)
* getmail actualy does s.th. usefull
* artv dump now separates the types by blank lines; control didn't print varname.

citadel/Makefile.in
citadel/debian/rules
citadel/getmail.c
citadel/modules/vandelay/serv_vandelay.c

index b4554c8bdd5bda467a5d6838c29bc58ce93d8e86..de01aecc2369cc7e80ccf4a1f147aed75e4bc2b5 100644 (file)
@@ -52,14 +52,14 @@ CFLAGS=@CFLAGS@ -I ./include/
 CPPFLAGS=@CPPFLAGS@ -I. -I ./include/
 DATABASE=@DATABASE@
 DEFS=@DEFS@
-LDFLAGS=@LDFLAGS@
+LDFLAGS=@LDFLAGS@  -Wl,--no-undefined -Wl,--as-needed
 LIBS=@LIBS@
 LIBOBJS=@LIBOBJS@
 INSTALL=@INSTALL@
 INSTALL_DATA=@INSTALL_DATA@
 RESOLV=@RESOLV@
 SHELL=/bin/sh
-SERVER_LDFLAGS=@SERVER_LDFLAGS@
+SERVER_LDFLAGS=@SERVER_LDFLAGS@  -Wl,--no-undefined -Wl,--as-needed
 SERVER_LIBS=@SERVER_LIBS@
 SETUP_LIBS=@SETUP_LIBS@
 YACC=@YACC@
index 501fed62c721f094d469e68c3394355e8affcf8c..95d0aa2e86e78193bdf25549d9d700ca9167d4ee 100755 (executable)
@@ -21,7 +21,8 @@ ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
        PROFILE_ARGS= --with-gprof
 endif
 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP 
+       CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW
+       LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
        EXTRA_ARGS = --with-backtrace
 else
        CFLAGS += -O2
index c526f7c05068478c7afd9a4d4eaf083a68677798..ae2c02938d030c9366016494928f00a8300c1c29 100644 (file)
@@ -126,6 +126,9 @@ void logoff(int e)
        cleanup(e);
 }
 
+static char *args[] =
+{"getmail", NULL};
+
 /*
  * Connect sendcommand to the Citadel server running on this computer.
  */
@@ -134,8 +137,6 @@ void np_attach_to_server(char *host, char *port)
        char buf[SIZ];
        char hostbuf[256] = "";
        char portbuf[256] = "";
-       char *args[] =
-       {"getmail", NULL};
        int r;
 
        fprintf(stderr, "Attaching to server...\n");
@@ -170,7 +171,8 @@ int main(int argc, char **argv)
        int a, r, i;
        char cmd[5][SIZ];
        char buf[SIZ];
-
+       int MessageToRetrieve;
+       int MessageFound = 0;
        int relh=0;
        int home=0;
        int n=0;
@@ -220,8 +222,8 @@ int main(int argc, char **argv)
                        ctdl_home_directory);
        fflush(stderr);
 
-       alarm(5);
-       signal(SIGALRM, nq_cleanup); /* Set up a watchdog type timer in case we hang */
+//     alarm(5);
+//     signal(SIGALRM, nq_cleanup); /* Set up a watchdog type timer in case we hang */
        
        np_attach_to_server(UDS, ctdl_run_dir);
        fflush(stderr);
@@ -231,20 +233,39 @@ int main(int argc, char **argv)
        CtdlIPCGotoRoom(ipc, cmd[0], "", &Room, cret);
        fprintf(stderr, "%s\n", cret);
 
+       MessageToRetrieve = atol(cmd[1]);
+
        r = CtdlIPCGetMessages(ipc, 0, 0, NULL, &msgarr, buf);
-       for (i = 0; i < r ; i ++)
+       printf("Messages: ");
+       for (i = 0; msgarr[i] > 0 ; i ++)
        {
-               printf("Message: %ld\n", msgarr[i]);
+//             printf(" %ld ", msgarr[i]);
+               if (msgarr[i] == MessageToRetrieve)
+                       MessageFound = 1;
        }
+       if (!MessageFound)
+               printf("Message %d not found in the above list.", MessageToRetrieve);
+       printf("\n");
 
-
-       CtdlIPCGetSingleMessage(ipc, atol(cmd[1]) ,atol(cmd[1]),4, &mret, cret);
+       CtdlIPCGetSingleMessage(ipc,  MessageToRetrieve,0,4, &mret, cret);
        fprintf(stderr, "%s\n", cret);
        fprintf(stderr, "%s: %s\n", "path", mret->path);
+       fprintf(stderr, "%s: %s\n", "author", mret->author);
        fprintf(stderr, "%s: %s\n", "subject", mret->subject);
        fprintf(stderr, "%s: %s\n", "email", mret->email);
+       fprintf(stderr, "%s: %s\n", "text", mret->text);
+
+       ///if (
+
+
        CtdlIPCQuit(ipc);
        exit (1);
+
+
+
+
+
+
        CtdlIPC_chat_send(ipc, cmd[4]);
        CtdlIPC_chat_recv(ipc, buf);
        fprintf(stderr, "%s\n", buf);
index 2464d9e3976e6c4d5bbc56fcf80fd98aec7b4213..bef0a772765901526db0974f6f1fc15757204e69 100644 (file)
@@ -83,6 +83,7 @@ void artv_dump_users_backend(struct ctdluser *buf, void *data) {
 #include "artv_dump.h"
 #include "dtds/user-defs.h"
 #include "undef_data.h"
+       cprintf("\n");
 }
 
 
@@ -103,6 +104,7 @@ void artv_export_room_msg(long msgnum, void *userdata) {
 void artv_dump_room_msg(long msgnum, void *userdata) {
        cprintf(" msgnum: %ld\n", msgnum);
        fprintf(artv_global_message_list, "%ld\n", msgnum);
+       cprintf("\n");
 }//// TODO
 
 
@@ -455,7 +457,8 @@ void artv_do_export(void) {
 #include "artv_serialize.h"
 #include "dtds/config-defs.h"
 #include "undef_data.h"
-
+       cprintf("\n");
+       
        /* Export the control file */
        get_control();
        cprintf("control\n");
@@ -498,11 +501,11 @@ void artv_do_dump(void) {
        /* Export the control file */
        get_control();
        cprintf("control\n");
-       cprintf("%ld\n", CitControl.MMhighest);
-       cprintf("%u\n", CitControl.MMflags);
-       cprintf("%ld\n", CitControl.MMnextuser);
-       cprintf("%ld\n", CitControl.MMnextroom);
-       cprintf("%d\n", CitControl.version);
+       cprintf(" MMhighest: %ld\n", CitControl.MMhighest);
+       cprintf(" MMflags: %u\n", CitControl.MMflags);
+       cprintf(" MMnextuser: %ld\n", CitControl.MMnextuser);
+       cprintf(" MMnextroom: %ld\n", CitControl.MMnextroom);
+       cprintf(" version: %d\n\n", CitControl.version);
        if (Ctx->kill_me != 1)
                artv_dump_users();
        if (Ctx->kill_me != 1)