OSDN Git Service

Note relocation of m4 when packaging source distribution.
[mingw/mingw-get.git] / src / pkgtask.h
1 #ifndef PKGTASK_H
2 /*
3  * pkgtask.h
4  *
5  * $Id$
6  *
7  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8  * Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
9  *
10  *
11  * This header provides manifest definitions for the action codes,
12  * which are used by the installer engine's task scheduler.
13  *
14  *
15  * This is free software.  Permission is granted to copy, modify and
16  * redistribute this software, under the provisions of the GNU General
17  * Public License, Version 3, (or, at your option, any later version),
18  * as published by the Free Software Foundation; see the file COPYING
19  * for licensing details.
20  *
21  * Note, in particular, that this software is provided "as is", in the
22  * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23  * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24  * PARTICULAR PURPOSE.  Under no circumstances will the author, or the
25  * MinGW Project, accept liability for any damages, however caused,
26  * arising from the use of this software.
27  *
28  */
29 #define PKGTASK_H  1
30
31 enum
32 {
33   action_none = 0,
34
35   action_remove,
36   action_install,
37   action_upgrade,
38
39   action_list,
40   action_show,
41
42   action_update,
43   action_licence,
44   action_source,
45
46   end_of_actions
47 };
48
49 #define ACTION_MASK             0x0F
50
51 #define ACTION_NONE             (unsigned long)(action_none)
52 #define ACTION_REMOVE           (unsigned long)(action_remove)
53 #define ACTION_INSTALL          (unsigned long)(action_install)
54 #define ACTION_UPGRADE          (unsigned long)(action_upgrade)
55 #define ACTION_LIST             (unsigned long)(action_list)
56 #define ACTION_SHOW             (unsigned long)(action_show)
57 #define ACTION_UPDATE           (unsigned long)(action_update)
58 #define ACTION_LICENCE          (unsigned long)(action_licence)
59 #define ACTION_SOURCE           (unsigned long)(action_source)
60
61 #define STRICTLY_GT             (ACTION_MASK + 1)
62 #define STRICTLY_LT             (STRICTLY_GT << 1)
63
64 #define ACTION_PRIMARY          (STRICTLY_LT << 1)
65
66 /* Attributes used to identify when a removal action
67  * may break dependencies for other installed packages.
68  */
69 #define ACTION_REMOVE_OK        (ACTION_PRIMARY << 1)
70 #define ACTION_PREFLIGHT        (ACTION_PRIMARY << 2 | ACTION_REMOVE_OK)
71
72 /* Attributes used to identify when a package installation
73  * or upgrade cannot be successfully installed or upgraded,
74  * due to a previously failing download.
75  */
76 #define ACTION_DOWNLOAD         (ACTION_PRIMARY << 3)
77 #define ACTION_DOWNLOAD_OK      (ACTION_DOWNLOAD | ACTION_REMOVE_OK)
78
79 /* Flag set by pkgActionItem::SelectIfMostRecentFit(),
80  * to indicate viability of the last package evaluated,
81  * irrespective of whether it is selected, or not.
82  */
83 #define ACTION_MAY_SELECT       (ACTION_PRIMARY << 4)
84
85 #ifndef EXTERN_C
86 /* A convenience macro, to facilitate declaration of functions
87  * which must exhibit extern "C" bindings, in a manner which is
88  * compatible with inclusion in either C or C++ source.
89  */
90 # ifdef __cplusplus
91 #  define EXTERN_C extern "C"
92 # else
93 #  define EXTERN_C
94 # endif
95 #endif
96
97 EXTERN_C const char *action_name( unsigned long );
98 EXTERN_C int action_code( const char* );
99
100 #endif /* PKGTASK_H: $RCSfile$: end of file */