From 0e7a2596af288e1fddf74f83ebea57eecd7d4533 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 2 Jul 2005 13:15:28 +0000 Subject: [PATCH] extracted some functions from main() git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4156 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/makenssi.cpp | 195 +++++++++++++++++++++++++------------------- 1 file changed, 111 insertions(+), 84 deletions(-) diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp index 48296144..f23509f9 100644 --- a/Source/makenssi.cpp +++ b/Source/makenssi.cpp @@ -77,6 +77,83 @@ static void sigint(int sig) quit(); } +static void print_logo() +{ + fprintf(g_output,"MakeNSIS %s - Copyright 1999-2005 Nullsoft, Inc.\n" + "\n" + "Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler (zlib).\n" + "Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).\n" + "Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).\n" + "\n" + "Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.\n\n",CONST_STR(NSIS_VERSION)); + fflush(g_output); +} + +static void print_license() +{ + fprintf(g_output,"Copyright (C) 1999-2005 Nullsoft, Inc.\n\n" + "This license applies to everything in the NSIS package, except where otherwise\nnoted.\n\n" + "This software is provided 'as-is', without any express or implied warranty.\n" + "In no event will the authors be held liable for any damages arising from the\n" + "use of this software.\n\n" + "Permission is granted to anyone to use this software for any purpose, including\n" + "commercial applications, and to alter it and redistribute it freely, subject to\n" + "the following restrictions:\n" + " 1. The origin of this software must not be misrepresented; you must not claim\n" + " that you wrote the original software. If you use this software in a\n" + " product, an acknowledgment in the product documentation would be\n" + " appreciated but is not required.\n" + " 2. Altered source versions must be plainly marked as such, and must not be\n" + " misrepresented as being the original software.\n" + " 3. This notice may not be removed or altered from any source distribution.\n\n"); + fflush(g_output); +} + +static void print_usage() +{ + fprintf(g_output,"Usage:\n" + " makensis [option | script.nsi | - [...]]\n" + " options are:\n" + " " OPT_STR "CMDHELP item prints out help for 'item', or lists all commands\n" + " " OPT_STR "HDRINFO prints information about what options makensis was compiled with\n" + " " OPT_STR "LICENSE prints the makensis software license\n" + " " OPT_STR "VERSION prints the makensis version and exits\n" + " " OPT_STR "Vx verbosity where x is 4=all,3=no script,2=no info,1=no warnings,0=none\n" + " " OPT_STR "Ofile specifies a text file to log compiler output (default is stdout)\n" + " " OPT_STR "PAUSE pauses after execution\n" + " " OPT_STR "NOCONFIG disables inclusion of " PLATFORM_PATH_SEPARATOR_STR "nsisconf.nsh\n" + " " OPT_STR "NOCD disabled the current directory change to that of the .nsi file\n" + " " OPT_STR "Ddefine[=value] defines the symbol \"define\" for the script [to value]\n" + " " OPT_STR "Xscriptcmd executes scriptcmd in script (i.e. \"" OPT_STR "XOutFile poop.exe\")\n" + " parameters are processed by order (" OPT_STR "Ddef ins.nsi != ins.nsi " OPT_STR "Ddef)\n" + " for script file name, you can use - to read from the standard input\n"); + fflush(g_output); +} + +static void print_stub_info(CEXEBuild& build) +{ + if (build.display_info) + { + fprintf(g_output,"Size of first header is %d bytes.\n",sizeof(firstheader)); + fprintf(g_output,"Size of main header is %d bytes.\n",sizeof(header)); + fprintf(g_output,"Size of each section is %d bytes.\n",sizeof(section)); + fprintf(g_output,"Size of each page is %d bytes.\n",sizeof(page)); + fprintf(g_output,"Size of each instruction is %d bytes.\n",sizeof(entry)); + int x=build.definedlist.getnum(); + fprintf(g_output,"\nDefined symbols: "); + for (int i=0; i" PLATFORM_PATH_SEPARATOR_STR "nsisconf.nsh\n" - " " OPT_STR "NOCD disabled the current directory change to that of the .nsi file\n" - " " OPT_STR "Ddefine[=value] defines the symbol \"define\" for the script [to value]\n" - " " OPT_STR "Xscriptcmd executes scriptcmd in script (i.e. \"" OPT_STR "XOutFile poop.exe\")\n" - " parameters are processed by order (" OPT_STR "Ddef ins.nsi != ins.nsi " OPT_STR "Ddef)\n" - " for script file name, you can use - to read from the standard input\n"); - fflush(g_output); + print_usage(); } return 1; }