summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.applications.html
blob: 29755773972e620ff6433fc6bb1d655a15739892 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.applications</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.applications</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/ranger/ranger/applications.pyc">/home/hut/ranger/ranger/applications.pyc</a></font></td></tr></table>
    <p><tt>This&nbsp;module&nbsp;provides&nbsp;helper&nbsp;functions/classes&nbsp;for&nbsp;ranger.defaults.apps.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>(<a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.applications.html#Applications">Applications</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Applications">class <strong>Applications</strong></a>(<a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>This&nbsp;class&nbsp;contains&nbsp;definitions&nbsp;on&nbsp;how&nbsp;to&nbsp;run&nbsp;programs&nbsp;and&nbsp;should<br>
be&nbsp;extended&nbsp;in&nbsp;ranger.defaults.apps<br>
&nbsp;<br>
The&nbsp;user&nbsp;can&nbsp;decide&nbsp;what&nbsp;program&nbsp;to&nbsp;run,&nbsp;and&nbsp;if&nbsp;he&nbsp;uses&nbsp;eg.&nbsp;'vim',&nbsp;the<br>
function&nbsp;app_vim()&nbsp;will&nbsp;be&nbsp;called.&nbsp;&nbsp;However,&nbsp;usually&nbsp;the&nbsp;user<br>
simply&nbsp;wants&nbsp;to&nbsp;"start"&nbsp;the&nbsp;file&nbsp;without&nbsp;specific&nbsp;instructions.<br>
In&nbsp;such&nbsp;a&nbsp;case,&nbsp;app_default()&nbsp;is&nbsp;called,&nbsp;where&nbsp;you&nbsp;should&nbsp;examine<br>
the&nbsp;context&nbsp;and&nbsp;decide&nbsp;which&nbsp;program&nbsp;to&nbsp;use.<br>
&nbsp;<br>
All&nbsp;app&nbsp;functions&nbsp;have&nbsp;a&nbsp;name&nbsp;starting&nbsp;with&nbsp;app_&nbsp;and&nbsp;return&nbsp;a&nbsp;string<br>
containing&nbsp;the&nbsp;whole&nbsp;command&nbsp;or&nbsp;a&nbsp;tuple&nbsp;containing&nbsp;a&nbsp;list&nbsp;of&nbsp;the<br>
arguments.&nbsp;They&nbsp;are&nbsp;supplied&nbsp;with&nbsp;one&nbsp;argument,&nbsp;which&nbsp;is&nbsp;the<br>
AppContext&nbsp;instance.<br>
&nbsp;<br>
You&nbsp;should&nbsp;define&nbsp;at&nbsp;least&nbsp;app_default,&nbsp;app_pager&nbsp;and&nbsp;app_editor&nbsp;since<br>
internal&nbsp;functions&nbsp;depend&nbsp;on&nbsp;those.&nbsp;&nbsp;Here&nbsp;are&nbsp;sample&nbsp;implementations:<br>
&nbsp;<br>
def&nbsp;app_default(self,&nbsp;context):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;context.file.media:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;context.file.video:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;detach&nbsp;videos&nbsp;from&nbsp;the&nbsp;filemanager<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.flags&nbsp;+=&nbsp;'d'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;app_mplayer(context)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;app_editor(context)<br>
&nbsp;<br>
def&nbsp;app_pager(self,&nbsp;context):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;('less',&nbsp;)&nbsp;+&nbsp;tuple(context)<br>
&nbsp;<br>
def&nbsp;app_editor(self,&nbsp;context):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;('vim',&nbsp;)&nbsp;+&nbsp;tuple(context)<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.applications.html#Applications">Applications</a></dd>
<dd><a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a></dd>
<dd><a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Applications-all"><strong>all</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;with&nbsp;all&nbsp;application&nbsp;functions</tt></dd></dl>

<dl><dt><a name="Applications-app_self"><strong>app_self</strong></a>(self, context)</dt><dd><tt>Run&nbsp;the&nbsp;file&nbsp;itself</tt></dd></dl>

<dl><dt><a name="Applications-apply"><strong>apply</strong></a>(self, app, context)</dt></dl>

<dl><dt><a name="Applications-either"><strong>either</strong></a>(self, context, *args)</dt></dl>

<dl><dt><a name="Applications-get"><strong>get</strong></a>(self, app)</dt><dd><tt>Looks&nbsp;for&nbsp;an&nbsp;application,&nbsp;returns&nbsp;app_default&nbsp;if&nbsp;it&nbsp;doesn't&nbsp;exist</tt></dd></dl>

<dl><dt><a name="Applications-has"><strong>has</strong></a>(self, app)</dt><dd><tt>Returns&nbsp;whether&nbsp;an&nbsp;application&nbsp;is&nbsp;defined</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>:<br>
<dl><dt><strong>fm</strong> = None</dl>

<hr>
Data descriptors inherited from <a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-depends_on"><strong>depends_on</strong></a>(*args)</dt></dl>
 <dl><dt><a name="-tup"><strong>tup</strong></a>(*args)</dt><dd><tt>This&nbsp;helper&nbsp;function&nbsp;creates&nbsp;a&nbsp;tuple&nbsp;out&nbsp;of&nbsp;the&nbsp;arguments.<br>
&nbsp;<br>
('a',&nbsp;)&nbsp;+&nbsp;tuple(some_iterator)<br>
is&nbsp;equivalent&nbsp;to:<br>
<a href="#-tup">tup</a>('a',&nbsp;*some_iterator)</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>PIPE</strong> = -1</td></tr></table>
</body></html>
extern void LYConvertToURL(char **AllocatedString, int fixit); extern void LYDoCSI(char *url, const char *comment, char **csi); extern void LYEnsureAbsoluteURL(char **href, const char *name, int fixit); extern void LYFakeZap(int set); extern void LYFixCursesOn(const char *reason); extern void LYFreeHilites(int first, int last); extern void LYFreeStringList(HTList *list); extern void LYLocalFileToURL(char **target, const char *source); extern void LYLocalhostAliases_free(void); extern void LYRenamedTemp(char *oldname, char *newname); extern void LYSetHilite(int cur, const char *text); extern void LYTrimHtmlSep(char *path); extern void LYTrimPathSep(char *path); extern void LYTrimRelFromAbsPath(char *path); extern void LYhighlight(int flag, int cur, const char *target); extern void LYmsec_delay(unsigned msec); extern void LYsetXDisplay(char *new_display); extern void WriteInternalTitle(FILE *fp0, const char *Title); extern void WriteStreamTitle(HTStream *target, const char *Title); extern void change_sug_filename(char *fname); extern void convert_to_spaces(char *string, int condense); extern void free_and_clear(char **obj); extern void noviceline(int more_flag); extern void parse_restrictions(const char *s); extern void print_restrictions_to_fd(FILE *fp); extern void remove_backslashes(char *buf); extern void size_change(int sig); extern void statusline(const char *text); extern void toggle_novice_line(void); #if defined(MULTI_USER_UNIX) extern BOOL IsOurFile(const char *name); #else #define IsOurFile(name) TRUE #endif #ifdef USE_ASCII_CTYPES extern int ascii_tolower(int i); extern int ascii_toupper(int i); extern int ascii_isupper(int i); #endif #ifdef __CYGWIN__ extern int Cygwin_Shell(void); #endif #if defined(_WIN_CC) || defined(WIN_EX) extern int exec_command(char *cmd, int wait_flag); /* xsystem.c */ extern char *quote_pathname(char *pathname); extern int xsystem(char *cmd); #endif /* Keeping track of User Interface Pages: */ typedef enum { UIP_UNKNOWN = -1 ,UIP_HISTORY = 0 ,UIP_DOWNLOAD_OPTIONS ,UIP_PRINT_OPTIONS ,UIP_SHOWINFO ,UIP_LIST_PAGE ,UIP_VLINKS ,UIP_LYNXCFG ,UIP_OPTIONS_MENU ,UIP_DIRED_MENU ,UIP_PERMIT_OPTIONS ,UIP_UPLOAD_OPTIONS ,UIP_ADDRLIST_PAGE ,UIP_CONFIG_DEF ,UIP_TRACELOG ,UIP_INSTALL } UIP_t; #define UIP_P_FRAG 0x0001 /* flag: consider "url#frag" as matching "url" */ extern BOOL LYIsUIPage3(const char *url, UIP_t type, int flagparam); #define LYIsUIPage(url,type) LYIsUIPage3(url, type, UIP_P_FRAG) extern void LYRegisterUIPage(const char *url, UIP_t type); #define LYUnRegisterUIPage(type) LYRegisterUIPage(NULL, type) extern void LYUIPages_free(void); #ifdef CAN_CUT_AND_PASTE extern int put_clip(const char *szBuffer); /* get_clip_grab() returns a pointer to the string in the system area. get_clip_release() should be called ASAP after this. */ extern char *get_clip_grab(void); extern void get_clip_release(void); # ifdef WIN_EX # define size_clip() 8192 # else extern int size_clip(void); # endif #endif #if defined(WIN_EX) /* 1997/10/16 (Thu) 20:13:28 */ extern char *HTDOS_short_name(const char *path); extern char *w32_strerror(DWORD ercode); #endif #if defined(WIN_EX) || defined(__CYGWIN__) /* 2000/03/07 (Tue) 17:17:46 */ extern int unsafe_filename(const char *fname); extern FILE *safe_fopen(const char *fname, const char *mode); #endif #ifdef VMS extern void Define_VMSLogical(char *LogicalName, char *LogicalValue); #endif /* VMS */ #if !defined(HAVE_PUTENV) extern int putenv(const char *string); #endif /* HAVE_PUTENV */ #if defined(MULTI_USER_UNIX) extern void LYRelaxFilePermissions(const char *name); #else #define LYRelaxFilePermissions(name) /* nothing */ #endif #if defined(_WINDOWS) extern int win32_check_interrupt(void); #if (defined(__MINGW32__) && !defined(HAVE_SLEEP)) #undef sleep void sleep(unsigned sec); #endif #endif /* * Whether or not the status line must be shown. */ extern BOOLEAN mustshow; #define _statusline(msg) mustshow = TRUE, statusline(msg) /* * For is_url(). * * Universal document id types (see LYCheckForProxyURL) */ typedef enum { NOT_A_URL_TYPE = 0, UNKNOWN_URL_TYPE = 1, /* must be nonzero */ HTTP_URL_TYPE, FILE_URL_TYPE, FTP_URL_TYPE, NCFTP_URL_TYPE, WAIS_URL_TYPE, NEWS_URL_TYPE, NNTP_URL_TYPE, TELNET_URL_TYPE, TN3270_URL_TYPE, RLOGIN_URL_TYPE, GOPHER_URL_TYPE, HTML_GOPHER_URL_TYPE, TELNET_GOPHER_URL_TYPE, INDEX_GOPHER_URL_TYPE, MAILTO_URL_TYPE, BIBP_URL_TYPE, FINGER_URL_TYPE, CSO_URL_TYPE, HTTPS_URL_TYPE, SNEWS_URL_TYPE, PROSPERO_URL_TYPE, AFS_URL_TYPE, DATA_URL_TYPE, LYNXCGI_URL_TYPE, LYNXEXEC_URL_TYPE, LYNXPROG_URL_TYPE, NEWSPOST_URL_TYPE, NEWSREPLY_URL_TYPE, SNEWSPOST_URL_TYPE, SNEWSREPLY_URL_TYPE, LYNXCACHE_URL_TYPE, LYNXCFG_URL_TYPE, LYNXCOMPILE_OPTS_URL_TYPE, LYNXCOOKIE_URL_TYPE, LYNXDIRED_URL_TYPE, LYNXDOWNLOAD_URL_TYPE, LYNXEDITMAP_URL_TYPE, LYNXHIST_URL_TYPE, LYNXIMGMAP_URL_TYPE, LYNXKEYMAP_URL_TYPE, LYNXMESSAGES_URL_TYPE, LYNXOPTIONS_URL_TYPE, LYNXPRINT_URL_TYPE, PROXY_URL_TYPE } UrlTypes; extern UrlTypes LYCheckForProxyURL(char *filename); extern UrlTypes is_url(char *filename); /* common URLs */ #define STR_BIBP_URL "bibp:" #define LEN_BIBP_URL 5 #define isBIBP_URL(addr) !strncasecomp(addr, STR_BIBP_URL, LEN_BIBP_URL) #define STR_CSO_URL "cso:" #define LEN_CSO_URL 4 #define isCSO_URL(addr) !strncasecomp(addr, STR_CSO_URL, LEN_CSO_URL) #define STR_FILE_URL "file:" #define LEN_FILE_URL 5 #define isFILE_URL(addr) ((*addr == 'f' || *addr == 'F') &&\ !strncasecomp(addr, STR_FILE_URL, LEN_FILE_URL)) #define STR_FINGER_URL "finger:" #define LEN_FINGER_URL 7 #define isFINGER_URL(addr) !strncasecomp(addr, STR_FINGER_URL, LEN_FINGER_URL) #define STR_FTP_URL "ftp:" #define LEN_FTP_URL 4 #define isFTP_URL(addr) !strncasecomp(addr, STR_FTP_URL, LEN_FTP_URL) #define STR_GOPHER_URL "gopher:" #define LEN_GOPHER_URL 7 #define isGOPHER_URL(addr) !strncasecomp(addr, STR_GOPHER_URL, LEN_GOPHER_URL) #define STR_HTTP_URL "http:" #define LEN_HTTP_URL 5 #define isHTTP_URL(addr) !strncasecomp(addr, STR_HTTP_URL, LEN_HTTP_URL) #define STR_HTTPS_URL "https:" #define LEN_HTTPS_URL 6 #define isHTTPS_URL(addr) !strncasecomp(addr, STR_HTTPS_URL, LEN_HTTPS_URL) #define STR_MAILTO_URL "mailto:" #define LEN_MAILTO_URL 7 #define isMAILTO_URL(addr) !strncasecomp(addr, STR_MAILTO_URL, LEN_MAILTO_URL) #define STR_NEWS_URL "news:" #define LEN_NEWS_URL 5 #define isNEWS_URL(addr) !strncasecomp(addr, STR_NEWS_URL, LEN_NEWS_URL) #define STR_NNTP_URL "nntp:" #define LEN_NNTP_URL 5 #define isNNTP_URL(addr) !strncasecomp(addr, STR_NNTP_URL, LEN_NNTP_URL) #define STR_RLOGIN_URL "rlogin:" #define LEN_RLOGIN_URL 7 #define isRLOGIN_URL(addr) !strncasecomp(addr, STR_RLOGIN_URL, LEN_RLOGIN_URL) #define STR_SNEWS_URL "snews:" #define LEN_SNEWS_URL 6 #define isSNEWS_URL(addr) !strncasecomp(addr, STR_SNEWS_URL, LEN_SNEWS_URL) #define STR_TELNET_URL "telnet:" #define LEN_TELNET_URL 7 #define isTELNET_URL(addr) !strncasecomp(addr, STR_TELNET_URL, LEN_TELNET_URL) #define STR_TN3270_URL "tn3270:" #define LEN_TN3270_URL 7 #define isTN3270_URL(addr) !strncasecomp(addr, STR_TN3270_URL, LEN_TN3270_URL) #define STR_WAIS_URL "wais:" #define LEN_WAIS_URL 5 #define isWAIS_URL(addr) !strncasecomp(addr, STR_WAIS_URL, LEN_WAIS_URL) /* internal URLs */ #ifdef USE_CACHEJAR #define STR_LYNXCACHE "LYNXCACHE:" #define LEN_LYNXCACHE 10 #define isLYNXCACHE(addr) !strncasecomp(addr, STR_LYNXCACHE, LEN_LYNXCACHE) #else #define isLYNXCACHE(addr) FALSE #endif #define STR_LYNXCFG "LYNXCFG:" #define LEN_LYNXCFG 8 #define isLYNXCFG(addr) !strncasecomp(addr, STR_LYNXCFG, LEN_LYNXCFG) #define STR_LYNXCFLAGS "LYNXCOMPILEOPTS:" #define LEN_LYNXCFLAGS 16 #define isLYNXCFLAGS(addr) !strncasecomp(addr, STR_LYNXCFLAGS, LEN_LYNXCFLAGS) #define STR_LYNXCGI "lynxcgi:" #define LEN_LYNXCGI 8 #define isLYNXCGI(addr) ((*addr == 'l' || *addr == 'L') &&\ !strncasecomp(addr, STR_LYNXCGI, LEN_LYNXCGI)) #define STR_LYNXCOOKIE "LYNXCOOKIE:" #define LEN_LYNXCOOKIE 11 #define isLYNXCOOKIE(addr) !strncasecomp(addr, STR_LYNXCOOKIE, LEN_LYNXCOOKIE) #define STR_LYNXDIRED "LYNXDIRED:" #define LEN_LYNXDIRED 10 #define isLYNXDIRED(addr) !strncasecomp(addr, STR_LYNXDIRED, LEN_LYNXDIRED) #define STR_LYNXEXEC "lynxexec:" #define LEN_LYNXEXEC 9 #define isLYNXEXEC(addr) ((*addr == 'l' || *addr == 'L') &&\ !strncasecomp(addr, STR_LYNXEXEC, LEN_LYNXEXEC)) #define STR_LYNXDOWNLOAD "LYNXDOWNLOAD:" #define LEN_LYNXDOWNLOAD 13 #define isLYNXDOWNLOAD(addr) !strncasecomp(addr, STR_LYNXDOWNLOAD, LEN_LYNXDOWNLOAD) #define STR_LYNXEDITMAP "LYNXEDITMAP:" #define LEN_LYNXEDITMAP 11 #define isLYNXEDITMAP(addr) !strncasecomp(addr, STR_LYNXEDITMAP, LEN_LYNXEDITMAP) #define STR_LYNXHIST "LYNXHIST:" #define LEN_LYNXHIST 9 #define isLYNXHIST(addr) !strncasecomp(addr, STR_LYNXHIST, LEN_LYNXHIST) #define STR_LYNXKEYMAP "LYNXKEYMAP:" #define LEN_LYNXKEYMAP 11 #define isLYNXKEYMAP(addr) !strncasecomp(addr, STR_LYNXKEYMAP, LEN_LYNXKEYMAP) #define STR_LYNXIMGMAP "LYNXIMGMAP:" #define LEN_LYNXIMGMAP 11 #define isLYNXIMGMAP(addr) !strncasecomp(addr, STR_LYNXIMGMAP, LEN_LYNXIMGMAP) #define STR_LYNXMESSAGES "LYNXMESSAGES:" #define LEN_LYNXMESSAGES 13 #define isLYNXMESSAGES(addr) !strncasecomp(addr, STR_LYNXMESSAGES, LEN_LYNXMESSAGES) #define STR_LYNXOPTIONS "LYNXOPTIONS:" #define LEN_LYNXOPTIONS 12 #define isLYNXOPTIONS(addr) !strncasecomp(addr, STR_LYNXOPTIONS, LEN_LYNXOPTIONS) #define STR_LYNXPRINT "LYNXPRINT:" #define LEN_LYNXPRINT 10 #define isLYNXPRINT(addr) !strncasecomp(addr, STR_LYNXPRINT, LEN_LYNXPRINT) #define STR_LYNXPROG "lynxprog:" #define LEN_LYNXPROG 9 #define isLYNXPROG(addr) ((*addr == 'l' || *addr == 'L') &&\ !strncasecomp(addr, STR_LYNXPROG, LEN_LYNXPROG)) #define LYNXOPTIONS_PAGE(s) STR_LYNXOPTIONS s /* * For change_sug_filename(). */ extern HTList *sug_filenames; /* * syslog() facility */ #if defined(SYSLOG_REQUESTED_URLS) extern void LYOpenlog(const char *banner); extern void LYSyslog(char *arg); extern void LYCloselog(void); #endif /* SYSLOG_REQUESTED_URLS */ #undef STREQ /* conflict with wais.h */ /* * Miscellaneous. */ #define STREQ(a,b) (strcmp(a,b) == 0) #define STRNEQ(a,b,c) (StrNCmp(a,b,c) == 0) #define HIDE_CHMOD 0600 #define HIDE_UMASK 0077 #if defined(DOSPATH) || defined(__CYGWIN__) #define TXT_R "rt" #define TXT_W "wt" #define TXT_A "at+" #else #define TXT_R "r" #define TXT_W "w" #define TXT_A "a+" #endif #define BIN_R "rb" #define BIN_W "wb" #define BIN_A "ab+" #ifdef __cplusplus } #endif #endif /* LYUTILS_H */