-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
123 lines (109 loc) · 2.73 KB
/
structs.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* Copyright (C) Johnny Saenz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. */
#ifndef TRISTAN_STRUCTS
#define TRISTAN_STRUCTS
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
/**
* @struct tags
* All tags and its respective length.
*/
struct tags
{
/** Name of a tag */
char name[40];
/** Length of a tag */
int size;
};
/**
* @struct taginfo
* Struct that save content of a tag, and the respective line number.
*/
struct taginfo
{
/** Content of a tag */
std::string content;
/** Line number of the tag */
int nline;
};
/**
* @struct candidates_struct
* Struct that save the packages to upgrade, revupgrade, and new for install.
*/
struct candidates_struct
{
/** Vector who contents new packages for install */
std::vector<std::string> candidates_new;
/** Vector who contents packages for upgrade */
std::vector<std::string> candidates_upgrade;
/** Vector who contents packages for revupgrade */
std::vector<std::string> candidates_revupgrade;
};
/**
* @struct __node
* Node of a linked list.
*/
struct __node
{
/** Next node */
struct __node *next;
/** Contains the actual line, while read the {AV|LOCAL}_CONF_FILE */
std::string *line;
/** Line number */
int nline;
};
/**
* Creates a type name for __node.
* @typedef _node
*/
typedef __node _node;
/**
* @struct _Programa
* Struct that contain information use in handle_dependencies member.
*/
typedef struct _Programa
{
/** Name of the package */
std::string name;
/** Operator for the package */
std::string op;
/** Version of the package */
std::string ver;
/** Line number of the tag */
int nline;
} Programa;
/**
* @struct meta
* Struct that contain a vector who store information of a package,
* that information will be treated concluding in the meta_final struct.
*/
struct meta
{
/** Vector who contains package information
* will be treated concluding in the meta_final struct. */
std::map<std::pair<std::string, std::string>, int> data;
};
/**
* @struct meta_final
* Struct that contain information final of a package, after reviewing conflicts.
*/
struct meta_final
{
/** Name of the package. */
std::string package;
/** Operator of the package. */
std::string operate;
/** Version of the package. */
std::string version;
};
#endif