.TH "pacparser" 3 "Tue Sep 1 2015" "Pacparser" \" -*- nroff -*- .ad l .nh .SH NAME pacparser - Library to parse proxy auto-confg (PAC) files. .PP API for pacparser library, a library to use proxy auto-config (PAC) files\&. See project homepage: http://github.com/pacparser/pacparser for more information\&. .SS "Typedefs" .in +1c .ti -1c .RI "typedef int(* \fBpacparser_error_printer\fP )(const char *fmt, va_list argp)" .br .RI "\fIType definition for pacparser_error_printer\&. \fP" .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBpacparser_init\fP (void)" .br .RI "\fIInitializes pac parser\&. \fP" .ti -1c .RI "int \fBpacparser_parse_pac_file\fP (const char *pacfile)" .br .RI "\fIParses the given PAC file\&. \fP" .ti -1c .RI "int \fBpacparser_parse_pac_string\fP (const char *pacstring)" .br .RI "\fIParses the given PAC script string\&. \fP" .ti -1c .RI "int \fBpacparser_parse_pac\fP (const char *pacfile)" .br .RI "\fIParses the gievn pac file\&. \fP" .ti -1c .RI "char * \fBpacparser_find_proxy\fP (const char *url, const char *host)" .br .RI "\fIFinds proxy for the given URL and Host\&. \fP" .ti -1c .RI "char * \fBpacparser_just_find_proxy\fP (const char *pacfile, const char *url, const char *host)" .br .RI "\fIFinds proxy for the given PAC file, URL and Host\&. \fP" .ti -1c .RI "void \fBpacparser_cleanup\fP (void)" .br .RI "\fIDestroys JavaSctipt context\&. \fP" .ti -1c .RI "void \fBpacparser_setmyip\fP (const char *ip)" .br .RI "\fISets my IP address\&. \fP" .ti -1c .RI "void \fBpacparser_set_error_printer\fP (\fBpacparser_error_printer\fP func)" .br .RI "\fISets error printing function\&. \fP" .ti -1c .RI "void \fBpacparser_enable_microsoft_extensions\fP (void)" .br .RI "\fI(Deprecated) Enable Microsoft IPv6 PAC extensions\&. \fP" .ti -1c .RI "char * \fBpacparser_version\fP (void)" .br .RI "\fIReturns pacparser version\&. \fP" .in -1c .SH "Detailed Description" .PP API for pacparser library, a library to use proxy auto-config (PAC) files\&. See project homepage: http://github.com/pacparser/pacparser for more information\&. .PP \fBAuthor:\fP .RS 4 Manu Garg manugarg@gmail.com .RE .PP .SH "Function Documentation" .PP .SS "int pacparser_init (void)" .PP Initializes pac parser\&. .PP \fBReturns:\fP .RS 4 0 on failure and 1 on success\&. .RE .PP Initializes JavaScript engine and does few basic initializations specific to pacparser\&. .SS "int pacparser_parse_pac_file (const char *pacfile)" .PP Parses the given PAC file\&. .PP \fBParameters:\fP .RS 4 \fIpacfile\fP PAC file to parse\&. .RE .PP \fBReturns:\fP .RS 4 0 on failure and 1 on success\&. .RE .PP Reads the given PAC file and evaluates it in the JavaScript context created by pacparser_init\&. .SS "int pacparser_parse_pac_string (const char *pacstring)" .PP Parses the given PAC script string\&. .PP \fBParameters:\fP .RS 4 \fIpacstring\fP PAC string to parse\&. .RE .PP \fBReturns:\fP .RS 4 0 on failure and 1 on success\&. .RE .PP Evaulates the given PAC script string in the JavaScript context created by pacparser_init\&. .SS "int pacparser_parse_pac (const char *pacfile)" .PP Parses the gievn pac file\&. .PP \fBDeprecated\fP .RS 4 Use pacparser_parse_pac_file instead\&. .PP \fBParameters:\fP .RS 4 \fIpacfile\fP PAC file to parse\&. .RE .PP \fBReturns:\fP .RS 4 0 on failure and 1 on success\&. .RE .PP .RE .PP .PP Same as pacparser_parse_pac_file\&. Included only for backward compatibility\&. .SS "char* pacparser_find_proxy (const char *url, const char *host)" .PP Finds proxy for the given URL and Host\&. .PP \fBParameters:\fP .RS 4 \fIurl\fP URL to find proxy for\&. .br \fIhost\fP Host part of the URL\&. .RE .PP \fBReturns:\fP .RS 4 proxy string on sucess and NULL on error\&. .RE .PP 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)\&. .SS "char* pacparser_just_find_proxy (const char *pacfile, const char *url, const char *host)" .PP Finds proxy for the given PAC file, URL and Host\&. .PP \fBParameters:\fP .RS 4 \fIpacfile\fP PAC file to parse\&. .br \fIurl\fP URL to find proxy for\&. .br \fIhost\fP Host part of the URL\&. .RE .PP \fBReturns:\fP .RS 4 proxy string on success and NULL on error\&. .RE .PP 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\&. .SS "void pacparser_cleanup (void)" .PP Destroys JavaSctipt context\&. This function should be called once you're done with using pacparser engine\&. .SS "void pacparser_setmyip (const char *ip)" .PP Sets my IP address\&. .PP \fBParameters:\fP .RS 4 \fIip\fP Custom IP address\&. .RE .PP Sets my IP address to a custom value\&. This is the IP address returned by myIpAddress() javascript function\&. .SS "void pacparser_set_error_printer (\fBpacparser_error_printer\fPfunc)" .PP Sets error printing function\&. .PP \fBParameters:\fP .RS 4 \fIfunc\fP Printing function\&. .RE .PP 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\&. .SS "void pacparser_enable_microsoft_extensions (void)" .PP (Deprecated) Enable Microsoft IPv6 PAC extensions\&. Deprecated\&. IPv6 extension (*Ex functions) are enabled by default now\&. .SS "char* pacparser_version (void)" .PP Returns pacparser version\&. .PP \fBReturns:\fP .RS 4 version string if version defined, '' otherwise\&. .RE .PP 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\&. .SH "Author" .PP Generated automatically by Doxygen for Pacparser from the source code\&.