5 char *name; /* unique name */
6 char *package; /* package name */
8 /* Script can be loaded from a file, or from some data in memory */
9 char *path; /* FILE: full path for file */
10 char *data; /* DATA: data used for the script */
13 extern GSList *perl_scripts;
15 /* Initialize perl interpreter */
16 void perl_scripts_init(void);
17 /* Destroy all perl scripts and deinitialize perl interpreter */
18 void perl_scripts_deinit(void);
20 /* Load a perl script, path must be a full path. */
21 PERL_SCRIPT_REC *perl_script_load_file(const char *path);
22 /* Load a perl script from given data */
23 PERL_SCRIPT_REC *perl_script_load_data(const char *data);
24 /* Unload perl script */
25 void perl_script_unload(PERL_SCRIPT_REC *script);
27 /* Find loaded script by name */
28 PERL_SCRIPT_REC *perl_script_find(const char *name);
29 /* Find loaded script by package */
30 PERL_SCRIPT_REC *perl_script_find_package(const char *package);
32 /* Returns full path for the script */
33 char *perl_script_get_path(const char *name);
34 /* Modify the script name so that all non-alphanumeric characters are
36 void script_fix_name(char *name);
38 /* If core should handle printing script errors */
39 void perl_core_print_script_error(int print);
41 /* Returns the perl module's API version. */
42 int perl_get_api_version(void);
44 /* Checks that the API version is correct. */
45 #define perl_api_version_check(library) \
46 if (perl_get_api_version() != IRSSI_PERL_API_VERSION) { \
47 die("Version of perl module (%d) doesn't match the " \
48 "version of "library" library (%d)", \
49 perl_get_api_version(), IRSSI_PERL_API_VERSION); \
53 void perl_core_init(void);
54 void perl_core_deinit(void);