1 /* ide-environment.h
2  *
3  * Copyright 2016-2019 Christian Hergert <christian@hergert.me>
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  * SPDX-License-Identifier: GPL-3.0-or-later
19  */
20 
21 #pragma once
22 
23 #if !defined (IDE_THREADING_INSIDE) && !defined (IDE_THREADING_COMPILATION)
24 # error "Only <libide-threading.h> can be included directly."
25 #endif
26 
27 #include <gio/gio.h>
28 #include <libide-core.h>
29 
30 #include "ide-environment-variable.h"
31 
32 G_BEGIN_DECLS
33 
34 #define IDE_TYPE_ENVIRONMENT (ide_environment_get_type())
35 
36 IDE_AVAILABLE_IN_3_32
37 G_DECLARE_FINAL_TYPE (IdeEnvironment, ide_environment, IDE, ENVIRONMENT, GObject)
38 
39 IDE_AVAILABLE_IN_3_32
40 gboolean         ide_environ_parse           (const gchar             *pair,
41                                               gchar                  **key,
42                                               gchar                  **value);
43 IDE_AVAILABLE_IN_3_32
44 IdeEnvironment  *ide_environment_new         (void);
45 IDE_AVAILABLE_IN_3_32
46 void             ide_environment_setenv      (IdeEnvironment          *self,
47                                               const gchar             *key,
48                                               const gchar             *value);
49 IDE_AVAILABLE_IN_3_32
50 const gchar     *ide_environment_getenv      (IdeEnvironment          *self,
51                                               const gchar             *key);
52 IDE_AVAILABLE_IN_3_32
53 gchar          **ide_environment_get_environ (IdeEnvironment          *self);
54 IDE_AVAILABLE_IN_3_32
55 void             ide_environment_append      (IdeEnvironment          *self,
56                                               IdeEnvironmentVariable  *variable);
57 IDE_AVAILABLE_IN_3_32
58 void             ide_environment_remove      (IdeEnvironment          *self,
59                                               IdeEnvironmentVariable  *variable);
60 IDE_AVAILABLE_IN_3_32
61 IdeEnvironment  *ide_environment_copy        (IdeEnvironment          *self);
62 IDE_AVAILABLE_IN_3_32
63 void             ide_environment_copy_into   (IdeEnvironment          *self,
64                                               IdeEnvironment          *dest,
65                                               gboolean                 replace);
66 IDE_AVAILABLE_IN_3_34
67 void             ide_environment_set_environ (IdeEnvironment          *self,
68                                               const gchar * const     *env);
69 
70 G_END_DECLS
71