Move issoftcr(), spanspaces() and spanfeeds() into goldlib

This commit is contained in:
Stas Degteff 2008-01-20 14:45:52 +00:00
parent 0180aaf0dd
commit 6aa5bd173f
2 changed files with 24 additions and 29 deletions

View File

@ -494,33 +494,6 @@ void build_pseudo(GMsg* msg, bool direction = true);
void update_addressbook(GMsg* msg, bool reverse = false, bool force = false);
void edit_addressbook(GMsg* msg);
// ------------------------------------------------------------------
// SOFTCR management
// Detects SoftCR only if DispsoftCR is ON
inline bool issoftcr(char c)
{
return not WideDispsoftcr and (c == SOFTCR);
}
// Skip spaces and SoftCRs (if DispsoftCR is ON)
inline char *spanspaces(const char *str)
{
while ( (isspace(*str) and (*str != CR)) or issoftcr(*str) )
str++;
return (char *)str;
}
// Skip LineFeeds and SoftCRs (if DispsoftCR is ON)
inline char *spanfeeds(const char *str)
{
while ( (*str == LF) or issoftcr(*str) )
str++;
return (char *)str;
}
// ------------------------------------------------------------------
bool isuucp(const char *name);

View File

@ -271,15 +271,37 @@ extern uint WideSharemode;
extern bool WideDispsoftcr; // DispsoftCR for current area
extern int WidePersonalmail;
// ------------------------------------------------------------------
bool PopupLocked(long __tries, int __isopen, const char* __file);
const char* Unpack(const char* archive);
void CleanUnpacked(const char* unpacked);
// ------------------------------------------------------------------
// SOFTCR management
// Detects SoftCR only if DispsoftCR is ON
inline bool issoftcr(char c)
{
return not WideDispsoftcr and (c == SOFTCR);
}
// Skip spaces and SoftCRs (if DispsoftCR is ON)
inline char *spanspaces(const char *str)
{
while ( (isspace(*str) and (*str != CR)) or issoftcr(*str) )
str++;
return (char *)str;
}
// Skip LineFeeds and SoftCRs (if DispsoftCR is ON)
inline char *spanfeeds(const char *str)
{
while ( (*str == LF) or issoftcr(*str) )
str++;
return (char *)str;
}
#endif