Back to index

lightning-sunbird  0.9+nobinonly
extra.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Sean Su <ssu@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef _EXTRA_H_
00041 #define _EXTRA_H_
00042 
00043 BOOL              InitApplication();
00044 BOOL              InitInstance();
00045 void              PrintError(PSZ szMsg, ULONG ulErrorCodeSH);
00046 void              FreeMemory(void **vPointer);
00047 void              *NS_GlobalReAlloc(void **hgMemory,
00048                                     DWORD dwMemoryBufSize,
00049                                     DWORD dwNewSize);
00050 void              *NS_GlobalAlloc(DWORD dwMaxBuf);
00051 HRESULT           Initialize(HMODULE hInstance, PSZ szAppName);
00052 HRESULT           NS_LoadStringAlloc(HMODULE hInstance, ULONG ulID, PSZ *szStringBuf, ULONG ulStringBuf);
00053 HRESULT           NS_LoadString(HMODULE hInstance, ULONG ulID, PSZ szStringBuf, ULONG ulStringBuf);
00054 HRESULT           WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, BOOL bWait);
00055 HRESULT           ParseConfigIni(int argc, char *argv[]);
00056 HRESULT           ParseInstallIni();
00057 HRESULT           DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
00058 HRESULT           DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
00059 HRESULT           InitSetupGeneral(void);
00060 HRESULT           InitDlgWelcome(diW *diDialog);
00061 HRESULT           InitDlgLicense(diL *diDialog);
00062 HRESULT           InitDlgQuickLaunch(diQL *diDialog);
00063 HRESULT           InitDlgSetupType(diST *diDialog);
00064 HRESULT           InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
00065 HRESULT           InitDlgOS2Integration(diOI *diDialog);
00066 HRESULT           InitDlgProgramFolder(diPF *diDialog);
00067 HRESULT           InitDlgStartInstall(diSI *diDialog);
00068 HRESULT           InitDlgSiteSelector(diAS *diDialog);
00069 HRESULT           InitSDObject(void);
00070 void              DeInitSDObject(void);
00071 siC               *CreateSiCNode(void);
00072 void              SiCNodeInsert(siC **siCHead, siC *siCTemp);
00073 void              SiCNodeDelete(siC *siCTemp);
00074 siCD              *CreateSiCDepNode(void);
00075 void              SiCDepNodeDelete(siCD *siCDepTemp);
00076 void              SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
00077 HRESULT           SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00078 void              SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible, DWORD dwACFlag, HWND hwndListBox);
00079 void              SiCNodeSetItemsSelected(DWORD dwSetupType);
00080 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00081 char              *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00082 char              *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00083 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00084 siC               *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs, DWORD dwACFlag);
00085 unsigned long long         SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00086 unsigned long long         SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00087 unsigned long long         SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00088 siC               *SiCNodeFind(siC *siComponents, char *szInReferenceName);
00089 void              InitSiComponents(char *szFileIni);
00090 HRESULT           ParseComponentAttributes(char *szBuf, DWORD dwAttributes, BOOL bOverride);
00091 void              InitSiteSelector(char *szFileIni);
00092 void              DeInitSiCDependencies(siCD *siCDDependencies);
00093 BOOL              ResolveDependencies(DWORD dwIndex, HWND hwndListBox);
00094 BOOL              ResolveComponentDependency(siCD *siCDInDependency, HWND hwndListBox);
00095 void              ResolveDependees(LPSTR szToggledDescriptionShort, HWND hwndListBox);
00096 BOOL              ResolveComponentDependee(siCD *siCDInDependee);
00097 void              STSetVisibility(st *stSetupType);
00098 HRESULT           InitSXpcomFile(void);
00099 void              DeInitSXpcomFile(void);
00100 void              DeInitialize(void);
00101 void              DeInitDlgWelcome(diW *diDialog);
00102 void              DeInitDlgLicense(diL *diDialog);
00103 void              DeInitDlgQuickLaunch(diQL *diDialog);
00104 void              DeInitDlgSetupType(diST *diDialog);
00105 void              DeInitDlgSelectComponents(diSC *diDialog);
00106 void              DeInitDlgOS2Integration(diOI *diDialog);
00107 void              DeInitDlgProgramFolder(diPF *diDialog);
00108 void              DeInitDlgStartInstall(diSI *diDialog);
00109 void              DeInitDlgSiteSelector(diAS *diDialog);
00110 void              DetermineOSVersionEx(void);
00111 void              DeInitSiComponents(siC **siComponents);
00112 void              DeInitSetupGeneral(void);
00113 HRESULT           ParseSetupIni(void);
00114 HRESULT           GetConfigIni(void);
00115 HRESULT           GetInstallIni(void);
00116 void              CleanTempFiles(void);
00117 void              OutputSetupTitle(HDC hDC);
00118 long              RetrieveArchives(void);
00119 long              RetrieveRedirectFile(void);
00120 void              ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, BOOL bUseSlash, DWORD dwType);
00121 void              RemoveBackSlash(PSZ szInput);
00122 void              AppendBackSlash(PSZ szInput, ULONG ulInputSize);
00123 void              RemoveSlash(LPSTR szInput);
00124 void              AppendSlash(LPSTR szInput, DWORD dwInputSize);
00125 BOOL              DeleteIdiGetConfigIni(void);
00126 BOOL              DeleteIdiGetArchives(void);
00127 BOOL              DeleteIdiGetRedirect(void);
00128 BOOL              DeleteIdiFileIniConfig(void);
00129 BOOL              DeleteIdiFileIniInstall(void);
00130 void              DeleteArchives(DWORD dwDeleteCheck);
00131 BOOL              DeleteIniRedirect(void);
00132 HRESULT           LaunchApps(void);
00133 HRESULT           ProcessOS2Integration(void);
00134 HRESULT           FileExists(PSZ szFile);
00135 BOOL              isFAT(char* szPath);
00136 int               ExtractDirEntries(char* directory,void* vZip);
00137 int               LocateJar(siC *siCObject, LPSTR szPath, int dwPathSize, BOOL bIncludeTempDir);
00138 HRESULT           AddArchiveToIdiFile(siC *siCObject,
00139                                       char *szSFile,
00140                                       char *szFileIdiGetArchives);
00141 int               SiCNodeGetIndexDS(char *szInDescriptionShort);
00142 int               SiCNodeGetIndexRN(char *szInReferenceName);
00143 void              ViewSiComponentsDependency(char *szBuffer, char *szIndentation, siC *siCNode);
00144 void              ViewSiComponentsDependee(char *szBuffer, char *szIndentation, siC *siCNode);
00145 void              ViewSiComponents(void);
00146 unsigned long long         GetDiskSpaceRequired(DWORD dwType);
00147 unsigned long long         GetDiskSpaceAvailable(LPSTR szPath);
00148 HRESULT           VerifyDiskSpace(void);
00149 HRESULT           ErrorMsgDiskSpace(unsigned long long ullDSAvailable, unsigned long long ullDSRequired, LPSTR szPath, BOOL bCrutialMsg);
00150 void              SetCustomType(void);
00151 void              GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
00152 BOOL              NeedReboot(void);
00153 BOOL              LocatePreviousPath(LPSTR szMainSectionName, LPSTR szPath, DWORD dwPathSize);
00154 BOOL              LocatePathOS2INI(PSZ szSection, PSZ szPath, ULONG ulPathSize);
00155 dsN               *CreateDSNode();
00156 void              DsNodeInsert(dsN **dsNHead, dsN *dsNTemp);
00157 void              DsNodeDelete(dsN **dsNTemp);
00158 void              DeInitDSNode(dsN **dsnComponentDSRequirement);
00159 void              UpdatePathDiskSpaceRequired(LPSTR szPath, unsigned long long ullInstallSize, dsN **dsnComponentDSRequirement);
00160 HRESULT           InitComponentDiskSpaceInfo(dsN **dsnComponentDSRequirement);
00161 HRESULT           CheckInstances();
00162 long              RandomSelect(void);
00163 BOOL              CheckLegacy(HWND hDlg);
00164 COLORREF          DecryptFontColor(LPSTR szColor);
00165 ssi               *CreateSsiSiteSelectorNode();
00166 void              SsiSiteSelectorNodeInsert(ssi **ssiHead, ssi *ssiTemp);
00167 void              SsiSiteSelectorNodeDelete(ssi *ssiTemp);
00168 ssi*              SsiGetNode(LPSTR szDescription);
00169 void              UpdateSiteSelector(void);
00170 DWORD             GetAdditionalComponentsCount(void);
00171 DWORD             GetTotalArchivesToDownload();
00172 void              RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
00173 LPSTR             GetFirstNonSpace(LPSTR lpszString);
00174 int               GetArgC(LPSTR lpszCommandLine);
00175 LPSTR             GetArgV(LPSTR lpszCommandLine,
00176                           int iIndex,
00177                           LPSTR lpszDest,
00178                           int iDestSize);
00179 ULONG             ParseCommandLine(int argc, char *argv[]);
00180 void              SetSetupRunMode(LPSTR szMode);
00181 void              UnsetSetupState(void);
00182 void              SetSetupState(char *szState);
00183 siCD              *InitWinInitNodes(char *szInFile);
00184 void              UpdateWininit(LPSTR szUninstallFilename);
00185 char              *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
00186 void              SaveInstallerFiles(void);
00187 void              ResetComponentAttributes(char *szFileIni);
00188 BOOL              IsInList(DWORD dwCurrentItem,
00189                            DWORD dwItems,
00190                            DWORD *dwItemsSelected);
00191 int               LocateExistingPath(char *szPath,
00192                                      char *szExistingPath,
00193                                      DWORD dwExistingPathSize);
00194 BOOL              DeleteInstallLogFile(char *szFile);
00195 int               CRCCheckDownloadedArchives(char *szCorruptedArchiveList,
00196                                              DWORD dwCorruptedArchivelistSize,
00197                                              char *szFileIdiGetArchives);
00198 int               CRCCheckArchivesStartup(char *szCorruptedArchiveList,
00199                                           DWORD dwCorruptedArchiveListSize,
00200                                           BOOL bIncludeTempPath);
00201 BOOL              ResolveForceUpgrade(siC *siCObject);
00202 BOOL              ResolveSupersede(siC *siCObject);
00203 void              RestoreInvisibleFlag(siC *siCNode);
00204 void              RestoreAdditionalFlag(siC *siCNode);
00205 void              SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize);
00206 int               AppendToGlobalMessageStream(char *szInfo);
00207 char              *GetOSTypeString(char *szOSType, ULONG ulOSTypeBufSize);
00208 int               UpdateIdiFile(char  *szPartialUrl,
00209                                 DWORD dwPartialUrlBufSize,
00210                                 siC   *siCObject,
00211                                 char  *szSection,
00212                                 char  *szKey,
00213                                 char  *szFileIdiGetArchives);
00214 void              SetDownloadFile(void);
00215 void              UnsetSetupCurrentDownloadFile(void);
00216 void              SetSetupCurrentDownloadFile(char *szCurrentFilename);
00217 char              *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
00218                                        DWORD dwCurrentDownloadFileBufSize);
00219 BOOL              DeleteWGetLog(void);
00220 DWORD             ParseOSType(char *szOSType);
00221 BOOL              ShowAdditionalOptionsDialog(void);
00222 DWORD             GetPreviousUnfinishedState(void);
00223 
00224 HWND              FindWindow(PCSZ pszAtomString);
00225 
00226 #endif /* _EXTRA_H_ */
00227