| 1 | /* |
| 2 | * Copyright (C) 2001,2006 Dizzy |
| 3 | * Copyright (C) 2004 Donny Redmond ([email protected]) |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | /*****/ |
| 22 | #ifndef INCLUDED_PVPGN_BNETD_MAIL |
| 23 | #define INCLUDED_PVPGN_BNETD_MAILcxx . . $ `src/bnetd/mail.h:23:9`! |
| 24 | |
| 25 | |
| 26 | #define MAX_FUNC_LENcxx . . $ `src/bnetd/mail.h:26:9`! 10 |
| 27 | #define MAX_MAIL_QUOTAcxx . . $ `src/bnetd/mail.h:27:9`! 10 |
| 28 | #define MAIL_FUNC_SENDcxx . . $ `src/bnetd/mail.h:28:9`! 1 |
| 29 | #define MAIL_FUNC_READcxx . . $ `src/bnetd/mail.h:29:9`! 2 |
| 30 | #define MAIL_FUNC_DELETEcxx . . $ `src/bnetd/mail.h:30:9`! 3 |
| 31 | #define MAIL_FUNC_UNKNOWNcxx . . $ `src/bnetd/mail.h:31:9`! 4 |
| 32 | |
| 33 | |
| 34 | #include <string> |
| 35 | #include <stdexcept> |
| 36 | #include <deque> |
| 37 | #include <ctime> |
| 38 | |
| 39 | #include "compat/pdir.h"cxx . . $ `<file>/src/compat/pdir.h`/ |
| 40 | #include "connection.h"cxx . . $ `<file>/src/bnetd/connection.h`/ |
| 41 | |
| 42 | namespace pvpgncxx . . $ pvpgn/ |
| 43 | { |
| 44 | |
| 45 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 46 | { |
| 47 | |
| 48 | class Mailcxx . . $ pvpgn/bnetd/Mail# |
| 49 | { |
| 50 | public: |
| 51 | Mailcxx . . $ pvpgn/bnetd/Mail#Mail(715d3961e431e701).(const stdcxx . . $ std/::stringcxx . . $ std/string#& sender, const stdcxx . . $ std/::stringcxx . . $ std/string#& mess, const stdcxx . . $ std/::time_tcxx . . $ std/time_t# timestamp); |
| 52 | ~cxx . . $ pvpgn/bnetd/Mail#`~Mail`(ced63f7c635d850d).Mailcxx . . $ pvpgn/bnetd/Mail#() throw(); |
| 53 | |
| 54 | const stdcxx . . $ std/::stringcxx . . $ std/string#& sendercxx . . $ pvpgn/bnetd/Mail#sender(f4fff0029955a25f).() const; |
| 55 | const stdcxx . . $ std/::stringcxx . . $ std/string#& messagecxx . . $ pvpgn/bnetd/Mail#message(f4fff0029955a25f).() const; |
| 56 | const stdcxx . . $ std/::time_tcxx . . $ std/time_t#& timestampcxx . . $ pvpgn/bnetd/Mail#timestamp(6a0f01c7459e4657).() const; |
| 57 | |
| 58 | private: |
| 59 | const stdcxx . . $ std/::stringcxx . . $ std/string# sender_cxx . . $ pvpgn/bnetd/Mail#sender_.; |
| 60 | const stdcxx . . $ std/::stringcxx . . $ std/string# message_cxx . . $ pvpgn/bnetd/Mail#message_.; |
| 61 | const stdcxx . . $ std/::time_tcxx . . $ std/time_t# timestamp_cxx . . $ pvpgn/bnetd/Mail#timestamp_.; |
| 62 | }; |
| 63 | |
| 64 | typedef stdcxx . . $ std/::dequecxx . . $ std/deque#<Mailcxx . . $ pvpgn/bnetd/Mail#> MailListcxx . . $ pvpgn/bnetd/MailList#; |
| 65 | |
| 66 | class Mailboxcxx . . $ pvpgn/bnetd/Mailbox# { |
| 67 | public: |
| 68 | class ReadErrorcxx . . $ pvpgn/bnetd/Mailbox#ReadError# : public stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error# { |
| 69 | public: |
| 70 | ReadErrorcxx . . $ pvpgn/bnetd/Mailbox#ReadError#ReadError(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& mess) |
| 71 | :stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#(mess) {} |
| 72 | ~cxx . . $ pvpgn/bnetd/Mailbox#ReadError#`~ReadError`(ced63f7c635d850d).ReadErrorcxx . . $ pvpgn/bnetd/Mailbox#ReadError#() throw() {} |
| 73 | }; |
| 74 | |
| 75 | class DeliverErrorcxx . . $ pvpgn/bnetd/Mailbox#DeliverError# : public stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error# { |
| 76 | public: |
| 77 | DeliverErrorcxx . . $ pvpgn/bnetd/Mailbox#DeliverError#DeliverError(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& mess) |
| 78 | :stdcxx . . $ std/runtime_error#runtime_error(9c546c94e5fcce4e).::runtime_errorcxx . . $ std/runtime_error#(mess) {} |
| 79 | ~cxx . . $ pvpgn/bnetd/Mailbox#DeliverError#`~DeliverError`(ced63f7c635d850d).DeliverErrorcxx . . $ pvpgn/bnetd/Mailbox#DeliverError#() throw() {} |
| 80 | }; |
| 81 | |
| 82 | explicit Mailboxcxx . . $ pvpgn/bnetd/Mailbox#Mailbox(cb2f890c2fdad230).(unsigned uid); |
| 83 | ~cxx . . $ pvpgn/bnetd/Mailbox#`~Mailbox`(ced63f7c635d850d).Mailboxcxx . . $ pvpgn/bnetd/Mailbox#() throw(); |
| 84 | |
| 85 | unsigned sizecxx . . $ pvpgn/bnetd/Mailbox#size(ddd8539a2fcdd4ce).() const; |
| 86 | bool emptycxx . . $ pvpgn/bnetd/Mailbox#empty(50ce9a9e25b4a850).() const; |
| 87 | void delivercxx . . $ pvpgn/bnetd/Mailbox#deliver(c3ca1c130ce09c52).(const stdcxx . . $ std/::stringcxx . . $ std/string#& sender, const stdcxx . . $ std/::stringcxx . . $ std/string#& mess); |
| 88 | Mailcxx . . $ pvpgn/bnetd/Mail# readcxx . . $ pvpgn/bnetd/Mailbox#read(af5817b933df5210).(unsigned int) const; |
| 89 | void readAllcxx . . $ pvpgn/bnetd/Mailbox#readAll(ce7a057c2f96e783).(MailListcxx . . $ pvpgn/bnetd/MailList#& dest) const; |
| 90 | void erasecxx . . $ pvpgn/bnetd/Mailbox#erase(cb2f890c2fdad230).(unsigned int); |
| 91 | void clearcxx . . $ pvpgn/bnetd/Mailbox#clear(49f6e7a06ebc5aa8).(); |
| 92 | |
| 93 | private: |
| 94 | unsigned uidcxx . . $ pvpgn/bnetd/Mailbox#uid.; |
| 95 | const stdcxx . . $ std/::stringcxx . . $ std/string# pathcxx . . $ pvpgn/bnetd/Mailbox#path.; |
| 96 | mutable Directorycxx . . $ pvpgn/Directory# mdircxx . . $ pvpgn/bnetd/Mailbox#mdir.; |
| 97 | |
| 98 | stdcxx . . $ std/::stringcxx . . $ std/string# buildPathcxx . . $ pvpgn/bnetd/Mailbox#buildPath(ed3976f106e8bf8e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& root) const; |
| 99 | void createOpenDircxx . . $ pvpgn/bnetd/Mailbox#createOpenDir(49f6e7a06ebc5aa8).(); |
| 100 | Mailcxx . . $ pvpgn/bnetd/Mail# readcxx . . $ pvpgn/bnetd/Mailbox#read(68d122ab974fa447).(const stdcxx . . $ std/::stringcxx . . $ std/string#& fname, const stdcxx . . $ std/::time_tcxx . . $ std/time_t#& timestamp) const; |
| 101 | |
| 102 | Mailboxcxx . . $ pvpgn/bnetd/Mailbox#Mailbox(ac90f82c27ae1a67).(const Mailboxcxx . . $ pvpgn/bnetd/Mailbox#&); |
| 103 | Mailboxcxx . . $ pvpgn/bnetd/Mailbox#& operatorcxx . . $ pvpgn/bnetd/Mailbox#`operator=`(7f592035e37640).=(const Mailboxcxx . . $ pvpgn/bnetd/Mailbox#&); |
| 104 | }; |
| 105 | |
| 106 | |
| 107 | extern int handle_mail_commandcxx . . $ pvpgn/bnetd/handle_mail_command(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *, char const *); |
| 108 | extern unsigned check_mailcxx . . $ pvpgn/bnetd/check_mail(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c); |
| 109 | |
| 110 | } |
| 111 | |
| 112 | } |
| 113 | |
| 114 | #endif |