From 55e204f6f09e2d7edd193123913cbea559df3298 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 9 Nov 2001 14:12:00 +0000 Subject: [PATCH] 2001-11-10 Robert Collins * ini.h (actions): Remove - transferred to choose.h. (views): Ditto. * choose.h: Protect class's from "C" compilers. (actions): New enum, from ini.h. This may not be the 'right' place but that place doesn't exist yet. (_views): New enum, from ini.h. * choose.cc (set_action): Handle installed packages with a version not in setup.ini. (choose_caption): Ditto. * iniparse.y: Rearrange header order to handle new ini.h. --- ChangeLog | 35 +++++++++++++++++++++++++++++++++++ choose.cc | 6 ++++++ choose.h | 38 +++++++++++++++++++++++++++++++++++++- ini.h | 48 ++++++++++++------------------------------------ iniparse.y | 2 +- 5 files changed, 91 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb818781..8e1dadda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2001-11-10 Robert Collins + + * ini.h (actions): Remove - transferred to choose.h. + (views): Ditto. + * choose.h: Protect class's from "C" compilers. + (actions): New enum, from ini.h. This may not be the 'right' place + but that place doesn't exist yet. + (_views): New enum, from ini.h. + * choose.cc (set_action): Handle installed packages with a version not in + setup.ini. + (choose_caption): Ditto. + * iniparse.y: Rearrange header order to handle new ini.h. + +2001-11-10 Robert Collins + + * ini.h (_Info): Fix compiler warnings (signed vs unsigned comparison). + (registry_category): Fix compiler warning (deprecated conversion). + * iniparse.y (registry_category): Ditto. + * choose.cc (cvsid): Fix compiler warnings (unused, deprecated conversion). + (add_requried): Remove unused variable. + (choose_caption): Handle all enumeration values via a default. + (paint): Fix compiler warnings (unused, deprecated conversion). + (scroll_common): Fix compiler warnings (unused, signed vs unsigned comparison). + (list_clicK): Fix compiler warnings (signed vs unsigned comparison). + (note_width): Fix compiler warnings (deprecated conversion). + (keep_or_skip): Fix compiler warnings (unused). + (_view::mode_caption): Fix compiler warnings (deprecated conversion). + (set_view_mode): Fix compiler warnings (unused). + (create_listview): Fix compiler warnings (unused, incorrect format, reaches + end of function). + (dialog_proc): Fix compiler warnings (unused). + (read_installed_db): Fix compiler warnings (unused, deprecated conversion). + * choose.h (_header): Fix compiler warnings (deprecated conversion). + (_view): Ditto. + 2001-11-08 Pavel Tsekov * simpsock.h (SimpleSocket::invalidate): Declare new method. diff --git a/choose.cc b/choose.cc index d6ebf7d6..9d67d397 100644 --- a/choose.cc +++ b/choose.cc @@ -147,6 +147,11 @@ set_action (Package * pkg, bool preinc) break; /* ACTION_SAME_* are used when the installed version is the same as the given action. */ + case ACTION_SAME: + if (pkg->installed && !pkg->installed_ix) + /* the package is installed, but we don't have + * that version it in our version list */ + return; case ACTION_SAME_CURR: case ACTION_SAME_TEST: if (!preinc) /* Previously set to this value */ @@ -269,6 +274,7 @@ choose_caption (Package * pkg) case ACTION_TEST: pkg->trust = (trusts) pkg->action; return pkg->info[pkg->trust].version; + case ACTION_SAME: case ACTION_SAME_PREV: case ACTION_SAME_CURR: case ACTION_SAME_TEST: diff --git a/choose.h b/choose.h index 06f1f1ae..9fb82176 100644 --- a/choose.h +++ b/choose.h @@ -21,6 +21,40 @@ #define CATEGORY_EXPANDED 0 #define CATEGORY_COLLAPSED 1 +typedef enum +{ + /* Note that the next four items must be in the same order as the + TRUST items in ini.h. */ + ACTION_UNKNOWN, + ACTION_PREV, + ACTION_CURR, + ACTION_TEST, + ACTION_SKIP, + ACTION_UNINSTALL, + ACTION_REDO, + ACTION_SRC_ONLY, + ACTION_LAST, + ACTION_ERROR, + /* Use ACTION_SAME when you want to leve the current version unaltered + * even if it that version is not in setup.ini + */ + ACTION_SAME = 100, + /* Actions taken when installed version matches the selected version. */ + ACTION_SAME_PREV = ACTION_PREV + ACTION_SAME, + ACTION_SAME_CURR = ACTION_CURR + ACTION_SAME, + ACTION_SAME_TEST = ACTION_TEST + ACTION_SAME, + /* Last action. */ + ACTION_SAME_LAST +} actions; + +typedef enum +{ + VIEW_UNKNOWN, + VIEW_PACKAGE_FULL, + VIEW_PACKAGE, + VIEW_CATEGORY, + NVIEW +} views; struct _header { @@ -30,6 +64,8 @@ struct _header int x; }; +#ifdef __cplusplus + typedef class _view view; class pick_line @@ -76,5 +112,5 @@ class _view void insert_under (int linen, pick_line line); }; - +#endif /* __cplusplus */ #endif /* _CHOOSE_H_ */ diff --git a/ini.h b/ini.h index 79494018..74d04f33 100644 --- a/ini.h +++ b/ini.h @@ -23,6 +23,14 @@ packages (the chosen "install" field). install.cc installs selected packages. */ +/* the classes here store installation info *shrug* */ +/* forward typedefs */ + +typedef struct _Category Category; +typedef struct _Package Package; + +#include "choose.h" + #define YYSTYPE char * /* lowest number must be most trusted, highest least trusted */ @@ -35,29 +43,6 @@ typedef enum NTRUST } trusts; -typedef enum -{ - /* Note that the next four items must be in the same order as the - TRUST items above. */ - ACTION_UNKNOWN, - ACTION_PREV, - ACTION_CURR, - ACTION_TEST, - ACTION_SKIP, - ACTION_UNINSTALL, - ACTION_REDO, - ACTION_SRC_ONLY, - ACTION_LAST, - ACTION_ERROR, - ACTION_SAME = 100, - /* Actions taken when installed version matches the selected version. */ - ACTION_SAME_PREV = ACTION_PREV + ACTION_SAME, - ACTION_SAME_CURR = ACTION_CURR + ACTION_SAME, - ACTION_SAME_TEST = ACTION_TEST + ACTION_SAME, - /* Last action. */ - ACTION_SAME_LAST -} actions; - typedef enum { EXCLUDE_NONE = 0, @@ -65,15 +50,6 @@ typedef enum EXCLUDE_NOT_FOUND } excludes; -typedef enum -{ - VIEW_UNKNOWN, - VIEW_PACKAGE_FULL, - VIEW_PACKAGE, - VIEW_CATEGORY, - NVIEW -} views; - #define is_download_action(pkg) \ ((pkg)->action == ACTION_PREV || \ (pkg)->action == ACTION_CURR || \ @@ -121,12 +97,12 @@ typedef struct _CategoryPackage char *pkgname; /* This should be Package *, but the packages can move*/ } CategoryPackage; -typedef struct _Category +struct _Category { struct _Category *next; /* the next category in the list */ char *name; /* the category */ CategoryPackage *packages; /* the packages in this category */ -} Category; +}; typedef struct _Dependency { @@ -134,7 +110,7 @@ typedef struct _Dependency char *package; /* the name of the package that is depended on */ } Dependency; /* Dependencies can be used for recommended/required/related... */ -typedef struct +struct _Package { char *name; /* package name, like "cygwin" */ char *sdesc; /* short description (replaces "name" if provided) */ @@ -156,7 +132,7 @@ typedef struct to infoscan */ Info infoscan[NTRUST - 1]; /* +1 for TRUST_UNKNOWN */ Info infoend[0]; /* end marker */ -} Package; +}; extern Package *package; extern int npackages; diff --git a/iniparse.y b/iniparse.y index b6499b13..2a4e9bae 100644 --- a/iniparse.y +++ b/iniparse.y @@ -20,9 +20,9 @@ #include #include +#include "win32.h" #include "ini.h" #include "iniparse.h" -#include "win32.h" #include "filemanip.h" extern "C" int yyerror (char *s, ...); -- 2.43.5