gretl_www

gretl_www

Functions

Types and Values

enum CGIOpt

Description

Functions

gretl_www_init ()

int
gretl_www_init (const char *host,
                const char *proxy,
                int use_proxy);

gretl_www_cleanup ()

void
gretl_www_cleanup (void);

list_remote_dbs ()

int
list_remote_dbs (char **getbuf);

list_remote_function_packages ()

int
list_remote_function_packages (char **getbuf,
                               int filter);

list_remote_function_categories ()

int
list_remote_function_categories (char **getbuf);

list_remote_data_packages ()

int
list_remote_data_packages (char **getbuf);

retrieve_remote_db_index ()

int
retrieve_remote_db_index (const char *dbname,
                          char **getbuf);

retrieve_remote_db ()

int
retrieve_remote_db (const char *dbname,
                    const char *localname,
                    int opt);

check_remote_db ()

int
check_remote_db (const char *dbname);

retrieve_remote_function_package ()

int
retrieve_remote_function_package (const char *pkgname,
                                  const char *localname);

Retrieves the specified file from the gretl data server.

Parameters

pkgname

name of function package to retrieve, e.g. "foo.gfn".

 

localname

full path to which the package file should be written on the local machine.

 

Returns

0 on success, non-zero on failure.


retrieve_remote_gfn_content ()

int
retrieve_remote_gfn_content (const char *zipname,
                             const char *localname);

Retrieves the gfn file from within a function package on the gretl server that takes the form of a zip file.

Parameters

zipname

name of function package, e.g. "foo.zip".

 

localname

full path to which the gfn file should be written on the local machine.

 

Returns

0 on success, non-zero on failure.


retrieve_remote_pkg_filename ()

char *
retrieve_remote_pkg_filename (const char *pkgname,
                              int *err);

Parameters

pkgname

name of function package, without extension.

 

err

location to receive error code.

 

Returns

the completed package filename, with .gfn or .zip extension, or NULL on failure.


retrieve_remote_datafiles_package ()

int
retrieve_remote_datafiles_package (const char *pkgname,
                                   const char *localname);

Retrieves the specified package from sourceforge.

Parameters

pkgname

name of data files package to retrieve, e.g. "wooldridge.tar.gz".

 

localname

full path to which the package file should be written on the local machine.

 

Returns

0 on success, non-zero on failure.


retrieve_remote_db_data ()

int
retrieve_remote_db_data (const char *dbname,
                         const char *varname,
                         char **getbuf,
                         int opt);

Retrieves the specified data from the gretl data server.

Parameters

dbname

name of gretl database to access.

 

varname

name of the variable (series) to retrieve.

 

getbuf

location to receive allocated buffer containing the data.

 

opt

either GRAB_NBO_DATA to get data in network byte order, or GRAB_DATA to get the data in little-endian order.

 

Returns

0 on success, non-zero on failure.


retrieve_manfile ()

int
retrieve_manfile (const char *fname,
                  const char *localname);

Retrieves the specified manual file in PDF format from sourceforge.

Parameters

fname

name of manual file to retrieve.

 

localname

full path to which the file should be written on the local machine.

 

Returns

0 on success, non-zero on failure.


get_update_info ()

int
get_update_info (char **saver,
                 int verbose);

upload_function_package ()

int
upload_function_package (const char *login,
                         const char *pass,
                         const char *fname,
                         const char *buf,
                         size_t buflen,
                         char **retbuf);

retrieve_public_file ()

int
retrieve_public_file (const char *uri,
                      char *localname);

Retrieves the specified resource and writes it to localname , if possible.

Parameters

uri

complete URI for file to grab: protocol, host and path.

 

localname

full path to which the file should be written on the local machine. This cannot be NULL, but it can be empty, in which case it should be of length MAXLEN, and on successful return it will be filled with an automatically assigned local name, based on the name of the file on the server.

 

Returns

0 on success, non-zero on failure.


retrieve_public_file_as_buffer ()

char *
retrieve_public_file_as_buffer (const char *uri,
                                size_t *len,
                                int *err);

Parameters

uri

complete URI for file to grab: protocol, host and path.

 

len

location to receive length of data retreived (bytes).

 

err

location to receive error code.

 

Returns

allocated buffer containing the specified resource, or NULL on failure.


query_sourceforge ()

int
query_sourceforge (const char *query,
                   char **getbuf);

gretl_curl ()

int
gretl_curl (const char *url,
            const char *header,
            const char *postdata,
            int include,
            char **output,
            char **errmsg);

Somewhat flexible URI "grabber", allowing use of the POST method with header and data to be sent to the host.

Parameters

url

complete URL: protocol, host and path.

 

header

optional HTTP header (or NULL).

 

postdata

string to send as data for POST (or NULL).

 

include

if non-zero, include the received header with the body output.

 

output

location to receive the output.

 

errmsg

location to receive cURL error message, or NULL.

 

Returns

0 on success, non-zero code on error.

Types and Values

enum CGIOpt

Members

LIST_DBS

   

GRAB_IDX

   

GRAB_DATA

   

SHOW_IDX

   

SHOW_DBS

   

GRAB_NBO_DATA

   

GRAB_FILE

   

LIST_FUNCS

   

GRAB_FUNC

   

GRAB_PDF

   

CHECK_DB

   

UPLOAD

   

LIST_PKGS

   

GRAB_PKG

   

GRAB_FOREIGN

   

QUERY_SF

   

GRAB_FUNC_INFO

   

FUNC_FULLNAME

   

LIST_CATS