renamed SubSection to SectionGroup

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3852 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-01-10 12:43:52 +00:00
parent fe03bb3d47
commit f2cba8c2cb
15 changed files with 66 additions and 57 deletions

View file

@ -289,7 +289,7 @@ definedlist.add("NSIS_SUPPORT_LANG_IN_STRINGS");
build_filebuflen=32<<20; // 32mb
subsection_open_cnt=0;
sectiongroup_open_cnt=0;
build_cursection_isfunc=0;
build_cursection=NULL;
// init public data.
@ -1125,7 +1125,7 @@ int CEXEBuild::section_end()
add_entry_direct(EW_RET);
build_cursection->code_size--;
build_cursection=NULL;
if (!subsection_open_cnt)
if (!sectiongroup_open_cnt)
set_uninstall_mode(0);
return PS_OK;
}
@ -1159,11 +1159,11 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
{
if (secname[1])
{
new_section.flags |= SF_SUBSEC;
new_section.flags |= SF_SECGRP;
name++;
}
else
new_section.flags |= SF_SUBSECEND;
new_section.flags |= SF_SECGRPEND;
}
if (name[0] == '!')
@ -1187,16 +1187,16 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
set_uninstall_mode(1);
}
if ((new_section.flags & SF_SUBSECEND) && subsection_open_cnt && old_uninstall_mode)
if ((new_section.flags & SF_SECGRPEND) && sectiongroup_open_cnt && old_uninstall_mode)
{
set_uninstall_mode(1);
}
if (subsection_open_cnt)
if (sectiongroup_open_cnt)
{
if (uninstall_mode != old_uninstall_mode)
{
ERROR_MSG("Error: Can't create %s section in %s subsection (use SubSectionEnd first)\n", uninstall_mode ? "uninstaller" : "installer", old_uninstall_mode ? "uninstaller" : "installer");
ERROR_MSG("Error: Can't create %s section in %s section group (use SectionGroupEnd first)\n", uninstall_mode ? "uninstaller" : "installer", old_uninstall_mode ? "uninstaller" : "installer");
return PS_ERROR;
}
}
@ -1226,28 +1226,28 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
cur_header->blocks[NB_SECTIONS].num++;
if (new_section.flags & (SF_SUBSEC | SF_SUBSECEND))
if (new_section.flags & (SF_SECGRP | SF_SECGRPEND))
{
add_entry_direct(EW_RET);
build_cursection->code_size = 0;
build_cursection = 0;
if (new_section.flags & SF_SUBSECEND)
if (new_section.flags & SF_SECGRPEND)
{
subsection_open_cnt--;
if (subsection_open_cnt < 0)
sectiongroup_open_cnt--;
if (sectiongroup_open_cnt < 0)
{
ERROR_MSG("SubSectionEnd: no SubSections are open\n");
ERROR_MSG("SectionGroupEnd: no SectionGroups are open\n");
return PS_ERROR;
}
if (!subsection_open_cnt)
if (!sectiongroup_open_cnt)
{
set_uninstall_mode(0);
}
}
else
subsection_open_cnt++;
sectiongroup_open_cnt++;
}
return PS_OK;
@ -2223,9 +2223,9 @@ int CEXEBuild::check_write_output_errors() const
return PS_ERROR;
}
if (subsection_open_cnt)
if (sectiongroup_open_cnt)
{
ERROR_MSG("Error: SubSection left open at EOF\n");
ERROR_MSG("Error: SectionGroup left open at EOF\n");
return PS_ERROR;
}

View file

@ -318,7 +318,7 @@ class CEXEBuild {
char version_product_v[1024];
#endif
int subsection_open_cnt;
int sectiongroup_open_cnt;
FastStringList m_warnings;
GrowBuf m_macros;

View file

@ -1190,7 +1190,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
tv.item.state|=(sec->flags&SF_BOLD)<<1;
}
if (sec->flags&SF_SUBSEC)
if (sec->flags&SF_SECGRP)
{
tv.item.mask|=TVIF_CHILDREN;
tv.item.cChildren=1;
@ -1200,7 +1200,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
Par = hTreeItems[x] = TreeView_InsertItem(hwndTree1,&tv);
doLines=1;
}
else if (sec->flags&SF_SUBSECEND)
else if (sec->flags&SF_SECGRPEND)
{
SetParentState(hwndTree1,hTreeItems[lastGoodX]);
Par=TreeView_GetParent(hwndTree1,Par);
@ -1420,7 +1420,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
while (x--)
{
if (*ht && !(t->flags&(SF_SUBSEC|SF_SUBSECEND)))
if (*ht && !(t->flags&(SF_SECGRP|SF_SECGRPEND)))
{
TVITEM tvItem;
tvItem.hItem=*ht;

View file

@ -336,8 +336,8 @@ enum
// used for section->flags
#define SF_SELECTED 1
#define SF_SUBSEC 2
#define SF_SUBSECEND 4
#define SF_SECGRP 2
#define SF_SECGRPEND 4
#define SF_BOLD 8
#define SF_RO 16
#define SF_EXPAND 32

View file

@ -2979,7 +2979,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG("\n");
}
return PS_OK;
case TOK_SECTIONGROUPEND:
case TOK_SUBSECTIONEND:
case TOK_SECTIONGROUP:
case TOK_SUBSECTION:
{
char buf[1024];
@ -2990,7 +2992,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a++;
}
wsprintf(buf,"-%s",line.gettoken_str(a));
if (which_token == TOK_SUBSECTION)
if (which_token == TOK_SECTIONGROUP || which_token == TOK_SUBSECTION)
{
char *s = line.gettoken_str(a);
if (!s[0] || (!strcmpi(s, "un.") && !s[3]))

View file

@ -150,8 +150,10 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_SECTION,"Section",0,3,"[/0] [-][un.][section_name] [section index output]",TP_GLOBAL},
{TOK_SECTIONEND,"SectionEnd",0,0,"",TP_SEC},
{TOK_SECTIONIN,"SectionIn",1,-1,"InstTypeIdx [InstTypeIdx [...]]",TP_SEC},
{TOK_SUBSECTION,"SubSection",1,2,"[/e] [un.]subsection_name [section index output]",TP_GLOBAL},
{TOK_SUBSECTIONEND,"SubSectionEnd",0,0,"",TP_GLOBAL},
{TOK_SUBSECTION,"SubSection",1,2,"deprecated - use SectionGroup",TP_GLOBAL},
{TOK_SECTIONGROUP,"SectionGroup",1,2,"[/e] [un.]section_group_name [section index output]",TP_GLOBAL},
{TOK_SUBSECTIONEND,"SubSectionEnd",0,0,"deprecated - use SectionGroupEnd",TP_GLOBAL},
{TOK_SECTIONGROUPEND,"SectionGroupEnd",0,0,"",TP_GLOBAL},
{TOK_SEARCHPATH,"SearchPath",2,0,"$(user_var: result) filename",TP_CODE},
{TOK_SECTIONSETFLAGS,"SectionSetFlags",2,0,"section_index flags",TP_CODE},
{TOK_SECTIONGETFLAGS,"SectionGetFlags",2,0,"section_index $(user_var: output flags)",TP_CODE},

View file

@ -99,6 +99,8 @@ enum
TOK_SECTION,
TOK_SECTIONEND,
TOK_SECTIONIN,
TOK_SECTIONGROUP,
TOK_SECTIONGROUPEND,
TOK_SUBSECTION,
TOK_SUBSECTIONEND,
TOK_FUNCTION,