This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-goldedplus/golded3/geprot.h

492 lines
14 KiB
C
Raw Normal View History

2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GoldED+
// Copyright (C) 1990-1999 Odinn Sorensen
// Copyright (C) 1999-2000 Alexander S. Aganichev
// ------------------------------------------------------------------
// 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 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
// ------------------------------------------------------------------
// $Id$
// ------------------------------------------------------------------
// Collective header for GE*.CPP source files.
// ------------------------------------------------------------------
#ifndef __GEHDRS_H
#define __GEHDRS_H
// ------------------------------------------------------------------
// GCAREA prototypes
void FixEchoid(char* echoid, int type);
// ------------------------------------------------------------------
// GCCFGG prototypes
void CfgAddress(char* value);
void CfgAddressmacro(char* value);
void CfgEvent(char* value);
void CfgFrqext(const char* value);
void CfgRobotname(const char* value);
void CfgUsername(char* value);
int SwitchCfgAtoG(word crc, char* val);
int SwitchCfgHtoZ(word crc, char* val);
int ReadGoldCfg(int force);
bool ReadGoldedCfg(int& force);
void WriteGoldGed();
void InstallDetect(char* path);
int InstallFinish();
2002-10-26 16:28:01 +00:00
int getgroup(const char *key);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GCKEYS prototypes
int ReadKeysCfg(int force);
void KeyCmdAdd(gkey cmd, gkey val, int type);
void RunMacro(Macro* m);
// ------------------------------------------------------------------
// GCLANG prototypes
void LangInit();
bool ReadLangCfg(int force);
void LoadLanguage(const char* file);
// ------------------------------------------------------------------
// GCMISC prototypes
int ReadHelpCfg(int force);
vattr GetColor(char* ink);
vattr MakeColor(char* colors);
void GetColors(char* value);
void ReadXlatTables();
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GEAREA prototypes
int AreaPick(char* title, int wpos, int* idx);
void a_closeall();
void GetAreaconf();
// ------------------------------------------------------------------
// GECTRL prototypes
char* MakeOrigin(GMsg* msg, const char* _origin);
char* MakeTearline(GMsg* msg, char* buf);
2001-11-17 21:28:10 +00:00
void DoKludges(int mode, GMsg* msg, int kludges = 0);
2000-02-25 11:04:07 +00:00
void DoTearorig(int mode, GMsg* msg);
void GetRandom(int mode, GMsg* msg);
char* GetRandomLine(char* __buf, size_t __bufsize, const char* __file);
char* HandleRandomLine(char* buf, size_t bufsize);
const char* get_informative_string(void);
char* mime_header_encode(char* dest, const char* source, GMsg* msg);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GEDOIT prototypes
2005-10-30 02:16:01 +00:00
void CmfMsgs(GMsg* msg, bool torecycle);
2000-02-25 11:04:07 +00:00
void LoadText(GMsg* msg, const char* textfile);
2001-03-03 13:16:14 +00:00
void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip=false);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GEDOSS prototypes
void Cleanup(void);
int ShellToDos(char* command, char* message, vattr cls, int cursor, int pause=NO);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GEEDIT prototypes
int EditMsg(int mode, uint* position, GMsg* msg);
void FreePastebuf();
// ------------------------------------------------------------------
// GEFILE prototypes
void CreateFileAddr(GMsg* msg);
void CreateFileMsgs(int mode, GMsg* msg);
void FileSelect(GMsg* msg, char* title, FileSpec* fspec);
// ------------------------------------------------------------------
// GEFIND prototypes
bool FindString(GMsg* msg, const char* prompt, int what);
void FindAll(GMsg* msg, int& topline, int& keyok);
void FindHdr(GMsg* msg, int& topline, int& keyok);
bool SearchHighlight(const Line* line, int row, int width, vattr highlight_color);
2000-02-25 11:04:07 +00:00
void SearchExit();
void AdvancedSearch(GMsg* msg, int& topline, int& keyok);
// ------------------------------------------------------------------
// GEGLOB prototypes
void CfgInit();
void CfgInit2();
void CfgReset(void);
2000-02-25 11:04:07 +00:00
int PlayMacro(gkey key, int type);
int IsMacro(gkey key, int type);
// ------------------------------------------------------------------
// GEINIT prototypes
void Initialize(int argc, char* argv[]);
// ------------------------------------------------------------------
// GELINE prototypes
char *Latin2ISO(char *iso_encoding, const char *latin_encoding);
char *ISO2Latin(char *latin_encoding, const char *iso_encoding);
char *MakeQuotedPrintable(const char *encoding);
char *ExtractPlainCharset(const char *encoding);
bool IsQuotedPrintable(const char *encoding);
2000-02-25 11:04:07 +00:00
int LoadCharset(const char* imp, const char* exp, int query = 0);
Line* AddKludge(Line* line, char* buf, int where=DIR_BELOW);
Line* AddLineFast(Line* line, char* text);
Line* DeleteLine(Line* line);
Line* FirstLine(Line* line);
Line* InsertLine(Line* newline, Line* oldline, int pos);
Line* LastLine(Line* line);
2001-11-13 11:35:21 +00:00
void MakeLineIndex(GMsg* msg, int rmargin, bool getvalue, bool header_recode);
2000-02-25 11:04:07 +00:00
void MsgLineReIndex(GMsg* msg, int viewhidden=-1, int viewkludge=-1, int viewquote=-1);
2005-10-31 11:05:16 +00:00
void Latin2Local(char *str);
void Latin2Local(std::string &str);
2000-03-22 17:59:18 +00:00
char* XlatStr(char* dest, const char* src, int level, Chs* chrtbl, int qpencoded=false, bool i51=false);
2000-02-25 11:04:07 +00:00
char* mime_header_decode(char* decoded, const char* encoded, char* charset = NULL);
char* strxmimecpy(char* dest, const char* source, int level, int size, bool detect = false);
void InvalidateControlInfo(GMsg *msg);
// ------------------------------------------------------------------
// GEMENU prototypes
void DispHeadAttrs(GMsg* msg);
void AskAttributes(GMsg* msg);
2001-03-17 21:17:57 +00:00
bool ProcessAttrs(gkey &key);
2000-02-25 11:04:07 +00:00
void ChgAttrs(int mode, GMsg* msg);
int ChangeAka();
int ChangeCharsIn();
int ChangeCharsOut();
int ChangeTagline();
int ChangeOrigin();
int ChangeTemplate();
int ChangeUsername();
int ChangeXlatImport();
// ------------------------------------------------------------------
// GEMLST prototypes
void MsgThreadlist();
// ------------------------------------------------------------------
// GEMRKS prototypes
void MarkMsgs(GMsg* msg);
int NextMarkedmsg(int direction, GMsg* msg);
// ------------------------------------------------------------------
// GEMSGS prototypes
char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int origarea);
void Rot13(GMsg* msg);
void ResetMsg(GMsg* msg);
int DoCarboncopy(GMsg* msg, GMsg** carbon);
void DoCrosspost(GMsg* msg, std::vector<int> &postareas);
2001-11-13 11:35:21 +00:00
char* ParseInternetAddr(char* __string, char* __name, char* __addr, bool detect_charset = true);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GENODE prototypes
void Lookup(GMsg* msg, ftn_addr* addr, char* name, int topline, char* status);
bool Lookup2(Addr& addr, char* name, int topline, const char* status);
const char *lookup_nodelist(ftn_addr* addr);
void LookupNodeLocation(GMsg* msg, std::string &location, int what);
2000-03-22 17:59:18 +00:00
void LookupNode(GMsg* msg, const char* name, int what);
2000-02-25 11:04:07 +00:00
void CheckNodelists();
// ------------------------------------------------------------------
// GEPLAY prototypes
void InitSound();
void FileToGPlay(GPlay* playbuf, char* filename);
int HandleGEvent(uint event);
int MakeNoise(int type);
void SayBibi();
// ------------------------------------------------------------------
// GEHDRE prototypes
typedef struct {
char *buf;
bool update;
} gsetaddr;
bool set_to_address(GMsg* msg, gsetaddr* toname, gsetaddr* toaddr, gsetaddr* fromaddr, gsetaddr* subj, int pos, char* lng_lookup, bool lookup=true);
// ------------------------------------------------------------------
// GEPOST prototypes
2001-01-27 11:52:13 +00:00
void MakeMsg(int mode, GMsg* oldmsg, bool ignore_replyto=false);
2001-07-03 04:27:54 +00:00
int EditHeaderinfo(int mode, GMsgHeaderView &view, bool doedithdr = true);
2000-02-25 11:04:07 +00:00
void CheckSubject(GMsg* msg, char* subj);
// ------------------------------------------------------------------
// GEQWKS prototypes
int ImportQWK();
int ExportQWK();
// ------------------------------------------------------------------
// GEREAD prototypes
char* GetCurrQuotebuf(char* quotebuf);
int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj);
2005-10-20 21:41:32 +00:00
uint32_t MsgHasReplies(GMsg* msg);
2000-02-25 11:04:07 +00:00
gkey ViewMessage(int istwit=NOT_TWIT);
int LoadMessage(GMsg* msg, int margin);
#ifdef OLD_STYLE_HEADER
2000-02-25 11:04:07 +00:00
void DispHeader(GMsg* msg, bool prn, FILE* fp=NULL, int width=-1);
#endif
2000-02-25 11:04:07 +00:00
void LoadRawMsg(GMsg* msg, int margin);
void make_pathreport(char* reportfile);
void NextArea();
void PrevArea();
void Reader();
void UpdateArea(GMsg* msg);
int ExternUtil(GMsg* __msg, int __utilno);
void ExternUtilMenu(GMsg* msg);
void ReadPeekURLs(GMsg* msg);
2000-02-25 11:04:07 +00:00
uint next_msg(int direction);
void ChangeAttributes();
void ChangeMsg();
void CommentMsg();
void ConfirmMsg();
2005-10-30 02:16:01 +00:00
void CopyMoveForward(bool torecycle = false);
2000-02-25 11:04:07 +00:00
void DecMargin();
void DosShell();
void ExitAsk();
void FileRequest(GMsg* __msg);
void GotoBookMark();
void GotoFirstMsg();
void GotoLastMsg();
void GotoMsgno();
void GotoNextMsg();
void GotoPrevMsg();
void GotoNextUnread();
void GotoPrevUnread();
void GotoReplies();
void GotoReply1st();
void GotoReplyNext();
void GotoReplyPrev();
void GotoThNextUnread();
2000-02-25 11:04:07 +00:00
void IncMargin();
void MakeUserList();
void MakePathreport();
void MarkingOptions();
void MessageBrowse();
void NewArea(bool jumpnext = false);
void NewMsg();
2001-01-27 11:52:13 +00:00
void OtherAreaQuoteMsg(bool ignore_replyto=false);
2000-02-25 11:04:07 +00:00
void OtherAreaCommentMsg();
void QuitNow();
void QuoteBuf(GMsg* msg);
2001-01-27 11:52:13 +00:00
void QuoteMsg(bool ignore_replyto=false);
2000-02-25 11:04:07 +00:00
void RenumberArea();
void ReplyMsg();
void ToggleBookMark();
void ToggleHidden();
void ToggleHiddKlud();
void ToggleKludge();
2003-06-09 05:47:39 +00:00
void ToggleStripHTML();
2000-02-25 11:04:07 +00:00
void ToggleMark();
void ToggleMarkRead();
void TogglePageBar();
void ToggleQuote();
void ToggleRealMsgno();
void ToggleROT13();
void ToggleTwits();
void ToggleStyles();
void ToggleXlat();
void TouchNetscan(int __popup=true);
void UUDecode(GMsg* msg);
void WriteMsg(GMsg* msg);
void TouchSemaphore();
// ------------------------------------------------------------------
// GESCAN prototypes
void CheckSemaphores();
// ------------------------------------------------------------------
// GESOUP prototypes
char* CvtMSGIDtoMessageID(char* midbuf, char* msgid, ftn_addr* addr, char* domain, char* from, char* to, char* subject, struct tm* datetime);
2000-03-22 17:59:18 +00:00
char* CvtMessageIDtoMSGID(const char* mptr, char* msgidbuf, const char* echoid, char* kludge);
2000-02-25 11:04:07 +00:00
int ImportSOUP();
int ExportSOUP();
// ------------------------------------------------------------------
// GETPLS prototypes
void CookieIndex(char* textfile, char* indexfile);
int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origarea);
bool is_user(const char* name);
// ------------------------------------------------------------------
// GEUTIL prototypes
void ScreenBlankIdle();
void IdleCheckSemaphores();
int AkaMatch(ftn_addr* __match, const ftn_addr* __addr);
void call_help();
void CheckTick(gkey quitkey);
char* CvtName(char* inp);
int edit_string(char* buf, int buf_size, char* title, int helpcat);
bool edit_pathname(char* buf, int buf_size, char* title, int helpcat);
int GetAkaNo(const ftn_addr& __aka);
int GetQuotestr(const char* ptr, char* qbuf, uint* qlen);
2001-05-09 20:45:13 +00:00
int cmp_quotes(char* q1, char* q2);
2000-02-25 11:04:07 +00:00
int is_quote(const char* ptr);
2005-10-27 23:41:58 +00:00
bool is_quote2(Line* line, const char* ptr);
2000-02-25 11:04:07 +00:00
int IsQuoteChar(const char* s);
void maketitle();
2002-11-09 21:08:34 +00:00
int maketitle_and_status(char *);
2000-02-25 11:04:07 +00:00
void ProgMeter(int mode, int xx, int yy, long len, long barlen, int attr, long pos, long size);
int ReadCfg(const char* cfg, int ignoreunknown=false);
void ScanMsgTxtForAddr(GMsg* msg);
gkey SearchKey(gkey key, std::list<CmdKey>::iterator keys, int totkeys);
2000-02-25 11:04:07 +00:00
int SearchTaglist(Echo* taglist, char* tag);
void set_title(const char* t, int p, vattr a);
2000-02-25 11:04:07 +00:00
void title_shadow();
void update_statusline(const char* info);
void update_statuslinef(const char* format, const char *token, ...) __attribute__ ((format (printf, 1, 3)));
2000-02-25 11:04:07 +00:00
void update_statuslines();
void w_info(const char* info=NULL);
void w_infof(const char* format, ...) __attribute__ ((format (printf, 1, 2)));
void w_progress(int mode, vattr attr, long pos, long size, const char* title);
2000-02-25 11:04:07 +00:00
void w_shadow();
void ZonegateIt(ftn_addr& gate, ftn_addr& orig, ftn_addr& dest);
char* strtmp(const char* str);
vattr quotecolor(const char* line);
2000-02-25 11:04:07 +00:00
void doinvalidate(char* text, const char* find, const char* replace, bool is_tearline = false);
2003-12-10 08:35:16 +00:00
bool find(const std::vector<const char *> &vec, const char *str);
vattr GetColorName(const char *name, Addr &addr, vattr color);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GEUSRBSE prototypes
bool lookup_addressbook(GMsg* msg, char* name, char* aka, bool browser = false);
void build_pseudo(GMsg* msg, bool direction = true);
void update_addressbook(GMsg* msg, bool reverse = false, bool force = false);
void edit_addressbook(GMsg* msg);
2003-04-03 14:28:59 +00:00
// ------------------------------------------------------------------
// GEMSGID prototypes
2005-10-20 21:41:32 +00:00
uint32_t getMsgId();
uint32_t getClassicMsgId();
2003-04-03 14:28:59 +00:00
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// SOFTCR management
inline bool issoftcr(char c) {
return (c == SOFTCR) and not CFG->switches.get(dispsoftcr);
}
inline char *spanspaces(const char *str) {
if(CFG->switches.get(dispsoftcr))
2002-11-13 16:51:47 +00:00
while(isspace(*str) and (*str != CR))
2000-02-25 11:04:07 +00:00
str++;
else
2002-11-13 16:51:47 +00:00
while((isspace(*str) and (*str != CR)) or (*str == SOFTCR))
2000-02-25 11:04:07 +00:00
str++;
return (char *)str;
}
inline char *spanfeeds(const char *str) {
if(CFG->switches.get(dispsoftcr))
while(*str == LF)
str++;
else
while((*str == LF) or (*str == SOFTCR))
str++;
return (char *)str;
}
2001-03-04 20:30:45 +00:00
// ------------------------------------------------------------------
bool isuucp(const char *name);
// ------------------------------------------------------------------
const char *url_begin(const char *ptr);
2003-06-09 05:47:39 +00:00
// ------------------------------------------------------------------
void RemoveHTML(char *&txt);
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
#endif
// ------------------------------------------------------------------