aboutsummaryrefslogtreecommitdiff
path: root/include/omc.h
blob: 9d6cee4d46441026053b1d265908e8342cc4e742 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef OMC_OMC_H
#define OMC_OMC_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <unistd.h>

#define SYSERROR stderr, "%s:%s:%d: %s\n", path_basename(__FILE__), __FUNCTION__, __LINE__, strerror(errno)
#define OMC_BUFSIZ 8192
#define OMC_NAME_MAX 255
#define OMC_DIRSTACK_MAX 1024

#include "utils.h"
#include "ini.h"
#include "conda.h"
#include "environment.h"
#include "deliverable.h"
#include "str.h"
#include "strlist.h"
#include "system.h"
#include "download.h"
#include "recipe.h"
#include "relocation.h"

#define guard_runtime_free(X) if (X) { runtime_free(X); X = NULL; }
#define guard_strlist_free(X) if (X) { strlist_free(X); X = NULL; }
#define guard_free(X) if (X) { free(X); X = NULL; }

#define COE_CHECK_ABORT(COND, MSG) {\
    if (COND) { \
        msg(OMC_MSG_ERROR, MSG ": Aborting execution (--continue-on-error/-C is not enabled)\n"); \
        exit(1); \
    } \
}

struct OMC_GLOBAL {
    unsigned char verbose;
    unsigned char always_update_base_environment;
    unsigned char continue_on_error;
    struct StrList *conda_packages;
    struct StrList *pip_packages;
    char *tmpdir;
};

#endif //OMC_OMC_H