From f6fcf350671e3661f8f22696eb35133014ab6a14 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 4 Jun 2022 19:11:58 -0400 Subject: [PATCH] This is an omnibus commit which moves the Citadel Server from crusty old GNU Autotools to the shiny new conf-IG-ure system. WARNING BROKEN BUILD ALERT: at the moment it only compiles the server and lacks 'clean' and 'install' targets. Subsequent commits will resolve these but don't try to build production from this yet. --- citadel/.gitignore | 17 - citadel/COPYING | 24 +- citadel/Makefile | 27 + citadel/config.guess | 1701 --------------- citadel/config.sub | 1855 ----------------- citadel/configure | 103 + citadel/missing | 283 --- citadel/modules/blog/serv_blog.c | 90 - citadel/scripts/mk_svn_revision.sh | 78 - citadel/{ => server}/citadel.h | 0 citadel/{ => server}/citadel_dirs.c | 0 citadel/{ => server}/citadel_dirs.h | 0 citadel/{ => server}/citadel_ldap.h | 0 citadel/{ => server}/citserver.c | 2 +- citadel/{ => server}/citserver.h | 0 citadel/{ => server}/clientsocket.c | 0 citadel/{ => server}/clientsocket.h | 0 citadel/{ => server}/config.c | 0 citadel/{ => server}/config.h | 0 citadel/{ => server}/context.c | 0 citadel/{ => server}/context.h | 0 citadel/{ => server}/control.c | 9 +- citadel/{ => server}/control.h | 0 citadel/{ => server}/ctdl_module.h | 5 +- citadel/{ => server}/database.c | 9 +- citadel/{ => server}/database.h | 0 citadel/{ => server}/default_timezone.c | 0 citadel/{ => server}/default_timezone.h | 0 citadel/{ => server}/domain.c | 0 citadel/{ => server}/domain.h | 0 citadel/{ => server}/euidindex.c | 5 +- citadel/{ => server}/euidindex.h | 0 citadel/{ => server}/genstamp.c | 0 citadel/{ => server}/genstamp.h | 0 citadel/{ => server}/housekeeping.c | 0 citadel/{ => server}/housekeeping.h | 0 citadel/{ => server}/internet_addressing.c | 1 - citadel/{ => server}/internet_addressing.h | 0 citadel/{ => server}/ipcdef.h | 0 citadel/{ => server}/journaling.c | 0 citadel/{ => server}/journaling.h | 0 citadel/{ => server}/ldap.c | 6 + citadel/{ => server}/locate_host.c | 0 citadel/{ => server}/locate_host.h | 0 .../modules/autocompletion/.gitignore | 0 .../autocompletion/serv_autocompletion.c | 12 +- .../autocompletion/serv_autocompletion.h | 0 citadel/{ => server}/modules/bio/.gitignore | 0 citadel/{ => server}/modules/bio/serv_bio.c | 14 +- citadel/server/modules/blog/serv_blog.c | 80 + .../{ => server}/modules/calendar/.gitignore | 0 .../modules/calendar/serv_calendar.c | 22 +- .../modules/calendar/serv_calendar.h | 0 .../modules/checkpoint/.gitignore | 0 .../modules/checkpoint/serv_checkpoint.c | 29 +- .../{ => server}/modules/clamav/.gitignore | 0 .../{ => server}/modules/clamav/serv_virus.c | 36 +- .../{ => server}/modules/crypto/.gitignore | 0 .../{ => server}/modules/crypto/serv_crypto.c | 14 +- .../{ => server}/modules/crypto/serv_crypto.h | 0 .../{ => server}/modules/ctdlproto/files.h | 0 .../modules/ctdlproto/serv_ctdlproto.c | 6 +- .../modules/ctdlproto/serv_file.c | 17 +- .../modules/ctdlproto/serv_messages.c | 17 +- .../modules/ctdlproto/serv_rooms.c | 13 +- .../modules/ctdlproto/serv_session.c | 14 +- .../modules/ctdlproto/serv_syscmds.c | 9 +- .../modules/ctdlproto/serv_user.c | 17 +- .../{ => server}/modules/expire/.gitignore | 0 .../modules/expire/expire_policy.c | 24 +- citadel/{ => server}/modules/expire/policy.h | 0 .../{ => server}/modules/expire/serv_expire.c | 32 +- .../{ => server}/modules/fulltext/.gitignore | 0 citadel/{ => server}/modules/fulltext/crc16.c | 0 citadel/{ => server}/modules/fulltext/crc16.h | 0 .../modules/fulltext/ft_wordbreaker.c | 22 +- .../modules/fulltext/ft_wordbreaker.h | 0 .../modules/fulltext/serv_fulltext.c | 33 +- .../modules/fulltext/serv_fulltext.h | 0 .../{ => server}/modules/image/serv_image.c | 12 +- citadel/{ => server}/modules/imap/.gitignore | 0 citadel/{ => server}/modules/imap/imap_acl.c | 26 +- citadel/{ => server}/modules/imap/imap_acl.h | 0 .../{ => server}/modules/imap/imap_fetch.c | 26 +- .../{ => server}/modules/imap/imap_fetch.h | 0 citadel/{ => server}/modules/imap/imap_list.c | 24 +- citadel/{ => server}/modules/imap/imap_list.h | 0 .../{ => server}/modules/imap/imap_metadata.c | 27 +- .../{ => server}/modules/imap/imap_metadata.h | 0 citadel/{ => server}/modules/imap/imap_misc.c | 30 +- citadel/{ => server}/modules/imap/imap_misc.h | 0 .../{ => server}/modules/imap/imap_search.c | 26 +- .../{ => server}/modules/imap/imap_search.h | 0 .../{ => server}/modules/imap/imap_store.c | 26 +- .../{ => server}/modules/imap/imap_store.h | 0 .../{ => server}/modules/imap/imap_tools.c | 8 +- .../{ => server}/modules/imap/imap_tools.h | 0 citadel/{ => server}/modules/imap/serv_imap.c | 49 +- citadel/{ => server}/modules/imap/serv_imap.h | 0 .../modules/inboxrules/.gitignore | 0 .../modules/inboxrules/serv_inboxrules.c | 26 +- .../{ => server}/modules/inetcfg/.gitignore | 0 .../modules/inetcfg/serv_inetcfg.c | 34 +- .../{ => server}/modules/instmsg/.gitignore | 0 .../modules/instmsg/serv_instmsg.c | 27 +- .../modules/instmsg/serv_instmsg.h | 1 - .../modules/listdeliver/serv_listdeliver.c | 27 +- .../{ => server}/modules/listsub/.gitignore | 0 .../modules/listsub/serv_listsub.c | 30 +- .../{ => server}/modules/migrate/.gitignore | 0 .../modules/migrate/serv_migrate.c | 30 +- .../{ => server}/modules/newuser/.gitignore | 0 .../modules/newuser/serv_newuser.c | 28 +- citadel/{ => server}/modules/nntp/serv_nntp.c | 44 +- citadel/{ => server}/modules/nntp/serv_nntp.h | 0 citadel/{ => server}/modules/nntp/wildmat.c | 0 citadel/{ => server}/modules/notes/.gitignore | 0 .../{ => server}/modules/notes/serv_notes.c | 28 +- .../{ => server}/modules/openid/.gitignore | 0 .../modules/openid/serv_openid_rp.c | 18 +- citadel/{ => server}/modules/pop3/.gitignore | 0 citadel/{ => server}/modules/pop3/serv_pop3.c | 30 +- citadel/{ => server}/modules/pop3/serv_pop3.h | 0 .../modules/pop3client/.gitignore | 0 .../modules/pop3client/serv_pop3client.c | 34 +- .../{ => server}/modules/roomchat/.gitignore | 0 .../modules/roomchat/serv_roomchat.c | 26 +- .../{ => server}/modules/rssclient/.gitignore | 0 .../modules/rssclient/serv_rssclient.c | 34 +- citadel/{ => server}/modules/rwho/.gitignore | 0 citadel/{ => server}/modules/rwho/serv_rwho.c | 30 +- citadel/{ => server}/modules/smtp/.gitignore | 0 citadel/{ => server}/modules/smtp/serv_smtp.c | 39 +- .../modules/smtp/serv_smtpclient.c | 29 +- citadel/{ => server}/modules/smtp/smtp_util.c | 36 +- citadel/{ => server}/modules/smtp/smtp_util.h | 0 citadel/{ => server}/modules/spam/.gitignore | 0 citadel/{ => server}/modules/spam/serv_spam.c | 36 +- citadel/{ => server}/modules/test/.gitignore | 0 citadel/{ => server}/modules/test/serv_test.c | 44 +- .../{ => server}/modules/upgrade/.gitignore | 0 .../modules/upgrade/serv_upgrade.c | 40 +- .../modules/upgrade/serv_upgrade.h | 0 citadel/{ => server}/modules/vcard/.gitignore | 0 .../{ => server}/modules/vcard/serv_vcard.c | 38 +- citadel/{ => server}/modules/wiki/.gitignore | 0 citadel/{ => server}/modules/wiki/serv_wiki.c | 40 +- citadel/{ => server}/modules/xmpp/.gitignore | 0 citadel/{ => server}/modules/xmpp/serv_xmpp.c | 27 +- citadel/{ => server}/modules/xmpp/serv_xmpp.h | 0 .../{ => server}/modules/xmpp/xmpp_messages.c | 16 +- .../{ => server}/modules/xmpp/xmpp_presence.c | 16 +- .../modules/xmpp/xmpp_query_namespace.c | 16 +- .../{ => server}/modules/xmpp/xmpp_queue.c | 16 +- .../modules/xmpp/xmpp_sasl_service.c | 18 +- citadel/server/modules_init.c | 75 + citadel/server/modules_init.h | 64 + citadel/{ => server}/msgbase.c | 13 +- citadel/{ => server}/msgbase.h | 2 +- citadel/{ => server}/netconfig.c | 10 +- citadel/{ => server}/parsedate.c | 0 citadel/{ => server}/parsedate.h | 0 citadel/{ => server}/parsedate.y | 0 citadel/{ => server}/room_ops.c | 1 - citadel/{ => server}/room_ops.h | 7 +- citadel/{ => server}/serv_extensions.c | 0 citadel/{ => server}/serv_extensions.h | 0 citadel/{ => server}/serv_vcard.h | 0 citadel/{ => server}/server.h | 0 citadel/{ => server}/server_main.c | 7 +- citadel/{ => server}/support.c | 0 citadel/{ => server}/support.h | 0 citadel/{ => server}/sysconfig.h | 0 citadel/{ => server}/sysdep.c | 0 citadel/server/sysdep.h | 349 ++++ citadel/{ => server}/sysdep_decls.h | 0 citadel/{ => server}/threads.c | 2 +- citadel/{ => server}/threads.h | 0 citadel/{ => server}/typesize.h | 0 citadel/{ => server}/user_ops.c | 0 citadel/{ => server}/user_ops.h | 0 citadel/svn_revision.h | 5 - 182 files changed, 1417 insertions(+), 4856 deletions(-) create mode 100644 citadel/Makefile delete mode 100644 citadel/config.guess delete mode 100644 citadel/config.sub create mode 100755 citadel/configure delete mode 100755 citadel/missing delete mode 100644 citadel/modules/blog/serv_blog.c delete mode 100755 citadel/scripts/mk_svn_revision.sh rename citadel/{ => server}/citadel.h (100%) rename citadel/{ => server}/citadel_dirs.c (100%) rename citadel/{ => server}/citadel_dirs.h (100%) rename citadel/{ => server}/citadel_ldap.h (100%) rename citadel/{ => server}/citserver.c (99%) rename citadel/{ => server}/citserver.h (100%) rename citadel/{ => server}/clientsocket.c (100%) rename citadel/{ => server}/clientsocket.h (100%) rename citadel/{ => server}/config.c (100%) rename citadel/{ => server}/config.h (100%) rename citadel/{ => server}/context.c (100%) rename citadel/{ => server}/context.h (100%) rename citadel/{ => server}/control.c (99%) rename citadel/{ => server}/control.h (100%) rename citadel/{ => server}/ctdl_module.h (99%) rename citadel/{ => server}/database.c (98%) rename citadel/{ => server}/database.h (100%) rename citadel/{ => server}/default_timezone.c (100%) rename citadel/{ => server}/default_timezone.h (100%) rename citadel/{ => server}/domain.c (100%) rename citadel/{ => server}/domain.h (100%) rename citadel/{ => server}/euidindex.c (98%) rename citadel/{ => server}/euidindex.h (100%) rename citadel/{ => server}/genstamp.c (100%) rename citadel/{ => server}/genstamp.h (100%) rename citadel/{ => server}/housekeeping.c (100%) rename citadel/{ => server}/housekeeping.h (100%) rename citadel/{ => server}/internet_addressing.c (99%) rename citadel/{ => server}/internet_addressing.h (100%) rename citadel/{ => server}/ipcdef.h (100%) rename citadel/{ => server}/journaling.c (100%) rename citadel/{ => server}/journaling.h (100%) rename citadel/{ => server}/ldap.c (98%) rename citadel/{ => server}/locate_host.c (100%) rename citadel/{ => server}/locate_host.h (100%) rename citadel/{ => server}/modules/autocompletion/.gitignore (100%) rename citadel/{ => server}/modules/autocompletion/serv_autocompletion.c (96%) rename citadel/{ => server}/modules/autocompletion/serv_autocompletion.h (100%) rename citadel/{ => server}/modules/bio/.gitignore (100%) rename citadel/{ => server}/modules/bio/serv_bio.c (96%) create mode 100644 citadel/server/modules/blog/serv_blog.c rename citadel/{ => server}/modules/calendar/.gitignore (100%) rename citadel/{ => server}/modules/calendar/serv_calendar.c (99%) rename citadel/{ => server}/modules/calendar/serv_calendar.h (100%) rename citadel/{ => server}/modules/checkpoint/.gitignore (100%) rename citadel/{ => server}/modules/checkpoint/serv_checkpoint.c (65%) rename citadel/{ => server}/modules/clamav/.gitignore (100%) rename citadel/{ => server}/modules/clamav/serv_virus.c (89%) rename citadel/{ => server}/modules/crypto/.gitignore (100%) rename citadel/{ => server}/modules/crypto/serv_crypto.c (98%) rename citadel/{ => server}/modules/crypto/serv_crypto.h (100%) rename citadel/{ => server}/modules/ctdlproto/files.h (100%) rename citadel/{ => server}/modules/ctdlproto/serv_ctdlproto.c (96%) rename citadel/{ => server}/modules/ctdlproto/serv_file.c (98%) rename citadel/{ => server}/modules/ctdlproto/serv_messages.c (99%) rename citadel/{ => server}/modules/ctdlproto/serv_rooms.c (99%) rename citadel/{ => server}/modules/ctdlproto/serv_session.c (96%) rename citadel/{ => server}/modules/ctdlproto/serv_syscmds.c (93%) rename citadel/{ => server}/modules/ctdlproto/serv_user.c (98%) rename citadel/{ => server}/modules/expire/.gitignore (100%) rename citadel/{ => server}/modules/expire/expire_policy.c (93%) rename citadel/{ => server}/modules/expire/policy.h (100%) rename citadel/{ => server}/modules/expire/serv_expire.c (98%) rename citadel/{ => server}/modules/fulltext/.gitignore (100%) rename citadel/{ => server}/modules/fulltext/crc16.c (100%) rename citadel/{ => server}/modules/fulltext/crc16.h (100%) rename citadel/{ => server}/modules/fulltext/ft_wordbreaker.c (92%) rename citadel/{ => server}/modules/fulltext/ft_wordbreaker.h (100%) rename citadel/{ => server}/modules/fulltext/serv_fulltext.c (96%) rename citadel/{ => server}/modules/fulltext/serv_fulltext.h (100%) rename citadel/{ => server}/modules/image/serv_image.c (98%) rename citadel/{ => server}/modules/imap/.gitignore (100%) rename citadel/{ => server}/modules/imap/imap_acl.c (95%) rename citadel/{ => server}/modules/imap/imap_acl.h (100%) rename citadel/{ => server}/modules/imap/imap_fetch.c (99%) rename citadel/{ => server}/modules/imap/imap_fetch.h (100%) rename citadel/{ => server}/modules/imap/imap_list.c (96%) rename citadel/{ => server}/modules/imap/imap_list.h (100%) rename citadel/{ => server}/modules/imap/imap_metadata.c (95%) rename citadel/{ => server}/modules/imap/imap_metadata.h (100%) rename citadel/{ => server}/modules/imap/imap_misc.c (95%) rename citadel/{ => server}/modules/imap/imap_misc.h (100%) rename citadel/{ => server}/modules/imap/imap_search.c (97%) rename citadel/{ => server}/modules/imap/imap_search.h (100%) rename citadel/{ => server}/modules/imap/imap_store.c (94%) rename citadel/{ => server}/modules/imap/imap_store.h (100%) rename citadel/{ => server}/modules/imap/imap_tools.c (99%) rename citadel/{ => server}/modules/imap/imap_tools.h (100%) rename citadel/{ => server}/modules/imap/serv_imap.c (98%) rename citadel/{ => server}/modules/imap/serv_imap.h (100%) rename citadel/{ => server}/modules/inboxrules/.gitignore (100%) rename citadel/{ => server}/modules/inboxrules/serv_inboxrules.c (98%) rename citadel/{ => server}/modules/inetcfg/.gitignore (100%) rename citadel/{ => server}/modules/inetcfg/serv_inetcfg.c (86%) rename citadel/{ => server}/modules/instmsg/.gitignore (100%) rename citadel/{ => server}/modules/instmsg/serv_instmsg.c (97%) rename citadel/{ => server}/modules/instmsg/serv_instmsg.h (92%) rename citadel/{ => server}/modules/listdeliver/serv_listdeliver.c (95%) rename citadel/{ => server}/modules/listsub/.gitignore (100%) rename citadel/{ => server}/modules/listsub/serv_listsub.c (96%) rename citadel/{ => server}/modules/migrate/.gitignore (100%) rename citadel/{ => server}/modules/migrate/serv_migrate.c (98%) rename citadel/{ => server}/modules/newuser/.gitignore (100%) rename citadel/{ => server}/modules/newuser/serv_newuser.c (84%) rename citadel/{ => server}/modules/nntp/serv_nntp.c (97%) rename citadel/{ => server}/modules/nntp/serv_nntp.h (100%) rename citadel/{ => server}/modules/nntp/wildmat.c (100%) rename citadel/{ => server}/modules/notes/.gitignore (100%) rename citadel/{ => server}/modules/notes/serv_notes.c (90%) rename citadel/{ => server}/modules/openid/.gitignore (100%) rename citadel/{ => server}/modules/openid/serv_openid_rp.c (99%) rename citadel/{ => server}/modules/pop3/.gitignore (100%) rename citadel/{ => server}/modules/pop3/serv_pop3.c (97%) rename citadel/{ => server}/modules/pop3/serv_pop3.h (100%) rename citadel/{ => server}/modules/pop3client/.gitignore (100%) rename citadel/{ => server}/modules/pop3client/serv_pop3client.c (93%) rename citadel/{ => server}/modules/roomchat/.gitignore (100%) rename citadel/{ => server}/modules/roomchat/serv_roomchat.c (93%) rename citadel/{ => server}/modules/rssclient/.gitignore (100%) rename citadel/{ => server}/modules/rssclient/serv_rssclient.c (95%) rename citadel/{ => server}/modules/rwho/.gitignore (100%) rename citadel/{ => server}/modules/rwho/serv_rwho.c (90%) rename citadel/{ => server}/modules/smtp/.gitignore (100%) rename citadel/{ => server}/modules/smtp/serv_smtp.c (98%) rename citadel/{ => server}/modules/smtp/serv_smtpclient.c (97%) rename citadel/{ => server}/modules/smtp/smtp_util.c (94%) rename citadel/{ => server}/modules/smtp/smtp_util.h (100%) rename citadel/{ => server}/modules/spam/.gitignore (100%) rename citadel/{ => server}/modules/spam/serv_spam.c (89%) rename citadel/{ => server}/modules/test/.gitignore (100%) rename citadel/{ => server}/modules/test/serv_test.c (54%) rename citadel/{ => server}/modules/upgrade/.gitignore (100%) rename citadel/{ => server}/modules/upgrade/serv_upgrade.c (97%) rename citadel/{ => server}/modules/upgrade/serv_upgrade.h (100%) rename citadel/{ => server}/modules/vcard/.gitignore (100%) rename citadel/{ => server}/modules/vcard/serv_vcard.c (98%) rename citadel/{ => server}/modules/wiki/.gitignore (100%) rename citadel/{ => server}/modules/wiki/serv_wiki.c (96%) rename citadel/{ => server}/modules/xmpp/.gitignore (100%) rename citadel/{ => server}/modules/xmpp/serv_xmpp.c (97%) rename citadel/{ => server}/modules/xmpp/serv_xmpp.h (100%) rename citadel/{ => server}/modules/xmpp/xmpp_messages.c (91%) rename citadel/{ => server}/modules/xmpp/xmpp_presence.c (97%) rename citadel/{ => server}/modules/xmpp/xmpp_query_namespace.c (96%) rename citadel/{ => server}/modules/xmpp/xmpp_queue.c (93%) rename citadel/{ => server}/modules/xmpp/xmpp_sasl_service.c (93%) create mode 100644 citadel/server/modules_init.c create mode 100644 citadel/server/modules_init.h rename citadel/{ => server}/msgbase.c (99%) rename citadel/{ => server}/msgbase.h (98%) rename citadel/{ => server}/netconfig.c (97%) rename citadel/{ => server}/parsedate.c (100%) rename citadel/{ => server}/parsedate.h (100%) rename citadel/{ => server}/parsedate.y (100%) rename citadel/{ => server}/room_ops.c (99%) rename citadel/{ => server}/room_ops.h (85%) rename citadel/{ => server}/serv_extensions.c (100%) rename citadel/{ => server}/serv_extensions.h (100%) rename citadel/{ => server}/serv_vcard.h (100%) rename citadel/{ => server}/server.h (100%) rename citadel/{ => server}/server_main.c (98%) rename citadel/{ => server}/support.c (100%) rename citadel/{ => server}/support.h (100%) rename citadel/{ => server}/sysconfig.h (100%) rename citadel/{ => server}/sysdep.c (100%) create mode 100644 citadel/server/sysdep.h rename citadel/{ => server}/sysdep_decls.h (100%) rename citadel/{ => server}/threads.c (99%) rename citadel/{ => server}/threads.h (100%) rename citadel/{ => server}/typesize.h (100%) rename citadel/{ => server}/user_ops.c (100%) rename citadel/{ => server}/user_ops.h (100%) delete mode 100644 citadel/svn_revision.h diff --git a/citadel/.gitignore b/citadel/.gitignore index 7f78ac606..26f283b08 100644 --- a/citadel/.gitignore +++ b/citadel/.gitignore @@ -2,14 +2,8 @@ *.d *.gcno *.gcda -Make_modules -Make_sources -Makefile -Makefile.in locale -aclocal.m4 aidepost -base64 build-arch-stamp build-indep-stamp chkpw @@ -17,26 +11,15 @@ chkpwd citadel citmail citserver -config.log -config.status -configure -configure-stamp ctdlmigrate getmail -modules_init.c -modules_init.h -modules_upgrade.c msgform panic.log sendcommand setup svn_revision.c -sysdep.h -sysdep.h.in userlist -whobbs gmon.out -autom4te.cache citadel.config citadel.control citadel.pid diff --git a/citadel/COPYING b/citadel/COPYING index b9a6cc30f..97eb78723 100644 --- a/citadel/COPYING +++ b/citadel/COPYING @@ -6,23 +6,13 @@ Copyright: (C) 1987-2022 Citadel development team; GPL V3 software" -- and that our favorite operating system is called "Linux" -- NOT "GNU/Linux". -* In addition, as a special exception, it is declared without exception - that Richard Stallman is a communist, is an asshole, and should - shut up and go away because he contributes nothing useful to the - open source community. - -* In addition, as a special exception, the copyright holders give - permission to link the code of portions of this program with the - OpenSSL library under certain conditions as described in each - individual source file, and distribute linked combinations - including the two. - You must obey the General Public License in all respects - for all of the code used other than OpenSSL. If you modify - file(s) with this exception, you may extend this exception to your - version of the file(s), but you are not obligated to do so. If you - do not wish to do so, delete this exception statement from your - version. If you delete this exception statement from all source - files in the program, then also delete it here. +* We reject and oppose Richard M. Stallman because he contributes + nothing but trouble to the open source community. + +* As a special exception, the copyright holders of the Citadel + system grant permission to link Citadel with non-GPL-compatible + libraries, including OpenSSL, in the sole case that such linking + is done to build the Citadel system itself. GENERAL PUBLIC LICENSE diff --git a/citadel/Makefile b/citadel/Makefile new file mode 100644 index 000000000..f1439fad9 --- /dev/null +++ b/citadel/Makefile @@ -0,0 +1,27 @@ +# Makefile for Citadel Server +# Copyright (c) 1987-2022 by Art Cancro and the citadel.org team +# +# This is the new and improved version that does not use the GNU Autotools, +# because it is The Current Year and we aren't trying to build for weird +# obscure systems anymore. +# +# This program is open source software. Use, duplication, and/or +# disclosure are subject to the GNU General Purpose License version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + + +# config.mk is generated by ./configure +include config.mk + +citserver: server/*.c server/modules/*/*.c config.mk + cc ${CFLAGS} \ + server/*.c server/modules/*/*.c \ + ${LDFLAGS} -lresolv -lcitadel -lpthread -lz -lical -lldap -lcrypt -lexpat -lcurl -ldb \ + -o citserver + +config.mk: configure + ./configure diff --git a/citadel/config.guess b/citadel/config.guess deleted file mode 100644 index f7727026b..000000000 --- a/citadel/config.guess +++ /dev/null @@ -1,1701 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. - -timestamp='2021-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess -# -# Please send patches to . - - -me=$(echo "$0" | sed -e 's,.*/,,') - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 - -set_cc_for_build() { - # prevent multiple calls if $tmp is already set - test "$tmp" && return 0 - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" - break - fi - done - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; - esac -} - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if test -f /.attbin/uname ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown -UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown -UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown -UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown - -case "$UNAME_SYSTEM" in -Linux|GNU|GNU/*) - LIBC=unknown - - set_cc_for_build - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #elif defined(__GLIBC__) - LIBC=gnu - #else - #include - /* First heuristic to detect musl libc. */ - #ifdef __DEFINED_va_list - LIBC=musl - #endif - #endif - EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" - - # Second heuristic to detect musl libc. - if [ "$LIBC" = unknown ] && - command -v ldd >/dev/null && - ldd --version 2>&1 | grep -q ^musl; then - LIBC=musl - fi - - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - if [ "$LIBC" = unknown ]; then - LIBC=gnu - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)) - case "$UNAME_MACHINE_ARCH" in - aarch64eb) machine=aarch64_be-unknown ;; - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') - endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') - machine="${arch}${endian}"-unknown - ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in - Debian*) - release='-gnu' - ;; - *) - release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; - *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; - *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; - *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; - *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') - ;; - *5.*) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case $(/usr/bin/uname -p) in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - set_cc_for_build - SUN_ARCH=i386 - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; - sun4*:SunOS:*:*) - case "$(/usr/bin/arch -k)" in - Series*|S4*) - UNAME_RELEASE=$(uname -v) - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "$(/bin/arch)" in - sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" - ;; - sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && - SYSTEM_NAME=$("$dummy" "$dummyarg") && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=$(/usr/bin/uname -p) - if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 - then - if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ - test "$TARGET_BINARY_INTERFACE"x = x - then - echo m88k-dg-dgux"$UNAME_RELEASE" - else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" - fi - else - echo i586-dg-dgux"$UNAME_RELEASE" - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if test -x /usr/bin/oslevel ; then - IBM_REV=$(/usr/bin/oslevel) - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if test -x /usr/bin/lslpp ; then - IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - case "$UNAME_MACHINE" in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if test -x /usr/bin/getconf; then - sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) - sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) - case "$sc_cpu_version" in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if test "$HP_ARCH" = ""; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if test "$HP_ARCH" = hppa2.0w - then - set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; - 3050*:HI-UX:*:*) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk - else - echo "$UNAME_MACHINE"-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; - *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=$(uname -p) - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi - else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf - fi - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=$(/usr/bin/uname -p) - case "$UNAME_PROCESSOR" in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; - i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; - *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; - *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; - *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; - i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; - *:Interix*:*) - case "$UNAME_MACHINE" in - x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; - IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; - esac ;; - i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; - *:GNU:*:*) - # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; - aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - alpha:Linux:*:*) - case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arm*:Linux:*:*) - set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi - else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build - IS_GLIBC=0 - test x"${LIBC}" = xgnu && IS_GLIBC=1 - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef mips - #undef mipsel - #undef mips64 - #undef mips64el - #if ${IS_GLIBC} && defined(_ABI64) - LIBCABI=gnuabi64 - #else - #if ${IS_GLIBC} && defined(_ABIN32) - LIBCABI=gnuabin32 - #else - LIBCABI=${LIBC} - #endif - #endif - - #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa64r6 - #else - #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa32r6 - #else - #if defined(__mips64) - CPU=mips64 - #else - CPU=mips - #endif - #endif - #endif - - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - MIPS_ENDIAN=el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - MIPS_ENDIAN= - #else - MIPS_ENDIAN= - #endif - #endif -EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" - test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } - ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; - sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; - x86_64:Linux:*:*) - set_cc_for_build - LIBCABI=$LIBC - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - LIBCABI="$LIBC"x32 - fi - fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; - xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; - i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; - i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; - i*86:*:4.*:*) - UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case $(/bin/uname -X | grep "^Machine") in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" - else - echo mips-unknown-sysv"$UNAME_RELEASE" - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; - arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=$(uname -p) - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - if command -v xcode-select > /dev/null 2> /dev/null && \ - ! xcode-select --print-path > /dev/null 2> /dev/null ; then - # Avoid executing cc if there is no toolchain installed as - # cc will be a stub that puts up a graphical alert - # prompting the user to install developer tools. - CC_FOR_BUILD=no_compiler_found - else - set_cc_for_build - fi - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # uname -m returns i386 or x86_64 - UNAME_PROCESSOR=$UNAME_MACHINE - fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=$(uname -p) - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; - *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; - i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; - *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; -esac - -# No uname command or uname output not recognized. -set_cc_for_build -cat > "$dummy.c" < -#include -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#include -#if defined(_SIZE_T_) || defined(SIGLOST) -#include -#endif -#endif -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); -#endif - -#if defined (vax) -#if !defined (ultrix) -#include -#if defined (BSD) -#if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -#else -#if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#endif -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#else -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname un; - uname (&un); - printf ("vax-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname *un; - uname (&un); - printf ("mips-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("mips-dec-ultrix\n"); exit (0); -#endif -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. -test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } - -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 <&2 </dev/null || echo unknown) -uname -r = $( (uname -r) 2>/dev/null || echo unknown) -uname -s = $( (uname -s) 2>/dev/null || echo unknown) -uname -v = $( (uname -v) 2>/dev/null || echo unknown) - -/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) -/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) - -hostinfo = $( (hostinfo) 2>/dev/null) -/bin/universe = $( (/bin/universe) 2>/dev/null) -/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) -/bin/arch = $( (/bin/arch) 2>/dev/null) -/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) -/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) - -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" -EOF -fi - -exit 1 - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/citadel/config.sub b/citadel/config.sub deleted file mode 100644 index b0f849234..000000000 --- a/citadel/config.sub +++ /dev/null @@ -1,1855 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2021 Free Software Foundation, Inc. - -timestamp='2021-01-07' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=$(echo "$0" | sed -e 's,.*/,,') - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2021 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Split fields of configuration type -# shellcheck disable=SC2162 -IFS="-" read field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - basic_os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - basic_os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - basic_os=linux-android - ;; - *) - basic_machine=$field1-$field2 - basic_os=$field3 - ;; - esac - ;; - *-*) - # A lone config we happen to match not fitting any pattern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - basic_os= - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - basic_os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - basic_os= - ;; - *) - basic_machine=$field1 - basic_os=$field2 - ;; - esac - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - basic_os=bsd - ;; - a29khif) - basic_machine=a29k-amd - basic_os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - basic_os=scout - ;; - alliant) - basic_machine=fx80-alliant - basic_os= - ;; - altos | altos3068) - basic_machine=m68k-altos - basic_os= - ;; - am29k) - basic_machine=a29k-none - basic_os=bsd - ;; - amdahl) - basic_machine=580-amdahl - basic_os=sysv - ;; - amiga) - basic_machine=m68k-unknown - basic_os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown - basic_os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - basic_os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - basic_os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - basic_os=bsd - ;; - aros) - basic_machine=i386-pc - basic_os=aros - ;; - aux) - basic_machine=m68k-apple - basic_os=aux - ;; - balance) - basic_machine=ns32k-sequent - basic_os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - basic_os=linux - ;; - cegcc) - basic_machine=arm-unknown - basic_os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; - cray) - basic_machine=j90-cray - basic_os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - basic_os= - ;; - da30) - basic_machine=m68k-da30 - basic_os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - basic_os= - ;; - delta88) - basic_machine=m88k-motorola - basic_os=sysv3 - ;; - dicos) - basic_machine=i686-pc - basic_os=dicos - ;; - djgpp) - basic_machine=i586-pc - basic_os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - basic_os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - basic_os=ose - ;; - gmicro) - basic_machine=tron-gmicro - basic_os=sysv - ;; - go32) - basic_machine=i386-pc - basic_os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - basic_os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - basic_os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - basic_os=hms - ;; - harris) - basic_machine=m88k-harris - basic_os=sysv3 - ;; - hp300 | hp300hpux) - basic_machine=m68k-hp - basic_os=hpux - ;; - hp300bsd) - basic_machine=m68k-hp - basic_os=bsd - ;; - hppaosf) - basic_machine=hppa1.1-hp - basic_os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - basic_os=proelf - ;; - i386mach) - basic_machine=i386-mach - basic_os=mach - ;; - isi68 | isi) - basic_machine=m68k-isi - basic_os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - basic_os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - basic_os=sysv - ;; - merlin) - basic_machine=ns32k-utek - basic_os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - basic_os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - basic_os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - basic_os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - basic_os=coff - ;; - morphos) - basic_machine=powerpc-unknown - basic_os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - basic_os=moxiebox - ;; - msdos) - basic_machine=i386-pc - basic_os=msdos - ;; - msys) - basic_machine=i686-pc - basic_os=msys - ;; - mvs) - basic_machine=i370-ibm - basic_os=mvs - ;; - nacl) - basic_machine=le32-unknown - basic_os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - basic_os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - basic_os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - basic_os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - basic_os=newsos - ;; - news1000) - basic_machine=m68030-sony - basic_os=newsos - ;; - necv70) - basic_machine=v70-nec - basic_os=sysv - ;; - nh3000) - basic_machine=m68k-harris - basic_os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - basic_os=cxux - ;; - nindy960) - basic_machine=i960-intel - basic_os=nindy - ;; - mon960) - basic_machine=i960-intel - basic_os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - basic_os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - basic_os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - basic_os=ose - ;; - os68k) - basic_machine=m68k-none - basic_os=os68k - ;; - paragon) - basic_machine=i860-intel - basic_os=osf - ;; - parisc) - basic_machine=hppa-unknown - basic_os=linux - ;; - psp) - basic_machine=mipsallegrexel-sony - basic_os=psp - ;; - pw32) - basic_machine=i586-unknown - basic_os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - basic_os=rdos - ;; - rdos32) - basic_machine=i386-pc - basic_os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - basic_os=coff - ;; - sa29200) - basic_machine=a29k-amd - basic_os=udi - ;; - sei) - basic_machine=mips-sei - basic_os=seiux - ;; - sequent) - basic_machine=i386-sequent - basic_os= - ;; - sps7) - basic_machine=m68k-bull - basic_os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - basic_os= - ;; - stratus) - basic_machine=i860-stratus - basic_os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - basic_os= - ;; - sun2os3) - basic_machine=m68000-sun - basic_os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - basic_os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - basic_os= - ;; - sun3os3) - basic_machine=m68k-sun - basic_os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - basic_os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - basic_os= - ;; - sun4os3) - basic_machine=sparc-sun - basic_os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - basic_os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - basic_os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - basic_os= - ;; - sv1) - basic_machine=sv1-cray - basic_os=unicos - ;; - symmetry) - basic_machine=i386-sequent - basic_os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - basic_os=unicos - ;; - t90) - basic_machine=t90-cray - basic_os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - basic_os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - basic_os=tpf - ;; - udi29k) - basic_machine=a29k-amd - basic_os=udi - ;; - ultra3) - basic_machine=a29k-nyu - basic_os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - basic_os=none - ;; - vaxv) - basic_machine=vax-dec - basic_os=sysv - ;; - vms) - basic_machine=vax-dec - basic_os=vms - ;; - vsta) - basic_machine=i386-pc - basic_os=vsta - ;; - vxworks960) - basic_machine=i960-wrs - basic_os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - basic_os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - basic_os=vxworks - ;; - xbox) - basic_machine=i686-pc - basic_os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - basic_os=unicos - ;; - *) - basic_machine=$1 - basic_os= - ;; - esac - ;; -esac - -# Decode 1-component or ad-hoc basic machines -case $basic_machine in - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. - w89k) - cpu=hppa1.1 - vendor=winbond - ;; - op50n) - cpu=hppa1.1 - vendor=oki - ;; - op60c) - cpu=hppa1.1 - vendor=oki - ;; - ibm*) - cpu=i370 - vendor=ibm - ;; - orion105) - cpu=clipper - vendor=highlevel - ;; - mac | mpw | mac-mpw) - cpu=m68k - vendor=apple - ;; - pmac | pmac-mpw) - cpu=powerpc - vendor=apple - ;; - - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att - ;; - 3b*) - cpu=we32k - vendor=att - ;; - bluegene*) - cpu=powerpc - vendor=ibm - basic_os=cnk - ;; - decsystem10* | dec10*) - cpu=pdp10 - vendor=dec - basic_os=tops10 - ;; - decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - basic_os=tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - cpu=m68k - vendor=motorola - ;; - dpx2*) - cpu=m68k - vendor=bull - basic_os=sysv3 - ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore - ;; - elxsi) - cpu=elxsi - vendor=elxsi - basic_os=${basic_os:-bsd} - ;; - fx2800) - cpu=i860 - vendor=alliant - ;; - genix) - cpu=ns32k - vendor=ns - ;; - h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp - ;; - hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - i*86v32) - cpu=$(echo "$1" | sed -e 's/86.*/86/') - vendor=pc - basic_os=sysv32 - ;; - i*86v4*) - cpu=$(echo "$1" | sed -e 's/86.*/86/') - vendor=pc - basic_os=sysv4 - ;; - i*86v) - cpu=$(echo "$1" | sed -e 's/86.*/86/') - vendor=pc - basic_os=sysv - ;; - i*86sol2) - cpu=$(echo "$1" | sed -e 's/86.*/86/') - vendor=pc - basic_os=solaris2 - ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - basic_os=${basic_os:-unicos} - ;; - iris | iris4d) - cpu=mips - vendor=sgi - case $basic_os in - irix*) - ;; - *) - basic_os=irix4 - ;; - esac - ;; - miniframe) - cpu=m68000 - vendor=convergent - ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - basic_os=mint - ;; - news-3600 | risc-news) - cpu=mips - vendor=sony - basic_os=newsos - ;; - next | m*-next) - cpu=m68k - vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac - ;; - np1) - cpu=np1 - vendor=gould - ;; - op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - basic_os=proelf - ;; - pa-hitachi) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - pbd) - cpu=sparc - vendor=tti - ;; - pbb) - cpu=m68k - vendor=tti - ;; - pc532) - cpu=ns32k - vendor=pc532 - ;; - pn) - cpu=pn - vendor=gould - ;; - power) - cpu=power - vendor=ibm - ;; - ps2) - cpu=i386 - vendor=ibm - ;; - rm[46]00) - cpu=mips - vendor=siemens - ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm - ;; - sde) - cpu=mipsisa32 - vendor=sde - basic_os=${basic_os:-elf} - ;; - simso-wrs) - cpu=sparclite - vendor=wrs - basic_os=vxworks - ;; - tower | tower-32) - cpu=m68k - vendor=ncr - ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu - ;; - w65) - cpu=w65 - vendor=wdc - ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - basic_os=proelf - ;; - none) - cpu=none - vendor=none - ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine - ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=$(echo "$basic_machine" | sed 's/-.*//') - ;; - - *-*) - # shellcheck disable=SC2162 - IFS="-" read cpu vendor <&2 - exit 1 - ;; - esac - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec - ;; - commodore*) - vendor=cbm - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if test x$basic_os != x -then - -# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just -# set os. -case $basic_os in - gnu/linux*) - kernel=linux - os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') - ;; - os2-emx) - kernel=os2 - os=$(echo $basic_os | sed -e 's|os2-emx|emx|') - ;; - nto-qnx*) - kernel=nto - os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') - ;; - *-*) - # shellcheck disable=SC2162 - IFS="-" read kernel os <&2 - exit 1 - ;; -esac - -# As a final step for OS-related things, validate the OS-kernel combination -# (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) - ;; - uclinux-uclibc* ) - ;; - -dietlibc* | -newlib* | -musl* | -uclibc* ) - # These are just libc implementations, not actual OSes, and thus - # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 - exit 1 - ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) - ;; - nto-qnx*) - ;; - os2-emx) - ;; - *-eabi* | *-gnueabi*) - ;; - -*) - # Blank kernel with real OS is always fine. - ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 - exit 1 - ;; -esac - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) - case $cpu-$os in - *-riscix*) - vendor=acorn - ;; - *-sunos*) - vendor=sun - ;; - *-cnk* | *-aix*) - vendor=ibm - ;; - *-beos*) - vendor=be - ;; - *-hpux*) - vendor=hp - ;; - *-mpeix*) - vendor=hp - ;; - *-hiux*) - vendor=hitachi - ;; - *-unos*) - vendor=crds - ;; - *-dgux*) - vendor=dg - ;; - *-luna*) - vendor=omron - ;; - *-genix*) - vendor=ns - ;; - *-clix*) - vendor=intergraph - ;; - *-mvs* | *-opened*) - vendor=ibm - ;; - *-os400*) - vendor=ibm - ;; - s390-* | s390x-*) - vendor=ibm - ;; - *-ptx*) - vendor=sequent - ;; - *-tpf*) - vendor=ibm - ;; - *-vxsim* | *-vxworks* | *-windiss*) - vendor=wrs - ;; - *-aux*) - vendor=apple - ;; - *-hms*) - vendor=hitachi - ;; - *-mpw* | *-macos*) - vendor=apple - ;; - *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) - vendor=atari - ;; - *-vos*) - vendor=stratus - ;; - esac - ;; -esac - -echo "$cpu-$vendor-${kernel:+$kernel-}$os" -exit - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/citadel/configure b/citadel/configure new file mode 100755 index 000000000..4f2304d72 --- /dev/null +++ b/citadel/configure @@ -0,0 +1,103 @@ +#!/bin/sh + +# CONFIGURE SCRIPT FOR CITADEL SERVER +# This file is part of "conf-IG-ure" +# Copyright (C) 2016-2022 by Art Cancro +# +# This program is open source software. Use, duplication, and/or +# disclosure are subject to the GNU General Purpose License version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +echo +echo +echo Running the configure script to create config.mk +echo + +# Parse the command line arguments +for x in $* +do + a=$1 + k=`echo $a | awk -F= ' { print $1 } '` + v=`echo $a | awk -F= ' { print $2 } '` + + case $k in + --prefix) + PREFIX=$v + ;; + --bindir) + BINDIR=$v + ;; + --ctdldir) + CTDLDIR=$v + ;; + --with-ssl) + SSL=yes + ;; + --without-ssl) + SSL=no + ;; + *) + echo $0 : unknown option $k + echo + echo Valid options are: + echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]' + echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]' + echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]' + echo ' --with-ssl Force build with OpenSSL support [normally autodetected]' + echo ' --without-ssl Force build without OpenSSL support [normally autodetected]' + exit 1 + ;; + esac + shift +done + +# Set any missing values (FIXME remove the ultra-fatal -W options when finished converting from autotools) + +[ "$PREFIX" = "" ] && PREFIX=/usr/local/citadel +[ "$BINDIR" = "" ] && BINDIR=${PREFIX} +[ "$CTDLDIR" = "" ] && CTDLDIR=${PREFIX} +[ "$CFLAGS" = "" ] && CFLAGS='-ggdb -Werror -Wfatal-errors -Wno-discarded-qualifiers' +[ "$LDFLAGS" = "" ] && LDFLAGS='' + +# Test for OpenSSL +[ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && { + echo Testing for OpenSSL... + tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$ + tempcc=${tempfile}.c + cat >$tempcc < +int main(int argc, char **argv) { + SSL_load_error_strings(); + exit(0); +} +! + SSL='no'; + cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && SSL='yes' + rm -f $tempfile 2>/dev/null + rm -f $tempcc 2>/dev/null +} +echo SSL: $SSL +[ "$SSL" = "yes" ] && { + CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' + LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' +} + +# FIXME do a real build id here +CFLAGS=${CFLAGS}' -DBUILD_ID=\"unknown\"' + +# Output the config.mk + +( + echo "CFLAGS := ${CFLAGS}" + echo "LDFLAGS := ${LDFLAGS}" + echo "PREFIX := ${PREFIX}" + echo "BINDIR := ${BINDIR}" + echo "CTDLDIR := ${CTDLDIR}" +) >config.mk + +cat config.mk +echo diff --git a/citadel/missing b/citadel/missing deleted file mode 100755 index 0a7fb5a2a..000000000 --- a/citadel/missing +++ /dev/null @@ -1,283 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.3 - GNU automake" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - tar) - shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar ${1+"$@"} && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar ${1+"$@"} && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" ${1+"$@"} && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" ${1+"$@"} && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/citadel/modules/blog/serv_blog.c b/citadel/modules/blog/serv_blog.c deleted file mode 100644 index 98bc938d3..000000000 --- a/citadel/modules/blog/serv_blog.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Support for blog rooms - * - * Copyright (c) 1999-2011 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "sysdep.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "serv_vcard.h" -#include "citadel_ldap.h" -#include "ctdl_module.h" - -/* - * Pre-save hook for saving a message in a blog room. - * (Do we want to only do this for top-level messages?) - */ -int blog_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) { - - /* Only run this hook for blog rooms */ - if (CC->room.QRdefaultview != VIEW_BLOG) { - return(0); - } - - /* - * If the message doesn't have an EUID, give it one. - */ - if (CM_IsEmpty(msg, eExclusiveID)) - { - char uuid[SIZ]; - generate_uuid(uuid); - CM_SetField(msg, eExclusiveID, uuid, strlen(uuid)); - } - - /* - * We also want to define a maximum length, whether we generated it or not. - */ - CM_CutFieldAt(msg, eExclusiveID, BLOG_EUIDBUF_SIZE - 1); - - /* Now allow the save to complete. */ - return(0); -} - - -CTDL_MODULE_INIT(blog) -{ - if (!threading) - { - CtdlRegisterMessageHook(blog_upload_beforesave, EVT_BEFORESAVE); - } - - /* return our module id for the Log */ - return "blog"; -} diff --git a/citadel/scripts/mk_svn_revision.sh b/citadel/scripts/mk_svn_revision.sh deleted file mode 100755 index 9a68d27bd..000000000 --- a/citadel/scripts/mk_svn_revision.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# -# Script to generate svn_revision.c -# - -ECHO=/usr/bin/printf - - -SCRIPT_DIR=`dirname $0` -SRC_DIR=`dirname $SCRIPT_DIR` -CUR_DIR=`pwd` -C_FILE="$CUR_DIR/svn_revision.c" -H_FILE="$CUR_DIR/svn_revision.h" - -# determine if this code base came from subversion. -if test -d $SRC_DIR/.svn ; then - echo "have subversion repository" - SVNVERSION=`which svnversion` - if test -x $SVNVERSION ; then - echo "have svnversion at $SVNVERSION" - BUILD=`svnversion -n .` - echo "This code base svn-revision: $BUILD" - CAN_BUILD_SVN_REVISION="yes" - fi -else - if test -d $SRC_DIR/../.git ; then - echo "have Git repository." - BUILD=`/usr/bin/env git log -1 --pretty=%h . ` - echo "This code base git-revision: $BUILD" - CAN_BUILD_SVN_REVISION="yes" - else - if test -f $C_FILE; then - exit - fi - fi -fi - -if [ "$CAN_BUILD_SVN_REVISION" = "yes" ] ; then - -cat < $C_FILE -/* - * Subversion / GIT revision functions - * - * Autogenerated at make/release time - * - * Do not modify this file - * - */ - -const char *svn_revision (void) -{ - const char *SVN_Version = "$BUILD"; - return SVN_Version; -} -EOF - -elif test ! -f $C_FILE ; then - -cat < $C_FILE -/* - * Subversion / GIT revision functions - * - * Autogenerated at make time - * - * There should have been one with your source distribution - * - * Do not modify this file - * - */ - -const char *svn_revision (void) -{ - const char *SVN_Version = "(unknown)"; - return SVN_Version; -} -EOF - -fi diff --git a/citadel/citadel.h b/citadel/server/citadel.h similarity index 100% rename from citadel/citadel.h rename to citadel/server/citadel.h diff --git a/citadel/citadel_dirs.c b/citadel/server/citadel_dirs.c similarity index 100% rename from citadel/citadel_dirs.c rename to citadel/server/citadel_dirs.c diff --git a/citadel/citadel_dirs.h b/citadel/server/citadel_dirs.h similarity index 100% rename from citadel/citadel_dirs.h rename to citadel/server/citadel_dirs.h diff --git a/citadel/citadel_ldap.h b/citadel/server/citadel_ldap.h similarity index 100% rename from citadel/citadel_ldap.h rename to citadel/server/citadel_ldap.h diff --git a/citadel/citserver.c b/citadel/server/citserver.c similarity index 99% rename from citadel/citserver.c rename to citadel/server/citserver.c index 2d829f1dd..5c668a71c 100644 --- a/citadel/citserver.c +++ b/citadel/server/citserver.c @@ -1,6 +1,6 @@ // Main source module for the Citadel server // -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. diff --git a/citadel/citserver.h b/citadel/server/citserver.h similarity index 100% rename from citadel/citserver.h rename to citadel/server/citserver.h diff --git a/citadel/clientsocket.c b/citadel/server/clientsocket.c similarity index 100% rename from citadel/clientsocket.c rename to citadel/server/clientsocket.c diff --git a/citadel/clientsocket.h b/citadel/server/clientsocket.h similarity index 100% rename from citadel/clientsocket.h rename to citadel/server/clientsocket.h diff --git a/citadel/config.c b/citadel/server/config.c similarity index 100% rename from citadel/config.c rename to citadel/server/config.c diff --git a/citadel/config.h b/citadel/server/config.h similarity index 100% rename from citadel/config.h rename to citadel/server/config.h diff --git a/citadel/context.c b/citadel/server/context.c similarity index 100% rename from citadel/context.c rename to citadel/server/context.c diff --git a/citadel/context.h b/citadel/server/context.h similarity index 100% rename from citadel/context.h rename to citadel/server/context.h diff --git a/citadel/control.c b/citadel/server/control.c similarity index 99% rename from citadel/control.c rename to citadel/server/control.c index 645904267..4efe823fc 100644 --- a/citadel/control.c +++ b/citadel/server/control.c @@ -1,7 +1,7 @@ // // This module handles states which are global to the entire server. // -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. @@ -190,7 +190,7 @@ long get_new_message_number(void) /* * CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system - * This provides a quick way to initialise a variable that might be used to indicate + * This provides a quick way to initialize a variable that might be used to indicate * messages that should not be processed. For example, an inbox rules script will use this * to record determine that messages older than this should not be processed. * @@ -793,8 +793,7 @@ void cmd_gvdn(char *argbuf) /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ -CTDL_MODULE_INIT(control) -{ +char *ctdl_module_init_control(void) { if (!threading) { int i; @@ -805,6 +804,6 @@ CTDL_MODULE_INIT(control) CtdlRegisterProtoHook(cmd_gvdn, "GVDN", "get valid domain names"); CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration"); } - /* return our id for the Log */ + /* return our id for the log */ return "control"; } diff --git a/citadel/control.h b/citadel/server/control.h similarity index 100% rename from citadel/control.h rename to citadel/server/control.h diff --git a/citadel/ctdl_module.h b/citadel/server/ctdl_module.h similarity index 99% rename from citadel/ctdl_module.h rename to citadel/server/ctdl_module.h index 0ddfc6970..6156d0c20 100644 --- a/citadel/ctdl_module.h +++ b/citadel/server/ctdl_module.h @@ -43,6 +43,9 @@ #include "citadel_dirs.h" #include "context.h" +extern int threading; + + /* * define macros for module init stuff */ @@ -175,7 +178,7 @@ void CtdlBumpNewMailCounter(long which_user); /* * CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system - * This provides a quick way to initialise a variable that might be used to indicate + * This provides a quick way to initialize a variable that might be used to indicate * messages that should not be processed. For example, a new inbox script will use this * to record determine that messages older than this should not be processed. * This function is defined in control.c diff --git a/citadel/database.c b/citadel/server/database.c similarity index 98% rename from citadel/database.c rename to citadel/server/database.c index 45b5d2734..eb4dae515 100644 --- a/citadel/database.c +++ b/citadel/server/database.c @@ -1,6 +1,6 @@ // This is a data store backend for the Citadel server which uses Berkeley DB. // -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or // modify it under the terms of the GNU General Public License version 3. @@ -55,7 +55,7 @@ void cdb_abort(void) { /* Verbose logging callback */ -void cdb_verbose_log(const DB_ENV * dbenv, const char *msg) { +void cdb_verbose_log(const DB_ENV *dbenv, const char *msg, const char *what_is_this) { if (!IsEmptyStr(msg)) { syslog(LOG_DEBUG, "db: %s", msg); } @@ -63,7 +63,7 @@ void cdb_verbose_log(const DB_ENV * dbenv, const char *msg) { /* Verbose logging callback */ -void cdb_verbose_err(const DB_ENV * dbenv, const char *errpfx, const char *msg) { +void cdb_verbose_err(const DB_ENV *dbenv, const char *errpfx, const char *msg) { syslog(LOG_ERR, "db: %s", msg); } @@ -801,8 +801,7 @@ int CheckIfAlreadySeen(StrBuf *guid) { } -CTDL_MODULE_INIT(database) -{ +char *ctdl_module_init_database() { if (!threading) { // nothing to do here } diff --git a/citadel/database.h b/citadel/server/database.h similarity index 100% rename from citadel/database.h rename to citadel/server/database.h diff --git a/citadel/default_timezone.c b/citadel/server/default_timezone.c similarity index 100% rename from citadel/default_timezone.c rename to citadel/server/default_timezone.c diff --git a/citadel/default_timezone.h b/citadel/server/default_timezone.h similarity index 100% rename from citadel/default_timezone.h rename to citadel/server/default_timezone.h diff --git a/citadel/domain.c b/citadel/server/domain.c similarity index 100% rename from citadel/domain.c rename to citadel/server/domain.c diff --git a/citadel/domain.h b/citadel/server/domain.h similarity index 100% rename from citadel/domain.h rename to citadel/server/domain.h diff --git a/citadel/euidindex.c b/citadel/server/euidindex.c similarity index 98% rename from citadel/euidindex.c rename to citadel/server/euidindex.c index 59d67deb9..0e8daf9ce 100644 --- a/citadel/euidindex.c +++ b/citadel/server/euidindex.c @@ -204,11 +204,10 @@ void cmd_euid(char *cmdbuf) { } -CTDL_MODULE_INIT(euidindex) -{ +char *ctdl_module_init_euidindex(void) { if (!threading) { CtdlRegisterProtoHook(cmd_euid, "EUID", "Perform operations on Extended IDs for messages"); } - /* return our Subversion id for the Log */ + /* return our id for the log */ return "euidindex"; } diff --git a/citadel/euidindex.h b/citadel/server/euidindex.h similarity index 100% rename from citadel/euidindex.h rename to citadel/server/euidindex.h diff --git a/citadel/genstamp.c b/citadel/server/genstamp.c similarity index 100% rename from citadel/genstamp.c rename to citadel/server/genstamp.c diff --git a/citadel/genstamp.h b/citadel/server/genstamp.h similarity index 100% rename from citadel/genstamp.h rename to citadel/server/genstamp.h diff --git a/citadel/housekeeping.c b/citadel/server/housekeeping.c similarity index 100% rename from citadel/housekeeping.c rename to citadel/server/housekeeping.c diff --git a/citadel/housekeeping.h b/citadel/server/housekeeping.h similarity index 100% rename from citadel/housekeeping.h rename to citadel/server/housekeeping.h diff --git a/citadel/internet_addressing.c b/citadel/server/internet_addressing.c similarity index 99% rename from citadel/internet_addressing.c rename to citadel/server/internet_addressing.c index e67a9dc12..59e078f9c 100644 --- a/citadel/internet_addressing.c +++ b/citadel/server/internet_addressing.c @@ -610,7 +610,6 @@ struct recptypes *validate_recipients(char *supplied_recipients, const char *Rem err = CtdlDoIHavePermissionToPostInThisRoom( // check for write permissions to room errmsg, sizeof errmsg, - RemoteIdentifier, Flags, 0 // 0 means "this is not a reply" ); diff --git a/citadel/internet_addressing.h b/citadel/server/internet_addressing.h similarity index 100% rename from citadel/internet_addressing.h rename to citadel/server/internet_addressing.h diff --git a/citadel/ipcdef.h b/citadel/server/ipcdef.h similarity index 100% rename from citadel/ipcdef.h rename to citadel/server/ipcdef.h diff --git a/citadel/journaling.c b/citadel/server/journaling.c similarity index 100% rename from citadel/journaling.c rename to citadel/server/journaling.c diff --git a/citadel/journaling.h b/citadel/server/journaling.h similarity index 100% rename from citadel/journaling.h rename to citadel/server/journaling.h diff --git a/citadel/ldap.c b/citadel/server/ldap.c similarity index 98% rename from citadel/ldap.c rename to citadel/server/ldap.c index 5c54953c1..3a16117cd 100644 --- a/citadel/ldap.c +++ b/citadel/server/ldap.c @@ -27,6 +27,11 @@ int ctdl_require_ldap_version = 3; #include +// These functions are deprecated and until we change them to the new API we need these declarations to get around compiler warnings. +int ldap_simple_bind_s(LDAP *, const char *, const char *); +int ldap_unbind(LDAP *); + + // Utility function, supply a search result and get back the fullname (display name, common name, etc) from the first result // // POSIX schema: the display name will be found in "cn" (common name) @@ -102,6 +107,7 @@ int ctdl_ldap_initialize(LDAP **ld) { int ret; snprintf(server_url, sizeof server_url, "ldap://%s:%d", CtdlGetConfigStr("c_ldap_host"), CtdlGetConfigInt("c_ldap_port")); + syslog(LOG_DEBUG, "ldap: initializing server %s", server_url); ret = ldap_initialize(ld, server_url); if (ret != LDAP_SUCCESS) { syslog(LOG_ERR, "ldap: could not connect to %s : %m", server_url); diff --git a/citadel/locate_host.c b/citadel/server/locate_host.c similarity index 100% rename from citadel/locate_host.c rename to citadel/server/locate_host.c diff --git a/citadel/locate_host.h b/citadel/server/locate_host.h similarity index 100% rename from citadel/locate_host.h rename to citadel/server/locate_host.h diff --git a/citadel/modules/autocompletion/.gitignore b/citadel/server/modules/autocompletion/.gitignore similarity index 100% rename from citadel/modules/autocompletion/.gitignore rename to citadel/server/modules/autocompletion/.gitignore diff --git a/citadel/modules/autocompletion/serv_autocompletion.c b/citadel/server/modules/autocompletion/serv_autocompletion.c similarity index 96% rename from citadel/modules/autocompletion/serv_autocompletion.c rename to citadel/server/modules/autocompletion/serv_autocompletion.c index 0e39b6435..732bd7145 100644 --- a/citadel/modules/autocompletion/serv_autocompletion.c +++ b/citadel/server/modules/autocompletion/serv_autocompletion.c @@ -1,7 +1,7 @@ /* * Autocompletion of email recipients, etc. * - * Copyright (c) 1987-2020 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -13,9 +13,9 @@ */ -#include "ctdl_module.h" +#include "../../ctdl_module.h" #include "serv_autocompletion.h" -#include "config.h" +#include "../../config.h" /* @@ -216,10 +216,8 @@ void cmd_auto(char *argbuf) { } -CTDL_MODULE_INIT(autocompletion) -{ - if (!threading) - { +char *ctdl_module_init_autocompletion(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_auto, "AUTO", "Do recipient autocompletion"); } /* return our module name for the log */ diff --git a/citadel/modules/autocompletion/serv_autocompletion.h b/citadel/server/modules/autocompletion/serv_autocompletion.h similarity index 100% rename from citadel/modules/autocompletion/serv_autocompletion.h rename to citadel/server/modules/autocompletion/serv_autocompletion.h diff --git a/citadel/modules/bio/.gitignore b/citadel/server/modules/bio/.gitignore similarity index 100% rename from citadel/modules/bio/.gitignore rename to citadel/server/modules/bio/.gitignore diff --git a/citadel/modules/bio/serv_bio.c b/citadel/server/modules/bio/serv_bio.c similarity index 96% rename from citadel/modules/bio/serv_bio.c rename to citadel/server/modules/bio/serv_bio.c index e6e1dd20b..b973bb5a9 100644 --- a/citadel/modules/bio/serv_bio.c +++ b/citadel/server/modules/bio/serv_bio.c @@ -1,8 +1,8 @@ /* - * This module implementsserver commands related to the display and + * This module implements server commands related to the display and * manipulation of user "bio" files. * - * Copyright (c) 1987-2021 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ * GNU General Public License for more details. */ -#include "ctdl_module.h" -#include "config.h" +#include "../../ctdl_module.h" +#include "../../config.h" #include #include @@ -216,10 +216,8 @@ void import_old_bio_files(void) -CTDL_MODULE_INIT(bio) -{ - if (!threading) - { +char *ctdl_module_init_bio(void) { + if (!threading) { import_old_bio_files(); CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio"); CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio"); diff --git a/citadel/server/modules/blog/serv_blog.c b/citadel/server/modules/blog/serv_blog.c new file mode 100644 index 000000000..e4cfca5fc --- /dev/null +++ b/citadel/server/modules/blog/serv_blog.c @@ -0,0 +1,80 @@ +// Support for blog rooms +// +// Copyright (c) 1999-2022 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#include "../../sysdep.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../serv_vcard.h" +#include "../../citadel_ldap.h" +#include "../../ctdl_module.h" + +// Pre-save hook for saving a message in a blog room. +// (Do we want to only do this for top-level messages?) +int blog_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) { + + // Only run this hook for blog rooms + if (CC->room.QRdefaultview != VIEW_BLOG) { + return(0); + } + + // If the message doesn't have an EUID, give it one. + if (CM_IsEmpty(msg, eExclusiveID)) { + char uuid[SIZ]; + generate_uuid(uuid); + CM_SetField(msg, eExclusiveID, uuid, strlen(uuid)); + } + + // We also want to define a maximum length, whether we generated it or not. + CM_CutFieldAt(msg, eExclusiveID, BLOG_EUIDBUF_SIZE - 1); + + // Now allow the save to complete. + return(0); +} + + +// Module initialization +char *ctdl_module_init_blog(void) { + if (!threading) { + CtdlRegisterMessageHook(blog_upload_beforesave, EVT_BEFORESAVE); + } + + // return our module id for the log + return "blog"; +} diff --git a/citadel/modules/calendar/.gitignore b/citadel/server/modules/calendar/.gitignore similarity index 100% rename from citadel/modules/calendar/.gitignore rename to citadel/server/modules/calendar/.gitignore diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c similarity index 99% rename from citadel/modules/calendar/serv_calendar.c rename to citadel/server/modules/calendar/serv_calendar.c index 0a9090d17..682045898 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -3,7 +3,7 @@ * room on a Citadel server. It handles iCalendar objects using the * iTIP protocol. See RFCs 2445 and 2446. * - * Copyright (c) 1987-2021 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -16,15 +16,15 @@ #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN" -#include "ctdl_module.h" +#include "../../ctdl_module.h" #include -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_calendar.h" -#include "room_ops.h" -#include "euidindex.h" -#include "default_timezone.h" -#include "config.h" +#include "../../room_ops.h" +#include "../../euidindex.h" +#include "../../default_timezone.h" +#include "../../config.h" struct ical_respond_data { char desired_partnum[SIZ]; @@ -2534,10 +2534,8 @@ void ical_fixed_output(char *ptr, int len) { /* * Register this module with the Citadel server. */ -CTDL_MODULE_INIT(calendar) -{ - if (!threading) - { +char *ctdl_module_init_calendar(void) { + if (!threading) { /* Tell libical to return errors instead of aborting if it gets bad data */ diff --git a/citadel/modules/calendar/serv_calendar.h b/citadel/server/modules/calendar/serv_calendar.h similarity index 100% rename from citadel/modules/calendar/serv_calendar.h rename to citadel/server/modules/calendar/serv_calendar.h diff --git a/citadel/modules/checkpoint/.gitignore b/citadel/server/modules/checkpoint/.gitignore similarity index 100% rename from citadel/modules/checkpoint/.gitignore rename to citadel/server/modules/checkpoint/.gitignore diff --git a/citadel/modules/checkpoint/serv_checkpoint.c b/citadel/server/modules/checkpoint/serv_checkpoint.c similarity index 65% rename from citadel/modules/checkpoint/serv_checkpoint.c rename to citadel/server/modules/checkpoint/serv_checkpoint.c index 578622b2e..090bfd6af 100644 --- a/citadel/modules/checkpoint/serv_checkpoint.c +++ b/citadel/server/modules/checkpoint/serv_checkpoint.c @@ -1,7 +1,7 @@ /* * checkpointing module for the database * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -22,21 +22,18 @@ #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "msgbase.h" -#include "sysdep_decls.h" -#include "config.h" -#include "threads.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../msgbase.h" +#include "../../sysdep_decls.h" +#include "../../config.h" +#include "../../threads.h" +#include "../../ctdl_module.h" +#include "../../context.h" -#include "ctdl_module.h" -#include "context.h" - -CTDL_MODULE_INIT(checkpoint) -{ - if (threading) - { +char *ctdl_module_init_checkpoint(void) { + if (threading) { CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10); } /* return our module name for the log */ diff --git a/citadel/modules/clamav/.gitignore b/citadel/server/modules/clamav/.gitignore similarity index 100% rename from citadel/modules/clamav/.gitignore rename to citadel/server/modules/clamav/.gitignore diff --git a/citadel/modules/clamav/serv_virus.c b/citadel/server/modules/clamav/serv_virus.c similarity index 89% rename from citadel/modules/clamav/serv_virus.c rename to citadel/server/modules/clamav/serv_virus.c index c5599b9de..2913006cb 100644 --- a/citadel/modules/clamav/serv_virus.c +++ b/citadel/server/modules/clamav/serv_virus.c @@ -4,7 +4,7 @@ * http://clamav.net (the ClamAV project is not in any way * affiliated with the Citadel project). * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -17,7 +17,7 @@ #define CLAMD_PORT "3310" -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -32,19 +32,19 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "domain.h" -#include "clientsocket.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../domain.h" +#include "../../clientsocket.h" +#include "../../ctdl_module.h" /* @@ -168,10 +168,8 @@ bail: close(sock); } -CTDL_MODULE_INIT(virus) -{ - if (!threading) - { +char *ctdl_module_init_virus(void) { + if (!threading) { CtdlRegisterMessageHook(clamd, EVT_SMTPSCAN); } diff --git a/citadel/modules/crypto/.gitignore b/citadel/server/modules/crypto/.gitignore similarity index 100% rename from citadel/modules/crypto/.gitignore rename to citadel/server/modules/crypto/.gitignore diff --git a/citadel/modules/crypto/serv_crypto.c b/citadel/server/modules/crypto/serv_crypto.c similarity index 98% rename from citadel/modules/crypto/serv_crypto.c rename to citadel/server/modules/crypto/serv_crypto.c index f78c0cd85..4f1609230 100644 --- a/citadel/modules/crypto/serv_crypto.c +++ b/citadel/server/modules/crypto/serv_crypto.c @@ -12,7 +12,7 @@ #include #include #include -#include "sysdep.h" +#include "../../sysdep.h" #ifdef HAVE_OPENSSL #include @@ -32,12 +32,12 @@ #include #include -#include "server.h" +#include "../../server.h" #include "serv_crypto.h" -#include "sysdep_decls.h" -#include "citadel.h" -#include "config.h" -#include "ctdl_module.h" +#include "../../sysdep_decls.h" +#include "../../citadel.h" +#include "../../config.h" +#include "../../ctdl_module.h" #ifdef HAVE_OPENSSL @@ -522,7 +522,7 @@ void CtdlStartTLS(char *ok_response, char *nosup_response, char *error_response) } if (!ssl_ctx) { - syslog(LOG_ERR, "crypto: SSL failed: context has not been initialized"); + syslog(LOG_ERR, "crypto: SSL failed: ../../context.has not been initialized"); if (nosup_response != NULL) { cprintf("%s", nosup_response); } diff --git a/citadel/modules/crypto/serv_crypto.h b/citadel/server/modules/crypto/serv_crypto.h similarity index 100% rename from citadel/modules/crypto/serv_crypto.h rename to citadel/server/modules/crypto/serv_crypto.h diff --git a/citadel/modules/ctdlproto/files.h b/citadel/server/modules/ctdlproto/files.h similarity index 100% rename from citadel/modules/ctdlproto/files.h rename to citadel/server/modules/ctdlproto/files.h diff --git a/citadel/modules/ctdlproto/serv_ctdlproto.c b/citadel/server/modules/ctdlproto/serv_ctdlproto.c similarity index 96% rename from citadel/modules/ctdlproto/serv_ctdlproto.c rename to citadel/server/modules/ctdlproto/serv_ctdlproto.c index cf51e62c3..ae267b596 100644 --- a/citadel/modules/ctdlproto/serv_ctdlproto.c +++ b/citadel/server/modules/ctdlproto/serv_ctdlproto.c @@ -15,9 +15,9 @@ #include #include -#include "citserver.h" -#include "ctdl_module.h" -#include "config.h" +#include "../../citserver.h" +#include "../../ctdl_module.h" +#include "../../config.h" /* * This loop recognizes all server commands. */ diff --git a/citadel/modules/ctdlproto/serv_file.c b/citadel/server/modules/ctdlproto/serv_file.c similarity index 98% rename from citadel/modules/ctdlproto/serv_file.c rename to citadel/server/modules/ctdlproto/serv_file.c index 9af465e4d..d26657810 100644 --- a/citadel/modules/ctdlproto/serv_file.c +++ b/citadel/server/modules/ctdlproto/serv_file.c @@ -1,7 +1,7 @@ /* * Server functions which handle file transfers and room directories. * - * Copyright (c) 1987-2018 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -20,11 +20,11 @@ #include #include #include -#include "ctdl_module.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" +#include "../../ctdl_module.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" /* @@ -663,10 +663,9 @@ void cmd_emsg(char *mname) /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ -CTDL_MODULE_INIT(file_ops) -{ +char *ctdl_module_init_file_ops(void) { if (!threading) { - CtdlRegisterSessionHook(files_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 8); + CtdlRegisterSessionHook(files_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 8); CtdlRegisterProtoHook(cmd_delf, "DELF", "Delete a file"); CtdlRegisterProtoHook(cmd_movf, "MOVF", "Move a file"); CtdlRegisterProtoHook(cmd_open, "OPEN", "Open a download file transfer"); diff --git a/citadel/modules/ctdlproto/serv_messages.c b/citadel/server/modules/ctdlproto/serv_messages.c similarity index 99% rename from citadel/modules/ctdlproto/serv_messages.c rename to citadel/server/modules/ctdlproto/serv_messages.c index 480f84995..4036c9e0a 100644 --- a/citadel/modules/ctdlproto/serv_messages.c +++ b/citadel/server/modules/ctdlproto/serv_messages.c @@ -12,12 +12,12 @@ #include #include -#include "citserver.h" -#include "ctdl_module.h" -#include "internet_addressing.h" -#include "user_ops.h" -#include "room_ops.h" -#include "config.h" +#include "../../citserver.h" +#include "../../ctdl_module.h" +#include "../../internet_addressing.h" +#include "../../user_ops.h" +#include "../../room_ops.h" +#include "../../config.h" extern char *msgkeys[]; @@ -420,7 +420,6 @@ void cmd_ent0(char *entargs) { err = CtdlDoIHavePermissionToPostInThisRoom( errmsg, sizeof errmsg, - NULL, POST_LOGGED_IN, (!IsEmptyStr(references)) // is this a reply? or a top-level post? ); @@ -819,10 +818,8 @@ void cmd_move(char *args) { /*****************************************************************************/ /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ -CTDL_MODULE_INIT(ctdl_message) -{ +char *ctdl_module_init_ctdl_message(void) { if (!threading) { - CtdlRegisterProtoHook(cmd_msgs, "MSGS", "Output a list of messages in the current room"); CtdlRegisterProtoHook(cmd_msg0, "MSG0", "Output a message in plain text format"); CtdlRegisterProtoHook(cmd_msg2, "MSG2", "Output a message in RFC822 format"); diff --git a/citadel/modules/ctdlproto/serv_rooms.c b/citadel/server/modules/ctdlproto/serv_rooms.c similarity index 99% rename from citadel/modules/ctdlproto/serv_rooms.c rename to citadel/server/modules/ctdlproto/serv_rooms.c index 2e9450fee..16c69b7e0 100644 --- a/citadel/modules/ctdlproto/serv_rooms.c +++ b/citadel/server/modules/ctdlproto/serv_rooms.c @@ -18,10 +18,10 @@ #include /* for cmd_rdir to read contents of the directory */ #include -#include "citserver.h" -#include "ctdl_module.h" -#include "room_ops.h" -#include "config.h" +#include "../../citserver.h" +#include "../../ctdl_module.h" +#include "../../room_ops.h" +#include "../../config.h" // Back-back-end for all room listing commands void list_roomname(struct ctdlroom *qrbuf, int ra, int current_view, int default_view) { @@ -1020,8 +1020,7 @@ void cmd_stat(char *gargs) { /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ -CTDL_MODULE_INIT(rooms) -{ +char *ctdl_module_init_rooms(void) { if (!threading) { CtdlRegisterProtoHook(cmd_lrms, "LRMS", "List rooms"); CtdlRegisterProtoHook(cmd_lkra, "LKRA", "List all known rooms"); @@ -1046,6 +1045,6 @@ CTDL_MODULE_INIT(rooms) CtdlRegisterProtoHook(cmd_kflr, "KFLR", "Kill a floor"); CtdlRegisterProtoHook(cmd_eflr, "EFLR", "Edit a floor"); } - /* return our Subversion id for the Log */ + /* return our id for the log */ return "rooms"; } diff --git a/citadel/modules/ctdlproto/serv_session.c b/citadel/server/modules/ctdlproto/serv_session.c similarity index 96% rename from citadel/modules/ctdlproto/serv_session.c rename to citadel/server/modules/ctdlproto/serv_session.c index 697cc9371..cb41b535d 100644 --- a/citadel/modules/ctdlproto/serv_session.c +++ b/citadel/server/modules/ctdlproto/serv_session.c @@ -1,7 +1,7 @@ /* * Server functions which perform operations on user objects. * - * Copyright (c) 1987-2020 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -14,10 +14,9 @@ #include #include -#include "citserver.h" -#include "svn_revision.h" -#include "ctdl_module.h" -#include "config.h" +#include "../../citserver.h" +#include "../../ctdl_module.h" +#include "../../config.h" void cmd_noop(char *argbuf) @@ -84,7 +83,7 @@ void cmd_info(char *cmdbuf) { cprintf("0\n"); /* no longer used */ cprintf("%d\n", CtdlGetConfigInt("c_enable_fulltext")); - cprintf("%s\n", svn_revision()); + cprintf("%s\n", BUILD_ID); if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_NATIVE) { cprintf("%d\n", openid_level_supported); /* OpenID is enabled when using native auth */ @@ -213,8 +212,7 @@ void cmd_time(char *argbuf) /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ -CTDL_MODULE_INIT(serv_session) -{ +char *ctdl_module_init_serv_session(void) { if (!threading) { CtdlRegisterProtoHook(cmd_noop, "NOOP", "no operation"); CtdlRegisterProtoHook(cmd_qnop, "QNOP", "no operation with no response"); diff --git a/citadel/modules/ctdlproto/serv_syscmds.c b/citadel/server/modules/ctdlproto/serv_syscmds.c similarity index 93% rename from citadel/modules/ctdlproto/serv_syscmds.c rename to citadel/server/modules/ctdlproto/serv_syscmds.c index 28e2ea606..a397149a4 100644 --- a/citadel/modules/ctdlproto/serv_syscmds.c +++ b/citadel/server/modules/ctdlproto/serv_syscmds.c @@ -1,6 +1,6 @@ // System management commands for Citadel server // -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License, version 3. @@ -13,8 +13,8 @@ #include #include -#include "serv_extensions.h" -#include "ctdl_module.h" +#include "../../serv_extensions.h" +#include "../../ctdl_module.h" // Shut down or restart the server @@ -75,8 +75,7 @@ void cmd_scdn(char *argbuf) { // * MODULE INITIALIZATION STUFF * // **************************************************************************** -CTDL_MODULE_INIT(syscmd) -{ +char *ctdl_module_init_syscmd(void) { if (!threading) { CtdlRegisterProtoHook(cmd_down, "DOWN", "perform a server shutdown"); CtdlRegisterProtoHook(cmd_halt, "HALT", "halt the server without exiting the server process"); diff --git a/citadel/modules/ctdlproto/serv_user.c b/citadel/server/modules/ctdlproto/serv_user.c similarity index 98% rename from citadel/modules/ctdlproto/serv_user.c rename to citadel/server/modules/ctdlproto/serv_user.c index 7e95335bb..d88731745 100644 --- a/citadel/modules/ctdlproto/serv_user.c +++ b/citadel/server/modules/ctdlproto/serv_user.c @@ -11,13 +11,13 @@ // GNU General Public License for more details. -#include "support.h" -#include "control.h" -#include "ctdl_module.h" -#include "citserver.h" -#include "config.h" -#include "user_ops.h" -#include "internet_addressing.h" +#include "../../support.h" +#include "../../control.h" +#include "../../ctdl_module.h" +#include "../../citserver.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../internet_addressing.h" // USER command -- attempt to log in as an existing user @@ -779,8 +779,7 @@ void cmd_lout(char *argbuf) { /*****************************************************************************/ -CTDL_MODULE_INIT(serv_user) -{ +char *ctdl_module_init_serv_user(void) { if (!threading) { CtdlRegisterProtoHook(cmd_user, "USER", "Submit username for login"); CtdlRegisterProtoHook(cmd_pass, "PASS", "Complete login by submitting a password"); diff --git a/citadel/modules/expire/.gitignore b/citadel/server/modules/expire/.gitignore similarity index 100% rename from citadel/modules/expire/.gitignore rename to citadel/server/modules/expire/.gitignore diff --git a/citadel/modules/expire/expire_policy.c b/citadel/server/modules/expire/expire_policy.c similarity index 93% rename from citadel/modules/expire/expire_policy.c rename to citadel/server/modules/expire/expire_policy.c index 0c9471bbf..6aaeeff93 100644 --- a/citadel/modules/expire/expire_policy.c +++ b/citadel/server/modules/expire/expire_policy.c @@ -11,7 +11,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -21,17 +21,17 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "database.h" -#include "config.h" -#include "room_ops.h" -#include "sysdep_decls.h" -#include "support.h" -#include "msgbase.h" -#include "citserver.h" -#include "ctdl_module.h" -#include "user_ops.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../database.h" +#include "../../config.h" +#include "../../room_ops.h" +#include "../../sysdep_decls.h" +#include "../../support.h" +#include "../../msgbase.h" +#include "../../citserver.h" +#include "../../ctdl_module.h" +#include "../../user_ops.h" /* * Retrieve the applicable expire policy for a specific room diff --git a/citadel/modules/expire/policy.h b/citadel/server/modules/expire/policy.h similarity index 100% rename from citadel/modules/expire/policy.h rename to citadel/server/modules/expire/policy.h diff --git a/citadel/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c similarity index 98% rename from citadel/modules/expire/serv_expire.c rename to citadel/server/modules/expire/serv_expire.c index a3c2258d0..f204751cb 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -15,7 +15,7 @@ // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -29,20 +29,20 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" #include "policy.h" -#include "database.h" -#include "msgbase.h" -#include "user_ops.h" -#include "control.h" -#include "threads.h" -#include "context.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../user_ops.h" +#include "../../control.h" +#include "../../threads.h" +#include "../../context.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" struct PurgeList { @@ -823,10 +823,8 @@ void cmd_tdap(char *argbuf) { } -CTDL_MODULE_INIT(expire) -{ - if (!threading) - { +char *ctdl_module_init_expire(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger"); CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Get expire policy"); CtdlRegisterProtoHook(cmd_spex, "SPEX", "Set expire policy"); diff --git a/citadel/modules/fulltext/.gitignore b/citadel/server/modules/fulltext/.gitignore similarity index 100% rename from citadel/modules/fulltext/.gitignore rename to citadel/server/modules/fulltext/.gitignore diff --git a/citadel/modules/fulltext/crc16.c b/citadel/server/modules/fulltext/crc16.c similarity index 100% rename from citadel/modules/fulltext/crc16.c rename to citadel/server/modules/fulltext/crc16.c diff --git a/citadel/modules/fulltext/crc16.h b/citadel/server/modules/fulltext/crc16.h similarity index 100% rename from citadel/modules/fulltext/crc16.h rename to citadel/server/modules/fulltext/crc16.h diff --git a/citadel/modules/fulltext/ft_wordbreaker.c b/citadel/server/modules/fulltext/ft_wordbreaker.c similarity index 92% rename from citadel/modules/fulltext/ft_wordbreaker.c rename to citadel/server/modules/fulltext/ft_wordbreaker.c index b236de362..d5a07d43c 100644 --- a/citadel/modules/fulltext/ft_wordbreaker.c +++ b/citadel/server/modules/fulltext/ft_wordbreaker.c @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -27,18 +27,18 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "database.h" -#include "msgbase.h" -#include "control.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../control.h" #include "ft_wordbreaker.h" #include "crc16.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" /* * Noise words are not included in search indices. diff --git a/citadel/modules/fulltext/ft_wordbreaker.h b/citadel/server/modules/fulltext/ft_wordbreaker.h similarity index 100% rename from citadel/modules/fulltext/ft_wordbreaker.h rename to citadel/server/modules/fulltext/ft_wordbreaker.h diff --git a/citadel/modules/fulltext/serv_fulltext.c b/citadel/server/modules/fulltext/serv_fulltext.c similarity index 96% rename from citadel/modules/fulltext/serv_fulltext.c rename to citadel/server/modules/fulltext/serv_fulltext.c index dc5b2b15c..5ecba6077 100644 --- a/citadel/modules/fulltext/serv_fulltext.c +++ b/citadel/server/modules/fulltext/serv_fulltext.c @@ -1,6 +1,6 @@ /* * This module handles fulltext indexing of the message base. - * Copyright (c) 2005-2021 by the citadel.org team + * Copyright (c) 2005-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -31,20 +31,19 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "database.h" -#include "msgbase.h" -#include "control.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../control.h" #include "serv_fulltext.h" #include "ft_wordbreaker.h" -#include "threads.h" -#include "context.h" - -#include "ctdl_module.h" +#include "../../threads.h" +#include "../../context.h" +#include "../../ctdl_module.h" long ft_newhighest = 0L; long *ft_newmsgs = NULL; @@ -463,10 +462,8 @@ void ft_delete_remove(char *room, long msgnum) /*****************************************************************************/ -CTDL_MODULE_INIT(fulltext) -{ - if (!threading) - { +char *ctdl_module_init_fulltext(void) { + if (!threading) { initialize_ft_cache(); CtdlRegisterProtoHook(cmd_srch, "SRCH", "Full text search"); CtdlRegisterDeleteHook(ft_delete_remove); diff --git a/citadel/modules/fulltext/serv_fulltext.h b/citadel/server/modules/fulltext/serv_fulltext.h similarity index 100% rename from citadel/modules/fulltext/serv_fulltext.h rename to citadel/server/modules/fulltext/serv_fulltext.h diff --git a/citadel/modules/image/serv_image.c b/citadel/server/modules/image/serv_image.c similarity index 98% rename from citadel/modules/image/serv_image.c rename to citadel/server/modules/image/serv_image.c index 6be5afc30..e6b520f82 100644 --- a/citadel/modules/image/serv_image.c +++ b/citadel/server/modules/image/serv_image.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2021 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -12,8 +12,8 @@ * GNU General Public License for more details. */ -#include "ctdl_module.h" -#include "config.h" +#include "../../ctdl_module.h" +#include "../../config.h" #include #include #include @@ -340,10 +340,8 @@ void import_old_userpic_files(void) { -CTDL_MODULE_INIT(image) -{ - if (!threading) - { +char *ctdl_module_init_image(void) { + if (!threading) { import_old_userpic_files(); CtdlRegisterProtoHook(cmd_dlri, "DLRI", "DownLoad Room Image"); CtdlRegisterProtoHook(cmd_ulri, "ULRI", "UpLoad Room Image"); diff --git a/citadel/modules/imap/.gitignore b/citadel/server/modules/imap/.gitignore similarity index 100% rename from citadel/modules/imap/.gitignore rename to citadel/server/modules/imap/.gitignore diff --git a/citadel/modules/imap/imap_acl.c b/citadel/server/modules/imap/imap_acl.c similarity index 95% rename from citadel/modules/imap/imap_acl.c rename to citadel/server/modules/imap/imap_acl.c index 97b5f9630..6c98f2eda 100644 --- a/citadel/modules/imap/imap_acl.c +++ b/citadel/server/modules/imap/imap_acl.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -33,22 +33,22 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" #include "imap_misc.h" -#include "genstamp.h" -#include "ctdl_module.h" +#include "../../genstamp.h" +#include "../../ctdl_module.h" /* diff --git a/citadel/modules/imap/imap_acl.h b/citadel/server/modules/imap/imap_acl.h similarity index 100% rename from citadel/modules/imap/imap_acl.h rename to citadel/server/modules/imap/imap_acl.h diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/server/modules/imap/imap_fetch.c similarity index 99% rename from citadel/modules/imap/imap_fetch.c rename to citadel/server/modules/imap/imap_fetch.c index 1e33fabf2..f2d37b366 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/server/modules/imap/imap_fetch.c @@ -16,7 +16,7 @@ */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -31,21 +31,21 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" -#include "genstamp.h" -#include "ctdl_module.h" +#include "../../genstamp.h" +#include "../../ctdl_module.h" diff --git a/citadel/modules/imap/imap_fetch.h b/citadel/server/modules/imap/imap_fetch.h similarity index 100% rename from citadel/modules/imap/imap_fetch.h rename to citadel/server/modules/imap/imap_fetch.h diff --git a/citadel/modules/imap/imap_list.c b/citadel/server/modules/imap/imap_list.c similarity index 96% rename from citadel/modules/imap/imap_list.c rename to citadel/server/modules/imap/imap_list.c index 1be8bab29..a256a5cbc 100644 --- a/citadel/modules/imap/imap_list.c +++ b/citadel/server/modules/imap/imap_list.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -33,16 +33,16 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" @@ -51,7 +51,7 @@ #include "imap_acl.h" #include "imap_misc.h" #include "imap_list.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" typedef struct __ImapRoomListFilter { diff --git a/citadel/modules/imap/imap_list.h b/citadel/server/modules/imap/imap_list.h similarity index 100% rename from citadel/modules/imap/imap_list.h rename to citadel/server/modules/imap/imap_list.h diff --git a/citadel/modules/imap/imap_metadata.c b/citadel/server/modules/imap/imap_metadata.c similarity index 95% rename from citadel/modules/imap/imap_metadata.c rename to citadel/server/modules/imap/imap_metadata.c index 5d5e95f9c..425000ad0 100644 --- a/citadel/modules/imap/imap_metadata.c +++ b/citadel/server/modules/imap/imap_metadata.c @@ -21,7 +21,7 @@ */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -36,23 +36,22 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" #include "imap_misc.h" -#include "genstamp.h" - -#include "ctdl_module.h" +#include "../../genstamp.h" +#include "../../ctdl_module.h" /* * Implements the SETMETADATA command. diff --git a/citadel/modules/imap/imap_metadata.h b/citadel/server/modules/imap/imap_metadata.h similarity index 100% rename from citadel/modules/imap/imap_metadata.h rename to citadel/server/modules/imap/imap_metadata.h diff --git a/citadel/modules/imap/imap_misc.c b/citadel/server/modules/imap/imap_misc.c similarity index 95% rename from citadel/modules/imap/imap_misc.c rename to citadel/server/modules/imap/imap_misc.c index 4cd8ece66..50bd71424 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/server/modules/imap/imap_misc.c @@ -13,7 +13,7 @@ */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -28,23 +28,23 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "room_ops.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../room_ops.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" #include "imap_misc.h" -#include "genstamp.h" -#include "ctdl_module.h" +#include "../../genstamp.h" +#include "../../ctdl_module.h" @@ -371,7 +371,7 @@ void imap_append(int num_parms, ConstStr *Params) { /* * Can we post here? */ - ret = CtdlDoIHavePermissionToPostInThisRoom(errbuf, sizeof errbuf, NULL, POST_LOGGED_IN, 0); + ret = CtdlDoIHavePermissionToPostInThisRoom(errbuf, sizeof errbuf, POST_LOGGED_IN, 0); if (ret) { /* Nope ... print an error message */ diff --git a/citadel/modules/imap/imap_misc.h b/citadel/server/modules/imap/imap_misc.h similarity index 100% rename from citadel/modules/imap/imap_misc.h rename to citadel/server/modules/imap/imap_misc.h diff --git a/citadel/modules/imap/imap_search.c b/citadel/server/modules/imap/imap_search.c similarity index 97% rename from citadel/modules/imap/imap_search.c rename to citadel/server/modules/imap/imap_search.c index efc199202..ecf670c1d 100644 --- a/citadel/modules/imap/imap_search.c +++ b/citadel/server/modules/imap/imap_search.c @@ -12,10 +12,10 @@ * GNU General Public License for more details. */ -#include "ctdl_module.h" +#include "../../ctdl_module.h" -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -30,21 +30,21 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" #include "imap_search.h" -#include "genstamp.h" +#include "../../genstamp.h" /* diff --git a/citadel/modules/imap/imap_search.h b/citadel/server/modules/imap/imap_search.h similarity index 100% rename from citadel/modules/imap/imap_search.h rename to citadel/server/modules/imap/imap_search.h diff --git a/citadel/modules/imap/imap_store.c b/citadel/server/modules/imap/imap_store.c similarity index 94% rename from citadel/modules/imap/imap_store.c rename to citadel/server/modules/imap/imap_store.c index 429f8edbb..479a10486 100644 --- a/citadel/modules/imap/imap_store.c +++ b/citadel/server/modules/imap/imap_store.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ctdl_module.h" +#include "../../ctdl_module.h" #include #include @@ -34,22 +34,22 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "sysdep_decls.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "room_ops.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../sysdep_decls.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../room_ops.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_fetch.h" #include "imap_store.h" -#include "genstamp.h" +#include "../../genstamp.h" /* diff --git a/citadel/modules/imap/imap_store.h b/citadel/server/modules/imap/imap_store.h similarity index 100% rename from citadel/modules/imap/imap_store.h rename to citadel/server/modules/imap/imap_store.h diff --git a/citadel/modules/imap/imap_tools.c b/citadel/server/modules/imap/imap_tools.c similarity index 99% rename from citadel/modules/imap/imap_tools.c rename to citadel/server/modules/imap/imap_tools.c index 7d7c0805c..96cdfc518 100644 --- a/citadel/modules/imap/imap_tools.c +++ b/citadel/server/modules/imap/imap_tools.c @@ -27,12 +27,12 @@ #include #include #include -#include "citadel.h" -#include "sysdep_decls.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../sysdep_decls.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" /* String handling helpers */ diff --git a/citadel/modules/imap/imap_tools.h b/citadel/server/modules/imap/imap_tools.h similarity index 100% rename from citadel/modules/imap/imap_tools.h rename to citadel/server/modules/imap/imap_tools.h diff --git a/citadel/modules/imap/serv_imap.c b/citadel/server/modules/imap/serv_imap.c similarity index 98% rename from citadel/modules/imap/serv_imap.c rename to citadel/server/modules/imap/serv_imap.c index 1609f8ee5..048e470c2 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/server/modules/imap/serv_imap.c @@ -1,7 +1,7 @@ /* * IMAP server for the Citadel system * - * Copyright (C) 2000-2021 by Art Cancro and others. + * Copyright (C) 2000-2022 by Art Cancro and others. * This code is released under the terms of the GNU General Public License. * * WARNING: the IMAP protocol is badly designed. No implementation of it @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -34,15 +34,15 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_imap.h" #include "imap_tools.h" #include "imap_list.h" @@ -53,7 +53,7 @@ #include "imap_metadata.h" #include "imap_misc.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" HashList *ImapCmds = NULL; void registerImapCMD(const char *First, long FLen, const char *Second, long SLen, @@ -1365,19 +1365,9 @@ void imap_rename_backend(struct ctdlroom *qrbuf, void *data) imap_mailboxname(foldername, sizeof foldername, qrbuf); /* Rename subfolders */ - if ((!strncasecmp(foldername, myirlparms->oldname, - myirlparms->oldnamelen) - && (foldername[myirlparms->oldnamelen] == '/'))) { - - sprintf(newfoldername, "%s/%s", - myirlparms->newname, - &foldername[myirlparms->oldnamelen + 1] - ); - - newfloor = imap_roomname(newroomname, - sizeof newroomname, - newfoldername) & 0xFF; - + if ((!strncasecmp(foldername, myirlparms->oldname, myirlparms->oldnamelen) && (foldername[myirlparms->oldnamelen] == '/'))) { + snprintf(newfoldername, sizeof newfoldername, "%s/%s", myirlparms->newname, &foldername[myirlparms->oldnamelen + 1]); + newfloor = imap_roomname(newroomname, sizeof newroomname, newfoldername) & 0xFF; irlp = (struct irl *) malloc(sizeof(struct irl)); strcpy(irlp->irl_newroom, newroomname); strcpy(irlp->irl_oldroom, qrbuf->QRname); @@ -1664,10 +1654,10 @@ const char *CitadelServiceIMAPS="IMAPS"; /* * This function is called to register the IMAP extension with Citadel. */ -CTDL_MODULE_INIT(imap) -{ - if (ImapCmds == NULL) +char *ctdl_module_init_imap(void) { + if (ImapCmds == NULL) { ImapCmds = NewHash(1, NULL); + } RegisterImapCMD("NOOP", "", imap_noop, I_FLAG_NONE); RegisterImapCMD("CHECK", "", imap_noop, I_FLAG_NONE); @@ -1714,8 +1704,7 @@ CTDL_MODULE_INIT(imap) RegisterImapCMD("UID", "EXPUNGE", imap_expunge, I_FLAG_LOGGED_IN | I_FLAG_SELECT); RegisterImapCMD("CLOSE", "", imap_close, I_FLAG_LOGGED_IN | I_FLAG_SELECT); - if (!threading) - { + if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP); #ifdef HAVE_OPENSSL diff --git a/citadel/modules/imap/serv_imap.h b/citadel/server/modules/imap/serv_imap.h similarity index 100% rename from citadel/modules/imap/serv_imap.h rename to citadel/server/modules/imap/serv_imap.h diff --git a/citadel/modules/inboxrules/.gitignore b/citadel/server/modules/inboxrules/.gitignore similarity index 100% rename from citadel/modules/inboxrules/.gitignore rename to citadel/server/modules/inboxrules/.gitignore diff --git a/citadel/modules/inboxrules/serv_inboxrules.c b/citadel/server/modules/inboxrules/serv_inboxrules.c similarity index 98% rename from citadel/modules/inboxrules/serv_inboxrules.c rename to citadel/server/modules/inboxrules/serv_inboxrules.c index a1a5f7c9b..17340a1c2 100644 --- a/citadel/modules/inboxrules/serv_inboxrules.c +++ b/citadel/server/modules/inboxrules/serv_inboxrules.c @@ -10,7 +10,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -24,15 +24,15 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" // The next sections are enums and keys that drive the serialize/deserialize functions for the inbox rules/state configuration. @@ -967,10 +967,8 @@ void cmd_pibr(char *argbuf) { } -CTDL_MODULE_INIT(sieve) -{ - if (!threading) - { +char *ctdl_module_init_sieve(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_gibr, "GIBR", "Get InBox Rules"); CtdlRegisterProtoHook(cmd_pibr, "PIBR", "Put InBox Rules"); CtdlRegisterRoomHook(serv_inboxrules_roomhook); diff --git a/citadel/modules/inetcfg/.gitignore b/citadel/server/modules/inetcfg/.gitignore similarity index 100% rename from citadel/modules/inetcfg/.gitignore rename to citadel/server/modules/inetcfg/.gitignore diff --git a/citadel/modules/inetcfg/serv_inetcfg.c b/citadel/server/modules/inetcfg/serv_inetcfg.c similarity index 86% rename from citadel/modules/inetcfg/serv_inetcfg.c rename to citadel/server/modules/inetcfg/serv_inetcfg.c index 814659d28..ee763a920 100644 --- a/citadel/modules/inetcfg/serv_inetcfg.c +++ b/citadel/server/modules/inetcfg/serv_inetcfg.c @@ -4,7 +4,7 @@ * wrote it as a module merely to keep things as clean and loosely coupled * as possible. * - * Copyright (c) 1987-2021 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -15,7 +15,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -29,18 +29,18 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "genstamp.h" -#include "domain.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../genstamp.h" +#include "../../domain.h" +#include "../../ctdl_module.h" void inetcfg_setTo(struct CtdlMessage *msg) { @@ -127,10 +127,8 @@ void inetcfg_init(void) { /*****************************************************************************/ -CTDL_MODULE_INIT(inetcfg) -{ - if (!threading) - { +char *ctdl_module_init_inetcfg(void) { + if (!threading) { CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE); inetcfg_init(); } diff --git a/citadel/modules/instmsg/.gitignore b/citadel/server/modules/instmsg/.gitignore similarity index 100% rename from citadel/modules/instmsg/.gitignore rename to citadel/server/modules/instmsg/.gitignore diff --git a/citadel/modules/instmsg/serv_instmsg.c b/citadel/server/modules/instmsg/serv_instmsg.c similarity index 97% rename from citadel/modules/instmsg/serv_instmsg.c rename to citadel/server/modules/instmsg/serv_instmsg.c index b54276cfd..1e2d0f043 100644 --- a/citadel/modules/instmsg/serv_instmsg.c +++ b/citadel/server/modules/instmsg/serv_instmsg.c @@ -1,7 +1,7 @@ /* * This module handles instant messaging between users. * - * Copyright (c) 1987-2020 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -12,7 +12,6 @@ * GNU General Public License for more details. */ -#include "sysdep.h" #include #include #include @@ -26,15 +25,17 @@ #include #include #include -#include "citadel.h" -#include "server.h" +#include "../../sysdep.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../context.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../msgbase.h" +#include "../../user_ops.h" +#include "../../ctdl_module.h" #include "serv_instmsg.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "msgbase.h" -#include "user_ops.h" -#include "ctdl_module.h" struct imlog { struct imlog *next; @@ -566,10 +567,8 @@ void instmsg_shutdown(void) { flush_conversations_to_disk(0); /* Get it ALL onto disk NOW. */ } -CTDL_MODULE_INIT(instmsg) -{ - if (!threading) - { +char *ctdl_module_init_instmsg(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get instant messages"); CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an instant message"); CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable instant messages"); diff --git a/citadel/modules/instmsg/serv_instmsg.h b/citadel/server/modules/instmsg/serv_instmsg.h similarity index 92% rename from citadel/modules/instmsg/serv_instmsg.h rename to citadel/server/modules/instmsg/serv_instmsg.h index a1654a056..a73848622 100644 --- a/citadel/modules/instmsg/serv_instmsg.h +++ b/citadel/server/modules/instmsg/serv_instmsg.h @@ -1,4 +1,3 @@ -#include "ctdl_module.h" void ChatUnloadingTest(void); void allwrite (char *cmdbuf, int flag, char *username); diff --git a/citadel/modules/listdeliver/serv_listdeliver.c b/citadel/server/modules/listdeliver/serv_listdeliver.c similarity index 95% rename from citadel/modules/listdeliver/serv_listdeliver.c rename to citadel/server/modules/listdeliver/serv_listdeliver.c index 043d9c7e5..e3b1d23d7 100644 --- a/citadel/modules/listdeliver/serv_listdeliver.c +++ b/citadel/server/modules/listdeliver/serv_listdeliver.c @@ -10,7 +10,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -26,17 +26,17 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "clientsocket.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../clientsocket.h" +#include "../../ctdl_module.h" int doing_listdeliver = 0; @@ -239,8 +239,7 @@ void listdeliver_sweep(void) { // Module entry point -CTDL_MODULE_INIT(listdeliver) -{ +char *ctdl_module_init_listdeliver(void) { if (!threading) { CtdlRegisterSessionHook(listdeliver_sweep, EVT_TIMER, PRIO_AGGR + 50); } diff --git a/citadel/modules/listsub/.gitignore b/citadel/server/modules/listsub/.gitignore similarity index 100% rename from citadel/modules/listsub/.gitignore rename to citadel/server/modules/listsub/.gitignore diff --git a/citadel/modules/listsub/serv_listsub.c b/citadel/server/modules/listsub/serv_listsub.c similarity index 96% rename from citadel/modules/listsub/serv_listsub.c rename to citadel/server/modules/listsub/serv_listsub.c index 7d7e93693..80adb60f0 100644 --- a/citadel/modules/listsub/serv_listsub.c +++ b/citadel/server/modules/listsub/serv_listsub.c @@ -12,7 +12,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -29,17 +29,17 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "clientsocket.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../clientsocket.h" +#include "../../ctdl_module.h" enum { // one of these gets passed to do_subscribe_or_unsubscribe() so it knows what we asked for @@ -294,10 +294,8 @@ void cmd_lsub(char *cmdbuf) { /* * Module entry point */ -CTDL_MODULE_INIT(listsub) -{ - if (!threading) - { +char *ctdl_module_init_listsub(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_lsub, "LSUB", "List subscribe/unsubscribe"); } diff --git a/citadel/modules/migrate/.gitignore b/citadel/server/modules/migrate/.gitignore similarity index 100% rename from citadel/modules/migrate/.gitignore rename to citadel/server/modules/migrate/.gitignore diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/server/modules/migrate/serv_migrate.c similarity index 98% rename from citadel/modules/migrate/serv_migrate.c rename to citadel/server/modules/migrate/serv_migrate.c index 31815f485..698cf1cbc 100644 --- a/citadel/modules/migrate/serv_migrate.c +++ b/citadel/server/modules/migrate/serv_migrate.c @@ -1,6 +1,6 @@ // This module dumps and/or loads the Citadel database in XML format. // -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3. @@ -24,7 +24,7 @@ // // These tags are inserted into the XML stream to give the reader an approximation of its progress. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -40,16 +40,16 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "database.h" -#include "msgbase.h" -#include "user_ops.h" -#include "euidindex.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../user_ops.h" +#include "../../euidindex.h" +#include "../../ctdl_module.h" char migr_tempfilename1[PATH_MAX]; char migr_tempfilename2[PATH_MAX]; @@ -1118,10 +1118,8 @@ void cmd_migr(char *cmdbuf) { // * Module Hook * // ****************************************************************************** -CTDL_MODULE_INIT(migrate) -{ - if (!threading) - { +char *ctdl_module_init_migrate() { + if (!threading) { CtdlRegisterProtoHook(cmd_migr, "MIGR", "Across-the-wire migration"); } diff --git a/citadel/modules/newuser/.gitignore b/citadel/server/modules/newuser/.gitignore similarity index 100% rename from citadel/modules/newuser/.gitignore rename to citadel/server/modules/newuser/.gitignore diff --git a/citadel/modules/newuser/serv_newuser.c b/citadel/server/modules/newuser/serv_newuser.c similarity index 84% rename from citadel/modules/newuser/serv_newuser.c rename to citadel/server/modules/newuser/serv_newuser.c index 146dae710..751ecb314 100644 --- a/citadel/modules/newuser/serv_newuser.c +++ b/citadel/server/modules/newuser/serv_newuser.c @@ -2,7 +2,7 @@ * Automatically copies the contents of a "New User Greetings" room to the * inbox of any new user upon account creation. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -18,7 +18,7 @@ */ #define NEWUSERGREETINGS "New User Greetings" -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -31,15 +31,15 @@ #include #include #include -#include "ctdl_module.h" -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" +#include "../../ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" /* * Copy the contents of the New User Greetings> room to the user's Mail> room. @@ -81,10 +81,8 @@ void CopyNewUserGreetings(void) { } -CTDL_MODULE_INIT(newuser) -{ - if (!threading) - { +char *ctdl_module_init_newuser(void) { + if (!threading) { CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN, PRIO_LOGIN + 1); } diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/server/modules/nntp/serv_nntp.c similarity index 97% rename from citadel/modules/nntp/serv_nntp.c rename to citadel/server/modules/nntp/serv_nntp.c index 135d77392..5db995d74 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/server/modules/nntp/serv_nntp.c @@ -1,7 +1,7 @@ // // NNTP server module (RFC 3977) // -// Copyright (c) 2014-2020 by the citadel.org team +// Copyright (c) 2014-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3. @@ -12,7 +12,7 @@ // GNU General Public License for more details. // -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -32,23 +32,23 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "room_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "genstamp.h" -#include "domain.h" -#include "clientsocket.h" -#include "locate_host.h" -#include "citadel_dirs.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../room_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../genstamp.h" +#include "../../domain.h" +#include "../../clientsocket.h" +#include "../../locate_host.h" +#include "../../citadel_dirs.h" +#include "../../ctdl_module.h" #include "serv_nntp.h" #ifndef __FreeBSD__ @@ -1142,10 +1142,8 @@ void nntp_cleanup_function(void) { const char *CitadelServiceNNTP="NNTP"; const char *CitadelServiceNNTPS="NNTPS"; -CTDL_MODULE_INIT(nntp) -{ - if (!threading) - { +char *ctdl_module_init_nntp(void) { + if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_nntp_port"), NULL, nntp_greeting, diff --git a/citadel/modules/nntp/serv_nntp.h b/citadel/server/modules/nntp/serv_nntp.h similarity index 100% rename from citadel/modules/nntp/serv_nntp.h rename to citadel/server/modules/nntp/serv_nntp.h diff --git a/citadel/modules/nntp/wildmat.c b/citadel/server/modules/nntp/wildmat.c similarity index 100% rename from citadel/modules/nntp/wildmat.c rename to citadel/server/modules/nntp/wildmat.c diff --git a/citadel/modules/notes/.gitignore b/citadel/server/modules/notes/.gitignore similarity index 100% rename from citadel/modules/notes/.gitignore rename to citadel/server/modules/notes/.gitignore diff --git a/citadel/modules/notes/serv_notes.c b/citadel/server/modules/notes/serv_notes.c similarity index 90% rename from citadel/modules/notes/serv_notes.c rename to citadel/server/modules/notes/serv_notes.c index 4ae8ac077..2f32faef6 100644 --- a/citadel/modules/notes/serv_notes.c +++ b/citadel/server/modules/notes/serv_notes.c @@ -1,7 +1,7 @@ /* * Handles functions related to yellow sticky notes. * - * Copyright (c) 2007-2012 by the citadel.org team + * Copyright (c) 2007-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -26,15 +26,15 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../ctdl_module.h" /* @@ -145,10 +145,8 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp) } -CTDL_MODULE_INIT(notes) -{ - if (!threading) - { +char *ctdl_module_init_notes(void) { + if (!threading) { CtdlRegisterMessageHook(serv_notes_beforesave, EVT_BEFORESAVE); } diff --git a/citadel/modules/openid/.gitignore b/citadel/server/modules/openid/.gitignore similarity index 100% rename from citadel/modules/openid/.gitignore rename to citadel/server/modules/openid/.gitignore diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/server/modules/openid/serv_openid_rp.c similarity index 99% rename from citadel/modules/openid/serv_openid_rp.c rename to citadel/server/modules/openid/serv_openid_rp.c index bea03b42c..7f34b601f 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/server/modules/openid/serv_openid_rp.c @@ -1,7 +1,7 @@ /* * This is an implementation of OpenID 2.0 relying party support in stateless mode. * - * Copyright (c) 2007-2020 by the citadel.org team + * Copyright (c) 2007-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * along with this program; if not, see . */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -32,10 +32,10 @@ #include #include #include -#include "ctdl_module.h" -#include "config.h" -#include "citserver.h" -#include "user_ops.h" +#include "../../ctdl_module.h" +#include "../../config.h" +#include "../../citserver.h" +#include "../../user_ops.h" typedef struct _ctdl_openid { StrBuf *op_url; /* OpenID Provider Endpoint URL */ @@ -1145,12 +1145,8 @@ void cmd_oidf(char *argbuf) { /**************************************************************************/ - - -CTDL_MODULE_INIT(openid_rp) -{ +char *ctdl_module_init_openid_rp(void) { if (!threading) { - /* Only enable the OpenID command set when native mode authentication is in use. */ if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_NATIVE) { CtdlRegisterProtoHook(cmd_oids, "OIDS", "Setup OpenID authentication"); diff --git a/citadel/modules/pop3/.gitignore b/citadel/server/modules/pop3/.gitignore similarity index 100% rename from citadel/modules/pop3/.gitignore rename to citadel/server/modules/pop3/.gitignore diff --git a/citadel/modules/pop3/serv_pop3.c b/citadel/server/modules/pop3/serv_pop3.c similarity index 97% rename from citadel/modules/pop3/serv_pop3.c rename to citadel/server/modules/pop3/serv_pop3.c index 6cdd55cc2..7eca60dc9 100644 --- a/citadel/modules/pop3/serv_pop3.c +++ b/citadel/server/modules/pop3/serv_pop3.c @@ -1,6 +1,6 @@ // POP3 service for the Citadel system // -// Copyright (c) 1998-2021 by the citadel.org team +// Copyright (c) 1998-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3. @@ -19,7 +19,7 @@ // TradeMail, and certain versions of Eudora). // -> Capability detection via the method described in RFC2449 is implemented. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -34,17 +34,17 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" #include "serv_pop3.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" // This cleanup function blows away the temporary memory and files used by @@ -573,10 +573,8 @@ const char *CitadelServicePop3="POP3"; const char *CitadelServicePop3S="POP3S"; -CTDL_MODULE_INIT(pop3) -{ - if(!threading) - { +char *ctdl_module_init_pop3(void) { + if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3_port"), NULL, pop3_greeting, diff --git a/citadel/modules/pop3/serv_pop3.h b/citadel/server/modules/pop3/serv_pop3.h similarity index 100% rename from citadel/modules/pop3/serv_pop3.h rename to citadel/server/modules/pop3/serv_pop3.h diff --git a/citadel/modules/pop3client/.gitignore b/citadel/server/modules/pop3client/.gitignore similarity index 100% rename from citadel/modules/pop3client/.gitignore rename to citadel/server/modules/pop3client/.gitignore diff --git a/citadel/modules/pop3client/serv_pop3client.c b/citadel/server/modules/pop3client/serv_pop3client.c similarity index 93% rename from citadel/modules/pop3client/serv_pop3client.c rename to citadel/server/modules/pop3client/serv_pop3client.c index a859fb51e..d8fc9270e 100644 --- a/citadel/modules/pop3client/serv_pop3client.c +++ b/citadel/server/modules/pop3client/serv_pop3client.c @@ -1,7 +1,7 @@ /* * Consolidate mail from remote POP3 accounts. * - * Copyright (c) 2007-2021 by the citadel.org team + * Copyright (c) 2007-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -17,26 +17,26 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "ctdl_module.h" -#include "clientsocket.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "database.h" -#include "citadel_dirs.h" +#include +#include "../../sysconfig.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../ctdl_module.h" +#include "../../clientsocket.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../database.h" +#include "../../citadel_dirs.h" struct p3cq { // module-local queue of pop3 client work that needs processing struct p3cq *next; @@ -250,10 +250,8 @@ void pop3client_scan(void) { } -CTDL_MODULE_INIT(pop3client) -{ - if (!threading) - { +char *ctdl_module_init_pop3client(void) { + if (!threading) { CtdlRegisterSessionHook(pop3client_scan, EVT_TIMER, PRIO_AGGR + 50); } diff --git a/citadel/modules/roomchat/.gitignore b/citadel/server/modules/roomchat/.gitignore similarity index 100% rename from citadel/modules/roomchat/.gitignore rename to citadel/server/modules/roomchat/.gitignore diff --git a/citadel/modules/roomchat/serv_roomchat.c b/citadel/server/modules/roomchat/serv_roomchat.c similarity index 93% rename from citadel/modules/roomchat/serv_roomchat.c rename to citadel/server/modules/roomchat/serv_roomchat.c index 35a83dbac..4f3a71eae 100644 --- a/citadel/modules/roomchat/serv_roomchat.c +++ b/citadel/server/modules/roomchat/serv_roomchat.c @@ -1,7 +1,7 @@ /* * This module handles instant messaging between users. * - * Copyright (c) 2012 by the citadel.org team + * Copyright (c) 2012-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -11,7 +11,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -26,14 +26,14 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "msgbase.h" -#include "user_ops.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../msgbase.h" +#include "../../user_ops.h" +#include "../../ctdl_module.h" struct chatmsg { struct chatmsg *next; @@ -238,10 +238,8 @@ void cmd_rcht(char *argbuf) } -CTDL_MODULE_INIT(roomchat) -{ - if (!threading) - { +char *ctdl_module_init_roomchat(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_rcht, "RCHT", "Participate in real time chat in a room"); CtdlRegisterSessionHook(roomchat_timer, EVT_TIMER, PRIO_CLEANUP + 400); CtdlRegisterSessionHook(roomchat_shutdown, EVT_SHUTDOWN, PRIO_SHUTDOWN + 55); diff --git a/citadel/modules/rssclient/.gitignore b/citadel/server/modules/rssclient/.gitignore similarity index 100% rename from citadel/modules/rssclient/.gitignore rename to citadel/server/modules/rssclient/.gitignore diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/server/modules/rssclient/serv_rssclient.c similarity index 95% rename from citadel/modules/rssclient/serv_rssclient.c rename to citadel/server/modules/rssclient/serv_rssclient.c index e0fba5fdc..e23463a77 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/server/modules/rssclient/serv_rssclient.c @@ -3,7 +3,7 @@ * very loose parser that scrapes both kinds of feeds and is not picky about * the standards compliance of the source data. * - * Copyright (c) 2007-2021 by the citadel.org team + * Copyright (c) 2007-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 3. @@ -26,19 +26,19 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "threads.h" -#include "ctdl_module.h" -#include "msgbase.h" -#include "parsedate.h" -#include "database.h" -#include "citadel_dirs.h" -#include "context.h" -#include "internet_addressing.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../threads.h" +#include "../../ctdl_module.h" +#include "../../msgbase.h" +#include "../../parsedate.h" +#include "../../database.h" +#include "../../citadel_dirs.h" +#include "../../context.h" +#include "../../internet_addressing.h" struct rssroom { struct rssroom *next; @@ -451,10 +451,8 @@ void rssclient_scan(void) { } -CTDL_MODULE_INIT(rssclient) -{ - if (!threading) - { +char *ctdl_module_init_rssclient(void) { + if (!threading) { syslog(LOG_INFO, "rssclient: using %s", curl_version()); CtdlRegisterSessionHook(rssclient_scan, EVT_TIMER, PRIO_AGGR + 300); } diff --git a/citadel/modules/rwho/.gitignore b/citadel/server/modules/rwho/.gitignore similarity index 100% rename from citadel/modules/rwho/.gitignore rename to citadel/server/modules/rwho/.gitignore diff --git a/citadel/modules/rwho/serv_rwho.c b/citadel/server/modules/rwho/serv_rwho.c similarity index 90% rename from citadel/modules/rwho/serv_rwho.c rename to citadel/server/modules/rwho/serv_rwho.c index a134a8c25..ef1b7dac4 100644 --- a/citadel/modules/rwho/serv_rwho.c +++ b/citadel/server/modules/rwho/serv_rwho.c @@ -2,7 +2,7 @@ * This module implements server commands related to the display and * manipulation of the "Who's online" list. * - * Copyright (c) 1987-2019 by the citadel.org team + * Copyright (c) 1987-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -14,7 +14,7 @@ * */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -28,16 +28,16 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../ctdl_module.h" /* Don't show the names of private rooms unless the viewing * user also knows the rooms. @@ -177,10 +177,8 @@ void cmd_stel(char *cmdbuf) } -CTDL_MODULE_INIT(rwho) -{ - if(!threading) - { +char *ctdl_module_init_rwho(void) { + if (!threading) { CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online"); CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode"); //CtdlRegisterSessionHook(dead_io_check, EVT_TIMER, PRIO_QUEUE + 50); diff --git a/citadel/modules/smtp/.gitignore b/citadel/server/modules/smtp/.gitignore similarity index 100% rename from citadel/modules/smtp/.gitignore rename to citadel/server/modules/smtp/.gitignore diff --git a/citadel/modules/smtp/serv_smtp.c b/citadel/server/modules/smtp/serv_smtp.c similarity index 98% rename from citadel/modules/smtp/serv_smtp.c rename to citadel/server/modules/smtp/serv_smtp.c index b567f58e8..3a89d4e08 100644 --- a/citadel/modules/smtp/serv_smtp.c +++ b/citadel/server/modules/smtp/serv_smtp.c @@ -29,7 +29,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -49,23 +49,23 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "room_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "genstamp.h" -#include "domain.h" -#include "clientsocket.h" -#include "locate_host.h" -#include "citadel_dirs.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../room_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../genstamp.h" +#include "../../domain.h" +#include "../../clientsocket.h" +#include "../../locate_host.h" +#include "../../citadel_dirs.h" +#include "../../ctdl_module.h" #include "smtp_util.h" @@ -1018,8 +1018,7 @@ const char *CitadelServiceSMTP_LMTP="LMTP"; const char *CitadelServiceSMTP_LMTP_UNF="LMTP-UnF"; -CTDL_MODULE_INIT(smtp) -{ +char *ctdl_module_init_smtp(void) { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_smtp_port"), /* SMTP MTA */ NULL, diff --git a/citadel/modules/smtp/serv_smtpclient.c b/citadel/server/modules/smtp/serv_smtpclient.c similarity index 97% rename from citadel/modules/smtp/serv_smtpclient.c rename to citadel/server/modules/smtp/serv_smtpclient.c index b528b5f53..1ff3d6d3b 100644 --- a/citadel/modules/smtp/serv_smtpclient.c +++ b/citadel/server/modules/smtp/serv_smtpclient.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -26,18 +25,19 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "ctdl_module.h" -#include "clientsocket.h" -#include "msgbase.h" -#include "domain.h" -#include "internet_addressing.h" -#include "citadel_dirs.h" -#include "modules/smtp/smtp_util.h" +#include "../../sysconfig.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../ctdl_module.h" +#include "../../clientsocket.h" +#include "../../msgbase.h" +#include "../../domain.h" +#include "../../internet_addressing.h" +#include "../../citadel_dirs.h" +#include "../smtp/smtp_util.h" struct smtpmsgsrc { // Data passed in and out of libcurl for message upload StrBuf *TheMessage; @@ -559,8 +559,7 @@ void smtp_do_queue(void) { // Module entry point -CTDL_MODULE_INIT(smtpclient) -{ +char *ctdl_module_init_smtpclient(void) { if (!threading) { CtdlRegisterMessageHook(smtp_aftersave, EVT_AFTERSAVE); CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER, PRIO_AGGR + 51); diff --git a/citadel/modules/smtp/smtp_util.c b/citadel/server/modules/smtp/smtp_util.c similarity index 94% rename from citadel/modules/smtp/smtp_util.c rename to citadel/server/modules/smtp/smtp_util.c index a77f73dd6..d62df945d 100644 --- a/citadel/modules/smtp/smtp_util.c +++ b/citadel/server/modules/smtp/smtp_util.c @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -32,22 +32,22 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "genstamp.h" -#include "domain.h" -#include "clientsocket.h" -#include "locate_host.h" -#include "citadel_dirs.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../genstamp.h" +#include "../../domain.h" +#include "../../clientsocket.h" +#include "../../locate_host.h" +#include "../../citadel_dirs.h" +#include "../../ctdl_module.h" #include "smtp_util.h" const char *smtp_get_Recipients(void) { @@ -284,7 +284,7 @@ char *smtpcodes[][2] = { { "523", "Server limit exceeded. Message too large" }, { "530", "Access Denied. Authentication required" }, { "531", "Mail system Full" }, - { "533", "Remote server has insufficient disk space to hold email" }, + { "533", "Remote ../../server.has insufficient disk space to hold email" }, { "534", "Authentication mechanism is too weak. Message too big" }, { "535", "Multiple servers using same IP. Required Authentication" }, { "538", "Encryption required for requested authentication mechanism" }, diff --git a/citadel/modules/smtp/smtp_util.h b/citadel/server/modules/smtp/smtp_util.h similarity index 100% rename from citadel/modules/smtp/smtp_util.h rename to citadel/server/modules/smtp/smtp_util.h diff --git a/citadel/modules/spam/.gitignore b/citadel/server/modules/spam/.gitignore similarity index 100% rename from citadel/modules/spam/.gitignore rename to citadel/server/modules/spam/.gitignore diff --git a/citadel/modules/spam/serv_spam.c b/citadel/server/modules/spam/serv_spam.c similarity index 89% rename from citadel/modules/spam/serv_spam.c rename to citadel/server/modules/spam/serv_spam.c index 2b9331f93..97d1e23b6 100644 --- a/citadel/modules/spam/serv_spam.c +++ b/citadel/server/modules/spam/serv_spam.c @@ -4,7 +4,7 @@ * http://www.spamassassin.org (the SpamAssassin project is not in any way * affiliated with the Citadel project). * - * Copyright (c) 1998-2015 by the citadel.org team + * Copyright (c) 1998-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -17,7 +17,7 @@ #define SPAMASSASSIN_PORT "783" -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -32,21 +32,21 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "domain.h" -#include "clientsocket.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../domain.h" +#include "../../clientsocket.h" -#include "ctdl_module.h" +#include "../../ctdl_module.h" @@ -171,10 +171,8 @@ bail: close(sock); -CTDL_MODULE_INIT(spam) -{ - if (!threading) - { +char *ctdl_module_init_spam(void) { + if (!threading) { CtdlRegisterMessageHook(spam_assassin, EVT_SMTPSCAN); } diff --git a/citadel/modules/test/.gitignore b/citadel/server/modules/test/.gitignore similarity index 100% rename from citadel/modules/test/.gitignore rename to citadel/server/modules/test/.gitignore diff --git a/citadel/modules/test/serv_test.c b/citadel/server/modules/test/serv_test.c similarity index 54% rename from citadel/modules/test/serv_test.c rename to citadel/server/modules/test/serv_test.c index a7834ae8e..7445ac0bc 100644 --- a/citadel/modules/test/serv_test.c +++ b/citadel/server/modules/test/serv_test.c @@ -1,19 +1,17 @@ -/* - * This is an empty skeleton of a Citadel server module, included to demonstrate - * how to add a new module to the system and how to activate it in the server. - * - * Copyright (c) 1998-2016 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// This is an empty skeleton of a Citadel server module, included to demonstrate +// how to add a new module to the system and how to activate it in the server. +// +// Copyright (c) 1998-2022 by the citadel.org team +// +// This program is open source software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -26,7 +24,7 @@ #include #include #include -#include "ctdl_module.h" +#include "../../ctdl_module.h" void CleanupTest(void) { @@ -49,20 +47,20 @@ void LoginTest(void) { syslog(LOG_DEBUG, "--- Hello, %s ---\n", CC->curr_user); } -/* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */ -CTDL_MODULE_INIT(test) -{ +// To insert this module into the server activate the next block by changing the #if 0 to #if 1 +char *ctdl_module_init_test() { #if 0 - if (!threading) - { + if (!threading) { CtdlRegisterCleanupHook(CleanupTest); CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM, 1); CtdlRegisterSessionHook(SessionStartTest, EVT_START, 1); CtdlRegisterSessionHook(SessionStopTest, EVT_STOP, 1); CtdlRegisterSessionHook(LoginTest, EVT_LOGIN, 1); } +#else + syslog(LOG_DEBUG, "test: module is disabled"); #endif -/* return our module name for the log */ -return "test"; + // return our module name for the log + return "test"; } diff --git a/citadel/modules/upgrade/.gitignore b/citadel/server/modules/upgrade/.gitignore similarity index 100% rename from citadel/modules/upgrade/.gitignore rename to citadel/server/modules/upgrade/.gitignore diff --git a/citadel/modules/upgrade/serv_upgrade.c b/citadel/server/modules/upgrade/serv_upgrade.c similarity index 97% rename from citadel/modules/upgrade/serv_upgrade.c rename to citadel/server/modules/upgrade/serv_upgrade.c index b961e416c..d8369963b 100644 --- a/citadel/modules/upgrade/serv_upgrade.c +++ b/citadel/server/modules/upgrade/serv_upgrade.c @@ -13,7 +13,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -27,20 +27,20 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "database.h" -#include "user_ops.h" -#include "msgbase.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../database.h" +#include "../../user_ops.h" +#include "../../msgbase.h" #include "serv_upgrade.h" -#include "euidindex.h" -#include "ctdl_module.h" -#include "serv_vcard.h" -#include "internet_addressing.h" +#include "../../euidindex.h" +#include "../../ctdl_module.h" +#include "../../serv_vcard.h" +#include "../../internet_addressing.h" // oldver is the version number of Citadel Server which was active on the previous run of the program, learned from the system configuration. // If we are running a new Citadel Server for the first time, oldver will be 0. @@ -566,17 +566,7 @@ void post_startup_upgrades(void) { } -CTDL_MODULE_UPGRADE(upgrade) -{ - pre_startup_upgrades(); - - /* return our module id for the Log */ - return "upgrade"; -} - - -CTDL_MODULE_INIT(upgrade) -{ +char *ctdl_module_init_upgrade(void) { if (!threading) { post_startup_upgrades(); } diff --git a/citadel/modules/upgrade/serv_upgrade.h b/citadel/server/modules/upgrade/serv_upgrade.h similarity index 100% rename from citadel/modules/upgrade/serv_upgrade.h rename to citadel/server/modules/upgrade/serv_upgrade.h diff --git a/citadel/modules/vcard/.gitignore b/citadel/server/modules/vcard/.gitignore similarity index 100% rename from citadel/modules/vcard/.gitignore rename to citadel/server/modules/vcard/.gitignore diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/server/modules/vcard/serv_vcard.c similarity index 98% rename from citadel/modules/vcard/serv_vcard.c rename to citadel/server/modules/vcard/serv_vcard.c index 8f0bc170e..61d9ef7d8 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/server/modules/vcard/serv_vcard.c @@ -2,7 +2,7 @@ * A server-side module for Citadel which supports address book information * using the standard vCard format. * - * Copyright (c) 1999-2021 by the citadel.org team + * Copyright (c) 1999-2022 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -28,7 +28,7 @@ */ #define VCARD_MIME_TYPE "text/x-vcard" -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -43,20 +43,20 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "room_ops.h" -#include "internet_addressing.h" -#include "serv_vcard.h" -#include "citadel_ldap.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../room_ops.h" +#include "../../internet_addressing.h" +#include "../../serv_vcard.h" +#include "../../citadel_ldap.h" +#include "../../ctdl_module.h" /* * set global flag calling for an aide to validate new users @@ -1209,12 +1209,10 @@ void vcard_fixed_output(char *ptr, int len) { const char *CitadelServiceDICT_TCP="DICT_TCP"; -CTDL_MODULE_INIT(vcard) -{ +char *ctdl_module_init_vcard(void) { struct ctdlroom qr; - if (!threading) - { + if (!threading) { CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN, PRIO_LOGIN + 70); CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE); CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE); diff --git a/citadel/modules/wiki/.gitignore b/citadel/server/modules/wiki/.gitignore similarity index 100% rename from citadel/modules/wiki/.gitignore rename to citadel/server/modules/wiki/.gitignore diff --git a/citadel/modules/wiki/serv_wiki.c b/citadel/server/modules/wiki/serv_wiki.c similarity index 96% rename from citadel/modules/wiki/serv_wiki.c rename to citadel/server/modules/wiki/serv_wiki.c index ebbb32925..a4bc7c699 100644 --- a/citadel/modules/wiki/serv_wiki.c +++ b/citadel/server/modules/wiki/serv_wiki.c @@ -1,7 +1,7 @@ /* * Server-side module for Wiki rooms. This handles things like version control. * - * Copyright (c) 2009-2021 by the citadel.org team + * Copyright (c) 2009-2022 by the citadel.org team * * This program is open source software. You can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -27,18 +27,18 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "control.h" -#include "user_ops.h" -#include "room_ops.h" -#include "database.h" -#include "msgbase.h" -#include "euidindex.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../control.h" +#include "../../user_ops.h" +#include "../../room_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../euidindex.h" +#include "../../ctdl_module.h" /* * Data passed back and forth between wiki_rev() and its MIME parser callback @@ -163,7 +163,7 @@ int wiki_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) { fclose(fp); snprintf(diff_cmd, sizeof diff_cmd, - DIFF " -u %s %s >%s", + "diff -u %s %s >%s", diff_new_filename, ((old_msg != NULL) ? diff_old_filename : "/dev/null"), diff_out_filename @@ -449,7 +449,7 @@ void wiki_rev_callback(char *name, char *filename, char *partnum, char *disp, striplt(this_rev); /* Perform the patch */ - fp = popen(PATCH " -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w"); + fp = popen("patch -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w"); if (fp) { /* Replace the filenames in the patch with the tempfilename we're actually tweaking */ fprintf(fp, "--- %s\n", hecbd->tempfilename); @@ -511,7 +511,7 @@ void wiki_rev(char *pagename, char *rev, char *operation) } if (!strcasecmp(operation, "revert")) { - r = CtdlDoIHavePermissionToPostInThisRoom(temp, sizeof temp, NULL, POST_LOGGED_IN, 0); + r = CtdlDoIHavePermissionToPostInThisRoom(temp, sizeof temp, POST_LOGGED_IN, 0); if (r != 0) { cprintf("%d %s\n", r, temp); return; @@ -715,10 +715,8 @@ void cmd_wiki(char *argbuf) { /* * Module initialization */ -CTDL_MODULE_INIT(wiki) -{ - if (!threading) - { +char *ctdl_module_init_wiki() { + if (!threading) { CtdlRegisterMessageHook(wiki_upload_beforesave, EVT_BEFORESAVE); CtdlRegisterProtoHook(cmd_wiki, "WIKI", "Commands related to Wiki management"); } diff --git a/citadel/modules/xmpp/.gitignore b/citadel/server/modules/xmpp/.gitignore similarity index 100% rename from citadel/modules/xmpp/.gitignore rename to citadel/server/modules/xmpp/.gitignore diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/server/modules/xmpp/serv_xmpp.c similarity index 97% rename from citadel/modules/xmpp/serv_xmpp.c rename to citadel/server/modules/xmpp/serv_xmpp.c index dfb895274..c81720ca0 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/server/modules/xmpp/serv_xmpp.c @@ -1,6 +1,6 @@ /* * XMPP (Jabber) service for the Citadel system - * Copyright (c) 2007-2021 by Art Cancro and citadel.org + * Copyright (c) 2007-2022 by Art Cancro and citadel.org * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -33,16 +33,16 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "database.h" -#include "msgbase.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../database.h" +#include "../../msgbase.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" /* uncomment for more verbosity - it will log all received XML tags */ @@ -651,8 +651,7 @@ void xmpp_logout_hook(void) { const char *CitadelServiceXMPP="XMPP"; -CTDL_MODULE_INIT(xmpp) -{ +char *ctdl_module_init_xmpp() { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_xmpp_c2s_port"), NULL, diff --git a/citadel/modules/xmpp/serv_xmpp.h b/citadel/server/modules/xmpp/serv_xmpp.h similarity index 100% rename from citadel/modules/xmpp/serv_xmpp.h rename to citadel/server/modules/xmpp/serv_xmpp.h diff --git a/citadel/modules/xmpp/xmpp_messages.c b/citadel/server/modules/xmpp/xmpp_messages.c similarity index 91% rename from citadel/modules/xmpp/xmpp_messages.c rename to citadel/server/modules/xmpp/xmpp_messages.c index ca8d439b5..45e4822b0 100644 --- a/citadel/modules/xmpp/xmpp_messages.c +++ b/citadel/server/modules/xmpp/xmpp_messages.c @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -28,13 +28,13 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/server/modules/xmpp/xmpp_presence.c similarity index 97% rename from citadel/modules/xmpp/xmpp_presence.c rename to citadel/server/modules/xmpp/xmpp_presence.c index 00fb4e3bd..0dc24322f 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/server/modules/xmpp/xmpp_presence.c @@ -19,7 +19,7 @@ * */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -36,13 +36,13 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/server/modules/xmpp/xmpp_query_namespace.c similarity index 96% rename from citadel/modules/xmpp/xmpp_query_namespace.c rename to citadel/server/modules/xmpp/xmpp_query_namespace.c index e7b01f8a2..01b976869 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/server/modules/xmpp/xmpp_query_namespace.c @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -28,13 +28,13 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" diff --git a/citadel/modules/xmpp/xmpp_queue.c b/citadel/server/modules/xmpp/xmpp_queue.c similarity index 93% rename from citadel/modules/xmpp/xmpp_queue.c rename to citadel/server/modules/xmpp/xmpp_queue.c index e5b11125b..175c7d9bc 100644 --- a/citadel/modules/xmpp/xmpp_queue.c +++ b/citadel/server/modules/xmpp/xmpp_queue.c @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -28,13 +28,13 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" int queue_event_seq = 0; diff --git a/citadel/modules/xmpp/xmpp_sasl_service.c b/citadel/server/modules/xmpp/xmpp_sasl_service.c similarity index 93% rename from citadel/modules/xmpp/xmpp_sasl_service.c rename to citadel/server/modules/xmpp/xmpp_sasl_service.c index bb31ddaba..494c0da1c 100644 --- a/citadel/modules/xmpp/xmpp_sasl_service.c +++ b/citadel/server/modules/xmpp/xmpp_sasl_service.c @@ -14,7 +14,7 @@ * GNU General Public License for more details. */ -#include "sysdep.h" +#include "../../sysdep.h" #include #include #include @@ -30,14 +30,14 @@ #include #include #include -#include "citadel.h" -#include "server.h" -#include "citserver.h" -#include "support.h" -#include "config.h" -#include "user_ops.h" -#include "internet_addressing.h" -#include "ctdl_module.h" +#include "../../citadel.h" +#include "../../server.h" +#include "../../citserver.h" +#include "../../support.h" +#include "../../config.h" +#include "../../user_ops.h" +#include "../../internet_addressing.h" +#include "../../ctdl_module.h" #include "serv_xmpp.h" diff --git a/citadel/server/modules_init.c b/citadel/server/modules_init.c new file mode 100644 index 000000000..966c769fc --- /dev/null +++ b/citadel/server/modules_init.c @@ -0,0 +1,75 @@ +// Module initialization hub +// +// Copyright (c) 1987-2022 by the citadel.org team +// +// This program is open source software. Use, duplication, or disclosure +// is subject to the terms of the GNU General Public License, version 3. +// The program is distributed without any warranty, expressed or implied. +// +// To add new modules to the server: +// 1. Write the module and place it in a server/modules/[module_name]/ directory +// 2. Add its initialization function to server/modules_init.h +// 3. Call its initialization function from server/modules_init.c + +#include +#include +#include +#include +#include "modules_init.h" + +// Module initialization functions will be called TWICE during startup, once before +// the server has gone into multithreading mode, and once afterwards. Most modules +// can be initialized while in multithreading mode, but your module code should be +// prepared for this kind of initialization. Look at the existing modules to see what +// goes on there. +int threading = 0; + +void initialize_modules(int is_threading) { + threading = is_threading; + syslog(LOG_DEBUG, "modules: begin initializing modules (threading=%d)", threading); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_control()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_euidindex()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_msgbase()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_database()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_autocompletion()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_bio()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_blog()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_calendar()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_checkpoint()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_virus()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_file_ops()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_ctdl_message()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_rooms()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_serv_session()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_syscmd()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_serv_user()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_expire()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_fulltext()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_image()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_imap()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_sieve()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_inetcfg()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_instmsg()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_listdeliver()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_listsub()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_migrate()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_newuser()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_nntp()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_notes()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_openid_rp()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_pop3()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_pop3client()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_roomchat()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_rssclient()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_rwho()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_smtp()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_smtpclient()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_spam()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_test()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_upgrade()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_vcard()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_wiki()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_xmpp()); + syslog(LOG_DEBUG, "modules: init %s", ctdl_module_init_netconfig()); + syslog(LOG_DEBUG, "modules: finished initializing modules (threading=%d)", threading); +} diff --git a/citadel/server/modules_init.h b/citadel/server/modules_init.h new file mode 100644 index 000000000..0513dcde7 --- /dev/null +++ b/citadel/server/modules_init.h @@ -0,0 +1,64 @@ +// Headers for module initialization hub +// +// Copyright (c) 1987-2022 by the citadel.org team +// +// This program is open source software. Use, duplication, or disclosure +// is subject to the terms of the GNU General Public License, version 3. +// The program is distributed without any warranty, expressed or implied. +// +// To add new modules to the server: +// 1. Write the module and place it in a server/modules/[module_name]/ directory +// 2. Add its initialization function to server/modules_init.h +// 3. Call its initialization function from server/modules_init.c + +#ifndef MODULES_INIT_H +#define MODULES_INIT_H +#include "ctdl_module.h" +extern size_t nSizErrmsg; +void initialize_modules (int threading); +void pre_startup_upgrades(void); +char *ctdl_module_init_control(void); +char *ctdl_module_init_euidindex(void); +char *ctdl_module_init_msgbase(void); +char *ctdl_module_init_database(void); +char *ctdl_module_init_autocompletion(void); +char *ctdl_module_init_bio(void); +char *ctdl_module_init_blog(void); +char *ctdl_module_init_calendar(void); +char *ctdl_module_init_checkpoint(void); +char *ctdl_module_init_virus(void); +char *ctdl_module_init_file_ops(void); +char *ctdl_module_init_ctdl_message(void); +char *ctdl_module_init_rooms(void); +char *ctdl_module_init_serv_session(void); +char *ctdl_module_init_syscmd(void); +char *ctdl_module_init_serv_user(void); +char *ctdl_module_init_expire(void); +char *ctdl_module_init_fulltext(void); +char *ctdl_module_init_image(void); +char *ctdl_module_init_imap(void); +char *ctdl_module_init_sieve(void); +char *ctdl_module_init_inetcfg(void); +char *ctdl_module_init_instmsg(void); +char *ctdl_module_init_listdeliver(void); +char *ctdl_module_init_listsub(void); +char *ctdl_module_init_migrate(void); +char *ctdl_module_init_newuser(void); +char *ctdl_module_init_nntp(void); +char *ctdl_module_init_notes(void); +char *ctdl_module_init_openid_rp(void); +char *ctdl_module_init_pop3(void); +char *ctdl_module_init_pop3client(void); +char *ctdl_module_init_roomchat(void); +char *ctdl_module_init_rssclient(void); +char *ctdl_module_init_rwho(void); +char *ctdl_module_init_smtp(void); +char *ctdl_module_init_smtpclient(void); +char *ctdl_module_init_spam(void); +char *ctdl_module_init_test(void); +char *ctdl_module_init_upgrade(void); +char *ctdl_module_init_vcard(void); +char *ctdl_module_init_wiki(void); +char *ctdl_module_init_xmpp(void); +char *ctdl_module_init_netconfig(void); +#endif /* MODULES_INIT_H */ diff --git a/citadel/msgbase.c b/citadel/server/msgbase.c similarity index 99% rename from citadel/msgbase.c rename to citadel/server/msgbase.c index 0fbfbb63e..0cde681fc 100644 --- a/citadel/msgbase.c +++ b/citadel/server/msgbase.c @@ -2909,13 +2909,13 @@ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ /* * Convenience function for generating small administrative messages. */ -long quickie_message(const char *from, - const char *fromaddr, - const char *to, +long quickie_message(char *from, + char *fromaddr, + char *to, char *room, - const char *text, + char *text, int format_type, - const char *subject) + char *subject) { struct CtdlMessage *msg; struct recptypes *recp = NULL; @@ -3549,8 +3549,7 @@ long CtdlWriteObject(char *req_room, /* Room to stuff it in */ /* MODULE INITIALIZATION */ /************************************************************************/ -CTDL_MODULE_INIT(msgbase) -{ +char *ctdl_module_init_msgbase(void) { if (!threading) { FillMsgKeyLookupTable(); } diff --git a/citadel/msgbase.h b/citadel/server/msgbase.h similarity index 98% rename from citadel/msgbase.h rename to citadel/server/msgbase.h index 053e43d07..6ccb93b1b 100644 --- a/citadel/msgbase.h +++ b/citadel/server/msgbase.h @@ -79,7 +79,7 @@ void output_mime_parts(char *); long send_message (struct CtdlMessage *); void loadtroom (void); long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, const char *); -long quickie_message(const char *from, const char *fromaddr, const char *to, char *room, const char *text, int format_type, const char *subject); +long quickie_message(char *from, char *fromaddr, char *to, char *room, char *text, int format_type, char *subject); void GetMetaData(struct MetaData *, long); void PutMetaData(struct MetaData *); void AdjRefCount(long, int); diff --git a/citadel/netconfig.c b/citadel/server/netconfig.c similarity index 97% rename from citadel/netconfig.c rename to citadel/server/netconfig.c index ab4741280..e71d262da 100644 --- a/citadel/netconfig.c +++ b/citadel/server/netconfig.c @@ -1,6 +1,6 @@ // This module handles loading, saving, and parsing of room network configurations. // -// Copyright (c) 2000-2021 by the citadel.org team +// Copyright (c) 2000-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License, version 3. @@ -24,9 +24,7 @@ #endif #include #include - #include - #include "ctdl_module.h" #include "serv_extensions.h" #include "config.h" @@ -180,10 +178,8 @@ void convert_legacy_netcfg_files(void) { /* * Module entry point */ -CTDL_MODULE_INIT(netconfig) -{ - if (!threading) - { +char *ctdl_module_init_netconfig(void) { + if (!threading) { convert_legacy_netcfg_files(); CtdlRegisterProtoHook(cmd_gnet, "GNET", "Get network config"); CtdlRegisterProtoHook(cmd_snet, "SNET", "Set network config"); diff --git a/citadel/parsedate.c b/citadel/server/parsedate.c similarity index 100% rename from citadel/parsedate.c rename to citadel/server/parsedate.c diff --git a/citadel/parsedate.h b/citadel/server/parsedate.h similarity index 100% rename from citadel/parsedate.h rename to citadel/server/parsedate.h diff --git a/citadel/parsedate.y b/citadel/server/parsedate.y similarity index 100% rename from citadel/parsedate.y rename to citadel/server/parsedate.y diff --git a/citadel/room_ops.c b/citadel/server/room_ops.c similarity index 99% rename from citadel/room_ops.c rename to citadel/server/room_ops.c index 5b84fd366..1b2c18416 100644 --- a/citadel/room_ops.c +++ b/citadel/server/room_ops.c @@ -41,7 +41,6 @@ int CtdlDoIHavePermissionToReadMessagesInThisRoom(void) { int CtdlDoIHavePermissionToPostInThisRoom( char *errmsgbuf, size_t n, - const char* RemoteIdentifier, PostType PostPublic, int is_reply ) { diff --git a/citadel/room_ops.h b/citadel/server/room_ops.h similarity index 85% rename from citadel/room_ops.h rename to citadel/server/room_ops.h index d72300b76..ba1aaf644 100644 --- a/citadel/room_ops.h +++ b/citadel/server/room_ops.h @@ -16,11 +16,6 @@ typedef enum _POST_TYPE{ POST_LMTP } PostType; -int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, - size_t n, - const char* RemoteIdentifier, - PostType PostPublic, - int is_reply -); +int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n, PostType PostPublic, int is_reply); int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void); int CtdlDoIHavePermissionToReadMessagesInThisRoom(void); diff --git a/citadel/serv_extensions.c b/citadel/server/serv_extensions.c similarity index 100% rename from citadel/serv_extensions.c rename to citadel/server/serv_extensions.c diff --git a/citadel/serv_extensions.h b/citadel/server/serv_extensions.h similarity index 100% rename from citadel/serv_extensions.h rename to citadel/server/serv_extensions.h diff --git a/citadel/serv_vcard.h b/citadel/server/serv_vcard.h similarity index 100% rename from citadel/serv_vcard.h rename to citadel/server/serv_vcard.h diff --git a/citadel/server.h b/citadel/server/server.h similarity index 100% rename from citadel/server.h rename to citadel/server/server.h diff --git a/citadel/server_main.c b/citadel/server/server_main.c similarity index 98% rename from citadel/server_main.c rename to citadel/server/server_main.c index 601b458fa..47f557cef 100644 --- a/citadel/server_main.c +++ b/citadel/server/server_main.c @@ -19,7 +19,6 @@ #include #include #include "citserver.h" -#include "svn_revision.h" #include "modules_init.h" #include "config.h" #include "control.h" @@ -82,7 +81,7 @@ int main(int argc, char **argv) { syslog(LOG_INFO, " "); syslog(LOG_INFO, " "); syslog(LOG_INFO, "*** Citadel server engine ***\n"); - syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, svn_revision()); + syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, BUILD_ID); syslog(LOG_INFO, "Copyright (C) 1987-2022 by the Citadel development team."); syslog(LOG_INFO, " "); syslog(LOG_INFO, "This program is open source software: you can redistribute it and/or"); @@ -237,7 +236,7 @@ int main(int argc, char **argv) { master_startup(); // Do non system dependent startup functions check_control(); // Check/sanitize/initialize control record, fix user indexes syslog(LOG_INFO, "main: upgrading modules"); // Run any upgrade entry points - upgrade_modules(); + pre_startup_upgrades(); // Load the user for the masterCC or create them if they don't exist if (CtdlGetUser(&masterCC.user, "SYS_Citadel")) { @@ -274,7 +273,7 @@ int main(int argc, char **argv) { // Load any server-side extensions available here. syslog(LOG_INFO, "main: initializing server extensions"); - initialise_modules(0); + initialize_modules(0); // If we need host auth, start our chkpwd daemon. if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_HOST) { diff --git a/citadel/support.c b/citadel/server/support.c similarity index 100% rename from citadel/support.c rename to citadel/server/support.c diff --git a/citadel/support.h b/citadel/server/support.h similarity index 100% rename from citadel/support.h rename to citadel/server/support.h diff --git a/citadel/sysconfig.h b/citadel/server/sysconfig.h similarity index 100% rename from citadel/sysconfig.h rename to citadel/server/sysconfig.h diff --git a/citadel/sysdep.c b/citadel/server/sysdep.c similarity index 100% rename from citadel/sysdep.c rename to citadel/server/sysdep.c diff --git a/citadel/server/sysdep.h b/citadel/server/sysdep.h new file mode 100644 index 000000000..5659b46e1 --- /dev/null +++ b/citadel/server/sysdep.h @@ -0,0 +1,349 @@ + + +/* define this to the Citadel home directory */ +#define CTDLDIR "/root/citadel/citadel" + +/* define, if the user suplied a data-directory to use. */ +/* #undef DATA_DIR */ + +/* whether we have NLS support */ +#define ENABLE_NLS /**/ + +/* whats the matching format string for pid_t? */ +#define F_PID_T "%d" + +/* whats the matching format string for uid_t? */ +#define F_UID_T "%d" + +/* whats the matching format string for xpid_t? */ +#define F_XPID_T "%x" + +/* Define to 1 if the `getpgrp' function requires zero arguments. */ +#define GETPGRP_VOID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_COMPAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the `connect' function. */ +#define HAVE_CONNECT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DB_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `gethostbyname' function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the `getloadavg' function. */ +#define HAVE_GETLOADAVG 1 + +/* Define to 1 if you have the `getpwnam_r' function. */ +#define HAVE_GETPWNAM_R 1 + +/* Define to 1 if you have the `getpwuid_r' function. */ +#define HAVE_GETPWUID_R 1 + +/* Define to 1 if you have the `getspnam' function. */ +#define HAVE_GETSPNAM 1 + +/* Define to 1 if you have the `gettext' function. */ +#define HAVE_GETTEXT 1 + +/* Define to 1 if you have the `getutxline' function. */ +#define HAVE_GETUTXLINE 1 + +/* whether we have iconv for charset conversion */ +#define HAVE_ICONV /**/ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the `rt' library (-lrt). */ +#define HAVE_LIBRT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have the `mktime' function. */ +#define HAVE_MKTIME 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PATHS_H 1 + +/* define this if you have the pthread_cancel() function */ +#define HAVE_PTHREAD_CANCEL /**/ + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* define this if you have the resolv.h header file. */ +#define HAVE_RESOLV_H /**/ + +/* Define to 1 if you have the `rmdir' function. */ +#define HAVE_RMDIR 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* enable alternate spool dir? */ +/* #undef HAVE_SPOOL_DIR */ + +/* should we activate an alternate static text location? */ +/* #undef HAVE_STATICDATA_DIR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strftime_l' function. */ +#define HAVE_STRFTIME_L 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +#define HAVE_STRUCT_TM_TM_GMTOFF 1 + +/* Define if struct ucred is present from sys/socket.h */ +#define HAVE_STRUCT_UCRED 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSCALL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PRCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define if you don't have `tm_gmtoff' but do have the external variable + `timezone'. */ +/* #undef HAVE_TIMEZONE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `uselocale' function. */ +#define HAVE_USELOCALE 1 + +/* should we put our helper binaries to another location? */ +/* #undef HAVE_UTILBIN_DIR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMPX_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMP_H 1 + +/* define this if struct utmp has an ut_host member */ +#define HAVE_UT_HOST /**/ + +/* define this if struct utmp has an ut_type member */ +#define HAVE_UT_TYPE /**/ + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `vw_printw' function. */ +/* #undef HAVE_VW_PRINTW */ + +/* Define to 1 if you have the `wcolor_set' function. */ +/* #undef HAVE_WCOLOR_SET */ + +/* Define to 1 if you have the `wresize' function. */ +/* #undef HAVE_WRESIZE */ + +/* define, if the user suplied a helpfile-directory to use. */ +/* #undef HELP_DIR */ + +/* where to find our pot files */ +#define LOCALEDIR "/root/citadel/citadel" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://uncensored.citadel.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Citadel" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Citadel 951" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "citadel" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "951" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* define, where the config should go in unix style */ +/* #undef RUN_DIR */ + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `loff_t', as computed by sizeof. */ +#define SIZEOF_LOFF_T 8 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* do we need to use solaris call syntax? */ +/* #undef SOLARIS_GETPWUID */ + +/* where do we place our spool dirs? */ +/* #undef SPOOL_DIR */ + +/* were should we put our keys? */ +#define SSL_DIR "/root/citadel/citadel/keys" + +/* where do we put our static text data? */ +/* #undef STATICDATA_DIR */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* were to put our helper programs */ +/* #undef UTILBIN_DIR */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/citadel/sysdep_decls.h b/citadel/server/sysdep_decls.h similarity index 100% rename from citadel/sysdep_decls.h rename to citadel/server/sysdep_decls.h diff --git a/citadel/threads.c b/citadel/server/threads.c similarity index 99% rename from citadel/threads.c rename to citadel/server/threads.c index d995c3982..7b404b043 100644 --- a/citadel/threads.c +++ b/citadel/server/threads.c @@ -148,7 +148,7 @@ void go_threading(void) { pthread_mutex_init(&ThreadCountMutex, NULL); /* Second call to module init functions now that threading is up */ - initialise_modules(1); + initialize_modules(1); /* Begin with one worker thread. We will expand the pool if necessary */ CtdlThreadCreate(worker_thread); diff --git a/citadel/threads.h b/citadel/server/threads.h similarity index 100% rename from citadel/threads.h rename to citadel/server/threads.h diff --git a/citadel/typesize.h b/citadel/server/typesize.h similarity index 100% rename from citadel/typesize.h rename to citadel/server/typesize.h diff --git a/citadel/user_ops.c b/citadel/server/user_ops.c similarity index 100% rename from citadel/user_ops.c rename to citadel/server/user_ops.c diff --git a/citadel/user_ops.h b/citadel/server/user_ops.h similarity index 100% rename from citadel/user_ops.h rename to citadel/server/user_ops.h diff --git a/citadel/svn_revision.h b/citadel/svn_revision.h deleted file mode 100644 index 8c3428e56..000000000 --- a/citadel/svn_revision.h +++ /dev/null @@ -1,5 +0,0 @@ - - -const char *svn_revision(void); - - -- 2.30.2