gretl_foreign

gretl_foreign

Functions

Types and Values

Description

Functions

foreign_start ()

int
foreign_start (int ci,
               const char *param,
               gretlopt opt,
               PRN *prn);

Starts a new "foreign" block if no such block is currently defined.

Parameters

ci

either FOREIGN or MPI.

 

param

string specifying language, for FOREIGN.

 

opt

may include OPT_V for verbose operation.

 

prn

struct for printing output.

 

Returns

0 on success, non-zero on error.


foreign_append ()

int
foreign_append (const char *line,
                int context);

Appends line to an internally stored block of "foreign" or MPI commands, if such a block is currently defined.

Parameters

line

line to append.

 

context

either FOREIGN or MPI.

 

Returns

0 on success, non-zero on error.


foreign_execute ()

int
foreign_execute (const DATASET *dset,
                 gretlopt opt,
                 PRN *prn);

Executes a block of commands previously established via calls to foreign_append_line().

Parameters

dset

dataset struct.

 

opt

may include OPT_V for verbose operation

 

prn

struct for printing output.

 

Returns

0 on success, non-zero on error.


foreign_destroy ()

void
foreign_destroy (void);

execute_R_buffer ()

int
execute_R_buffer (const char *buf,
                  const DATASET *dset,
                  gretlopt opt,
                  PRN *prn);

This is used only for MS Windows, working around breakage in previously coded non-interactive calls to R executable(s).

Parameters

buf

buffer containing commands.

 

dset

dataset struct.

 

opt

may include OPT_D to send data from gretl.

 

prn

struct for printing output.

 

Returns

0 on success, non-zero on error.


write_gretl_R_files ()

int
write_gretl_R_files (const char *buf,
                     const DATASET *dset,
                     gretlopt opt);

delete_gretl_R_files ()

void
delete_gretl_R_files (void);

write_gretl_ox_file ()

int
write_gretl_ox_file (const char *buf,
                     gretlopt opt,
                     const char **pfname);

Writes the content of buf into a file in the gretl user's "dotdir".

Parameters

buf

text buffer containing Ox code.

 

opt

should contain OPT_G for use from GUI.

 

pfname

location to receive name of file written, or NULL.

 

Returns

0 on success, non-zero on error.


write_gretl_python_file ()

int
write_gretl_python_file (const char *buf,
                         gretlopt opt,
                         const char **pfname);

Writes the content of buf into a file in the gretl user's "dotdir".

Parameters

buf

text buffer containing Python code.

 

opt

should contain OPT_G for use from GUI.

 

pfname

location to receive name of file written, or NULL.

 

Returns

0 on success, non-zero on error.


write_gretl_julia_file ()

int
write_gretl_julia_file (const char *buf,
                        gretlopt opt,
                        const char **pfname);

Writes the content of buf into a file in the gretl user's "dotdir".

Parameters

buf

text buffer containing Julia code.

 

opt

should contain OPT_G for use from GUI.

 

pfname

location to receive name of file written, or NULL.

 

Returns

0 on success, non-zero on error.


write_gretl_octave_file ()

int
write_gretl_octave_file (const char *buf,
                         gretlopt opt,
                         const DATASET *dset,
                         const char **pfname);

write_gretl_stata_file ()

int
write_gretl_stata_file (const char *buf,
                        gretlopt opt,
                        const DATASET *dset,
                        const char **pfname);

gretl_max_mpi_processes ()

int
gretl_max_mpi_processes (void);

set_mpi_variant ()

void
set_mpi_variant (const char *pref);

check_for_mpiexec ()

int
check_for_mpiexec (void);

get_R_function_by_name ()

int
get_R_function_by_name (const char *name);

gretl_R_get_call ()

int
gretl_R_get_call (const char *name,
                  int argc);

gretl_R_function_add_scalar ()

int
gretl_R_function_add_scalar (double x);

gretl_R_function_add_vector ()

int
gretl_R_function_add_vector (const double *x,
                             int t1,
                             int t2);

gretl_R_function_add_matrix ()

int
gretl_R_function_add_matrix (const gretl_matrix *m);

gretl_R_function_exec ()

int
gretl_R_function_exec (const char *name,
                       int *rtype,
                       void **ret);

gretl_R_reset_error ()

void
gretl_R_reset_error (void);

gretl_R_cleanup ()

void
gretl_R_cleanup (void);

Types and Values

enum ForeignLang

Members

LANG_R

   

LANG_OX

   

LANG_OCTAVE

   

LANG_STATA

   

LANG_PYTHON

   

LANG_JULIA

   

LANG_MPI