GNU PROLOG with UTF8 support
machine1.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog engine + Compiler *
5  * File : machine1.h *
6  * Descr.: machine dependent features - Header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 #include <stdio.h>
40 
41 /*---------------------------------*
42  * Constants *
43  *---------------------------------*/
44 
45 #define M_OS_UNIX 0
46 #define M_OS_WINDOWS 1
47 #define M_OS_WINDOWS_NT 2
48 
49 
50 #define M_ERROR_WIN32 -2 /* read GetLastError instead of errno */
51 
52 
53 
54 /*---------------------------------*
55  * Type Definitions *
56  *---------------------------------*/
57 
58 /*---------------------------------*
59  * Global Variables *
60  *---------------------------------*/
61 
62 #ifdef MACHINE1_FILE
63 
64 int pl_m_os_type;
65 char pl_m_architecture[32];
66 char pl_m_os_version[256];
67 
68 #else
69 
70 extern int pl_m_os_type;
71 extern char pl_m_architecture[];
72 extern char pl_m_os_version[];
73 
74 #endif
75 
76 
77 
78 
79 /*---------------------------------*
80  * Function Prototypes *
81  *---------------------------------*/
82 
83 void Pl_Init_Machine1(void);
84 
85 char **Pl_M_Create_Shell_Command(char *cmd);
86 
87 char **Pl_M_Cmd_Line_To_Argv(char *cmd, int *argc);
88 
89 int Pl_M_Shell(char *cmd);
90 
91 int Pl_M_Spawn(char *arg[]);
92 
93 int Pl_M_Spawn_Redirect(char *arg[], int detach,
94  FILE **f_in, FILE **f_out, FILE **f_err);
95 
96 int Pl_M_Get_Status(int pid);
97 
98 
99 
100 char *Pl_M_Mktemp(char *tmp_template);
101 
102 char *Pl_M_Tempnam(char *dir, char *pfx);
103 
104 
105 #define DBGPRINTF printf
char ** Pl_M_Create_Shell_Command(char *cmd)
Definition: machine1.c:531
char * Pl_M_Tempnam(char *dir, char *pfx)
Definition: machine1.c:1048
char ** dir
Definition: cpp_headers.c:81
char pl_m_architecture[]
int Pl_M_Spawn_Redirect(char *arg[], int detach, FILE **f_in, FILE **f_out, FILE **f_err)
Definition: machine1.c:707
ArgInf arg[MAX_ARGS]
Definition: ma_parser.c:114
void Pl_Init_Machine1(void)
Definition: machine1.c:121
int pl_m_os_type
int Pl_M_Get_Status(int pid)
Definition: machine1.c:904
int Pl_M_Shell(char *cmd)
Definition: machine1.c:626
char * Pl_M_Mktemp(char *tmp_template)
Definition: machine1.c:969
int Pl_M_Spawn(char *arg[])
Definition: machine1.c:644
char ** Pl_M_Cmd_Line_To_Argv(char *cmd, int *argc)
Definition: machine1.c:568
char pl_m_os_version[]