| 1 |
.TH "pacparser" 3 "Tue Sep 1 2015" "Pacparser" \" -*- nroff -*- |
| 2 |
.ad l |
| 3 |
.nh |
| 4 |
.SH NAME |
| 5 |
pacparser - Library to parse proxy auto-confg (PAC) files. |
| 6 |
.PP |
| 7 |
API for pacparser library, a library to use proxy auto-config (PAC) files\&. See project homepage: http://github.com/manugarg/pacparser for more information\&. |
| 8 |
|
| 9 |
.SS "Typedefs" |
| 10 |
|
| 11 |
.in +1c |
| 12 |
.ti -1c |
| 13 |
.RI "typedef int(* \fBpacparser_error_printer\fP )(const char *fmt, va_list argp)" |
| 14 |
.br |
| 15 |
.RI "\fIType definition for pacparser_error_printer\&. \fP" |
| 16 |
.in -1c |
| 17 |
.SS "Functions" |
| 18 |
|
| 19 |
.in +1c |
| 20 |
.ti -1c |
| 21 |
.RI "int \fBpacparser_init\fP (void)" |
| 22 |
.br |
| 23 |
.RI "\fIInitializes pac parser\&. \fP" |
| 24 |
.ti -1c |
| 25 |
.RI "int \fBpacparser_parse_pac_file\fP (const char *pacfile)" |
| 26 |
.br |
| 27 |
.RI "\fIParses the given PAC file\&. \fP" |
| 28 |
.ti -1c |
| 29 |
.RI "int \fBpacparser_parse_pac_string\fP (const char *pacstring)" |
| 30 |
.br |
| 31 |
.RI "\fIParses the given PAC script string\&. \fP" |
| 32 |
.ti -1c |
| 33 |
.RI "int \fBpacparser_parse_pac\fP (const char *pacfile)" |
| 34 |
.br |
| 35 |
.RI "\fIParses the gievn pac file\&. \fP" |
| 36 |
.ti -1c |
| 37 |
.RI "char * \fBpacparser_find_proxy\fP (const char *url, const char *host)" |
| 38 |
.br |
| 39 |
.RI "\fIFinds proxy for the given URL and Host\&. \fP" |
| 40 |
.ti -1c |
| 41 |
.RI "char * \fBpacparser_just_find_proxy\fP (const char *pacfile, const char *url, const char *host)" |
| 42 |
.br |
| 43 |
.RI "\fIFinds proxy for the given PAC file, URL and Host\&. \fP" |
| 44 |
.ti -1c |
| 45 |
.RI "void \fBpacparser_cleanup\fP (void)" |
| 46 |
.br |
| 47 |
.RI "\fIDestroys JavaSctipt context\&. \fP" |
| 48 |
.ti -1c |
| 49 |
.RI "void \fBpacparser_setmyip\fP (const char *ip)" |
| 50 |
.br |
| 51 |
.RI "\fISets my IP address\&. \fP" |
| 52 |
.ti -1c |
| 53 |
.RI "void \fBpacparser_set_error_printer\fP (\fBpacparser_error_printer\fP func)" |
| 54 |
.br |
| 55 |
.RI "\fISets error printing function\&. \fP" |
| 56 |
.ti -1c |
| 57 |
.RI "void \fBpacparser_enable_microsoft_extensions\fP (void)" |
| 58 |
.br |
| 59 |
.RI "\fI(Deprecated) Enable Microsoft IPv6 PAC extensions\&. \fP" |
| 60 |
.ti -1c |
| 61 |
.RI "char * \fBpacparser_version\fP (void)" |
| 62 |
.br |
| 63 |
.RI "\fIReturns pacparser version\&. \fP" |
| 64 |
.in -1c |
| 65 |
.SH "Detailed Description" |
| 66 |
.PP |
| 67 |
API for pacparser library, a library to use proxy auto-config (PAC) files\&. See project homepage: http://github.com/manugarg/pacparser for more information\&. |
| 68 |
|
| 69 |
|
| 70 |
.PP |
| 71 |
\fBAuthor:\fP |
| 72 |
.RS 4 |
| 73 |
Manu Garg [email protected] |
| 74 |
.RE |
| 75 |
.PP |
| 76 |
|
| 77 |
.SH "Function Documentation" |
| 78 |
.PP |
| 79 |
.SS "int pacparser_init (void)" |
| 80 |
|
| 81 |
.PP |
| 82 |
Initializes pac parser\&. |
| 83 |
.PP |
| 84 |
\fBReturns:\fP |
| 85 |
.RS 4 |
| 86 |
0 on failure and 1 on success\&. |
| 87 |
.RE |
| 88 |
.PP |
| 89 |
Initializes JavaScript engine and does few basic initializations specific to pacparser\&. |
| 90 |
.SS "int pacparser_parse_pac_file (const char *pacfile)" |
| 91 |
|
| 92 |
.PP |
| 93 |
Parses the given PAC file\&. |
| 94 |
.PP |
| 95 |
\fBParameters:\fP |
| 96 |
.RS 4 |
| 97 |
\fIpacfile\fP PAC file to parse\&. |
| 98 |
.RE |
| 99 |
.PP |
| 100 |
\fBReturns:\fP |
| 101 |
.RS 4 |
| 102 |
0 on failure and 1 on success\&. |
| 103 |
.RE |
| 104 |
.PP |
| 105 |
Reads the given PAC file and evaluates it in the JavaScript context created by pacparser_init\&. |
| 106 |
.SS "int pacparser_parse_pac_string (const char *pacstring)" |
| 107 |
|
| 108 |
.PP |
| 109 |
Parses the given PAC script string\&. |
| 110 |
.PP |
| 111 |
\fBParameters:\fP |
| 112 |
.RS 4 |
| 113 |
\fIpacstring\fP PAC string to parse\&. |
| 114 |
.RE |
| 115 |
.PP |
| 116 |
\fBReturns:\fP |
| 117 |
.RS 4 |
| 118 |
0 on failure and 1 on success\&. |
| 119 |
.RE |
| 120 |
.PP |
| 121 |
Evaluates the given PAC script string in the JavaScript context created by pacparser_init\&. |
| 122 |
.SS "int pacparser_parse_pac (const char *pacfile)" |
| 123 |
|
| 124 |
.PP |
| 125 |
Parses the gievn pac file\&. |
| 126 |
.PP |
| 127 |
\fBDeprecated\fP |
| 128 |
.RS 4 |
| 129 |
Use pacparser_parse_pac_file instead\&. |
| 130 |
.PP |
| 131 |
\fBParameters:\fP |
| 132 |
.RS 4 |
| 133 |
\fIpacfile\fP PAC file to parse\&. |
| 134 |
.RE |
| 135 |
.PP |
| 136 |
\fBReturns:\fP |
| 137 |
.RS 4 |
| 138 |
0 on failure and 1 on success\&. |
| 139 |
.RE |
| 140 |
.PP |
| 141 |
.RE |
| 142 |
.PP |
| 143 |
.PP |
| 144 |
Same as pacparser_parse_pac_file\&. Included only for backward compatibility\&. |
| 145 |
.SS "char* pacparser_find_proxy (const char *url, const char *host)" |
| 146 |
|
| 147 |
.PP |
| 148 |
Finds proxy for the given URL and Host\&. |
| 149 |
.PP |
| 150 |
\fBParameters:\fP |
| 151 |
.RS 4 |
| 152 |
\fIurl\fP URL to find proxy for\&. |
| 153 |
.br |
| 154 |
\fIhost\fP Host part of the URL\&. |
| 155 |
.RE |
| 156 |
.PP |
| 157 |
\fBReturns:\fP |
| 158 |
.RS 4 |
| 159 |
proxy string on success and NULL on error\&. |
| 160 |
.RE |
| 161 |
.PP |
| 162 |
Finds proxy for the given URL and Host\&. This function should be called only after pacparser engine has been initialized (using pacparser_init) and pac script has been parsed (using pacparser_parse_pac_file or pacparser_parse_pac_string)\&. |
| 163 |
.SS "char* pacparser_just_find_proxy (const char *pacfile, const char *url, const char *host)" |
| 164 |
|
| 165 |
.PP |
| 166 |
Finds proxy for the given PAC file, URL and Host\&. |
| 167 |
.PP |
| 168 |
\fBParameters:\fP |
| 169 |
.RS 4 |
| 170 |
\fIpacfile\fP PAC file to parse\&. |
| 171 |
.br |
| 172 |
\fIurl\fP URL to find proxy for\&. |
| 173 |
.br |
| 174 |
\fIhost\fP Host part of the URL\&. |
| 175 |
.RE |
| 176 |
.PP |
| 177 |
\fBReturns:\fP |
| 178 |
.RS 4 |
| 179 |
proxy string on success and NULL on error\&. |
| 180 |
.RE |
| 181 |
.PP |
| 182 |
This function is a wrapper around functions pacparser_init, pacparser_parse_pac_file, pacparser_find_proxy and pacparser_cleanup\&. If you just want to find out proxy for a given set of pac file, url and host, this is the function to call\&. This function takes care of all the initialization and cleanup\&. |
| 183 |
.SS "void pacparser_cleanup (void)" |
| 184 |
|
| 185 |
.PP |
| 186 |
Destroys JavaSctipt context\&. This function should be called once you're done with using pacparser engine\&. |
| 187 |
.SS "void pacparser_setmyip (const char *ip)" |
| 188 |
|
| 189 |
.PP |
| 190 |
Sets my IP address\&. |
| 191 |
.PP |
| 192 |
\fBParameters:\fP |
| 193 |
.RS 4 |
| 194 |
\fIip\fP Custom IP address\&. |
| 195 |
.RE |
| 196 |
.PP |
| 197 |
Sets my IP address to a custom value\&. This is the IP address returned by myIpAddress() javascript function\&. |
| 198 |
.SS "void pacparser_set_error_printer (\fBpacparser_error_printer\fPfunc)" |
| 199 |
|
| 200 |
.PP |
| 201 |
Sets error printing function\&. |
| 202 |
.PP |
| 203 |
\fBParameters:\fP |
| 204 |
.RS 4 |
| 205 |
\fIfunc\fP Printing function\&. |
| 206 |
.RE |
| 207 |
.PP |
| 208 |
Sets error variadic-argument printing function\&. If not set the messages are printed to stderr\&. If messages begin with DEBUG: or WARNING:, they are not fatal error messages, otherwise they are\&. May be called before \fBpacparser_init()\fP\&. |
| 209 |
.SS "void pacparser_enable_microsoft_extensions (void)" |
| 210 |
|
| 211 |
.PP |
| 212 |
(Deprecated) Enable Microsoft IPv6 PAC extensions\&. Deprecated\&. IPv6 extension (*Ex functions) are enabled by default now\&. |
| 213 |
.SS "char* pacparser_version (void)" |
| 214 |
|
| 215 |
.PP |
| 216 |
Returns pacparser version\&. |
| 217 |
.PP |
| 218 |
\fBReturns:\fP |
| 219 |
.RS 4 |
| 220 |
version string if version defined, '' otherwise\&. |
| 221 |
.RE |
| 222 |
.PP |
| 223 |
Version string is determined at the time of build\&. If built from a released package, version corresponds to the latest release (git) tag\&. If built from the repository, it corresponds to the head revision of the repo\&. |
| 224 |
.SH "Author" |
| 225 |
.PP |
| 226 |
Generated automatically by Doxygen for Pacparser from the source code\&. |