1 /* 2 * gretl -- Gnu Regression, Econometrics and Time-series Library 3 * Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 #ifndef GRETL_WIN32_H 21 #define GRETL_WIN32_H 22 23 #ifdef WIN32 24 25 #include <windows.h> 26 27 enum { 28 TO_BACKSLASH, 29 FROM_BACKSLASH 30 }; 31 32 enum { 33 RGUI, 34 RTERM, 35 REXE, 36 RLIB, 37 RBASE 38 }; 39 40 void set_windebug (int s); 41 42 int ensure_locale_encoding (const char **ps1, gchar **ls1, 43 const char **ps2, gchar **ls2); 44 45 int read_reg_val (HKEY tree, const char *base, 46 char *keyname, char *keyval); 47 48 const char *get_gretlnet_filename (void); 49 50 int set_gretlnet_filename (const char *prog); 51 52 void win32_cli_read_rc (void); 53 54 void win_show_last_error (void); 55 56 void win_print_last_error (void); 57 58 int win_run_sync (char *cmdline, const char *currdir); 59 60 int gretl_spawn (char *cmdline); 61 62 int gretl_shell (const char *arg, gretlopt opt, PRN *prn); 63 64 int gretl_win32_grab_output (const char *cmdline, 65 const char *currdir, 66 char **sout); 67 68 int gretl_win32_pipe_output (const char *cmdline, 69 const char *currdir, 70 gretlopt opt, 71 PRN *prn); 72 73 char *slash_convert (char *str, int which); 74 75 char *desktop_path (void); 76 77 char *appdata_path (void); 78 79 char *mydocs_path (void); 80 81 char *program_files_path (void); 82 83 char *program_files_x86_path (void); 84 85 int win32_write_access (const char *path); 86 87 int R_path_from_registry (char *s, int which); 88 89 int win32_check_for_program (const char *prog); 90 91 char *strptime (const char *buf, const char *format, 92 struct tm *timeptr); 93 94 double win32_fscan_nonfinite (FILE *fp, int *err); 95 96 double win32_sscan_nonfinite (const char *s, int *err); 97 98 void win32_pprint_nonfinite (PRN *prn, double x, char c); 99 100 double win32_get_time (void); 101 102 int try_for_CP_65001 (void); 103 104 int windows_is_xp (void); 105 106 int win32_get_core_count (void); 107 108 #endif /* WIN32 */ 109 110 #endif /* GRETL_WIN32_H */ 111