mirror of
https://github.com/reactos/packmgr.git
synced 2024-11-23 03:49:39 +00:00
Delete all Trailing spaces in code.
svn path=/trunk/rosapps/packmgr/; revision=400
This commit is contained in:
parent
efdb4f57e0
commit
b12753b01b
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// main.cpp
|
||||
//
|
||||
//
|
||||
// Implementation of a Commandlne Interface
|
||||
// for the ReactOs Package Manager
|
||||
//
|
||||
@ -14,7 +14,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main (int argc, char **argv)
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
wprintf(L"ReactOs PackageManager %d.%d.%d Commandline Interface \n\n", PACKMGR_VERSION_MAJOR, PACKMGR_VERSION_MINOR, PACKMGR_VERSION_PATCH_LEVEL);
|
||||
Argv = argv; Argc = argc;
|
||||
@ -23,7 +23,7 @@ int main (int argc, char **argv)
|
||||
return Help();
|
||||
|
||||
// install a package
|
||||
if (!strcmp(argv[1], "install"))
|
||||
if (!strcmp(argv[1], "install"))
|
||||
Install();
|
||||
|
||||
// install a package from source
|
||||
@ -67,7 +67,7 @@ int main (int argc, char **argv)
|
||||
|
||||
//
|
||||
wprintf(L"\n");
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -111,7 +111,7 @@ int Ask (const WCHAR* question)
|
||||
|
||||
return Ask(question);
|
||||
}
|
||||
|
||||
|
||||
int SetStatus (int status1, int status2, WCHAR* text)
|
||||
{
|
||||
WCHAR errbuf[2000];
|
||||
@ -142,7 +142,7 @@ int Install (void)
|
||||
wprintf(PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// look up the item
|
||||
for (i=2; i<Argc; i++)
|
||||
{
|
||||
@ -154,7 +154,7 @@ int Install (void)
|
||||
PML_SetAction(tree, id, 1, NULL, Ask);
|
||||
}
|
||||
|
||||
else
|
||||
else
|
||||
printf("Could not find the Package \"%s\"\n", Argv[i]);
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ int Show (void)
|
||||
if(id)
|
||||
printf(PML_GetDescription(tree, id));
|
||||
|
||||
else
|
||||
else
|
||||
printf("Could not find the Package \"%s\"\n", Argv[i]);
|
||||
}
|
||||
|
||||
|
10
gui/de.rc
10
gui/de.rc
@ -14,22 +14,22 @@ IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Performing Operations"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
BEGIN
|
||||
|
||||
CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8
|
||||
|
||||
CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15
|
||||
|
||||
|
||||
CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15
|
||||
|
||||
PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
BEGIN
|
||||
MENUITEM "Keine Action", 1, GRAYED
|
||||
MENUITEM "Keine Action", 1, GRAYED
|
||||
MENUITEM "Intallieren (empfohlen)", 2, GRAYED
|
||||
MENUITEM "Intallieren vom Quellcode", 3, GRAYED
|
||||
MENUITEM "Aktualisieren", 4, GRAYED
|
||||
|
10
gui/en.rc
10
gui/en.rc
@ -14,22 +14,22 @@ IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Performing Operations"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
BEGIN
|
||||
|
||||
CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8
|
||||
|
||||
CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15
|
||||
|
||||
|
||||
CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15
|
||||
|
||||
PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
BEGIN
|
||||
MENUITEM "No Action", 1, GRAYED
|
||||
MENUITEM "No Action", 1, GRAYED
|
||||
MENUITEM "Install (recommended)", 2, GRAYED
|
||||
MENUITEM "Install from Source", 3, GRAYED
|
||||
MENUITEM "Update", 4, GRAYED
|
||||
|
10
gui/es.rc
10
gui/es.rc
@ -14,22 +14,22 @@ IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Realizando las operaciones"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
BEGIN
|
||||
|
||||
CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8
|
||||
|
||||
CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15
|
||||
|
||||
|
||||
CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15
|
||||
|
||||
PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
BEGIN
|
||||
MENUITEM "Ninguna acción", 1, GRAYED
|
||||
MENUITEM "Ninguna acción", 1, GRAYED
|
||||
MENUITEM "Instalar (recomendado)", 2, GRAYED
|
||||
MENUITEM "Instalar desde el código fuente", 3, GRAYED
|
||||
MENUITEM "Actualizar", 4, GRAYED
|
||||
|
10
gui/fr.rc
10
gui/fr.rc
@ -17,22 +17,22 @@ IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Operation en cours"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
BEGIN
|
||||
|
||||
CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8
|
||||
|
||||
CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15
|
||||
|
||||
|
||||
CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15
|
||||
|
||||
PUSHBUTTON "Abort", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
BEGIN
|
||||
MENUITEM "Pas d'action", 1, GRAYED
|
||||
MENUITEM "Pas d'action", 1, GRAYED
|
||||
MENUITEM "Installer (conseillé)", 2, GRAYED
|
||||
|
||||
MENUITEM "Installer depuis les sources", 3, GRAYED
|
||||
|
@ -24,7 +24,7 @@ IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp"
|
||||
|
||||
/* HotKeys */
|
||||
|
||||
IDR_HOTKEYS ACCELERATORS DISCARDABLE
|
||||
IDR_HOTKEYS ACCELERATORS DISCARDABLE
|
||||
BEGIN
|
||||
"1", 2, VIRTKEY, CONTROL
|
||||
"2", 3, VIRTKEY, CONTROL
|
||||
|
86
gui/main.c
86
gui/main.c
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// main.cpp
|
||||
//
|
||||
//
|
||||
// Implementation of the Package Manager GUI
|
||||
//
|
||||
//
|
||||
@ -43,7 +43,7 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||
WCHAR errbuf[2000];
|
||||
|
||||
// Window creation
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
wc.lpszClassName = L"pgkmgr";
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = (WNDPROC)WndProc;
|
||||
@ -56,18 +56,18 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||
hwnd = CreateWindow(L"pgkmgr",
|
||||
L"ReactOS - Package Manager v0.3",
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
500, 600,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
500, 600,
|
||||
NULL, NULL,
|
||||
hinst,
|
||||
hinst,
|
||||
NULL);
|
||||
|
||||
|
||||
// Toolbar creation
|
||||
InitCommonControls();
|
||||
|
||||
hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR,
|
||||
hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR,
|
||||
Buttons, sizeof(Buttons)/sizeof(TBBUTTON), TBSIZE, TBSIZE, TBSIZE, TBSIZE, sizeof(TBBUTTON));
|
||||
|
||||
// Show the windows
|
||||
@ -76,13 +76,13 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||
|
||||
// Load the tree
|
||||
int error = PML_LoadTree(&tree, "tree_bare.xml", AddItem);
|
||||
|
||||
|
||||
if(error)
|
||||
{
|
||||
MessageBox(0,PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Read the help
|
||||
Help();
|
||||
|
||||
@ -95,7 +95,7 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Close our handle
|
||||
PML_CloseTree (tree);
|
||||
|
||||
@ -104,13 +104,13 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||
|
||||
// Add a item to our tree
|
||||
int AddItem (int id, const char* name, int parent, int icon)
|
||||
{
|
||||
TV_INSERTSTRUCT tvins;
|
||||
{
|
||||
TV_INSERTSTRUCT tvins;
|
||||
|
||||
tvins.item.lParam = (UINT)id;
|
||||
tvins.item.mask = TVIF_TEXT|TVIF_PARAM;
|
||||
tvins.item.pszText = (WCHAR*)name; //that is ok
|
||||
tvins.item.cchTextMax = strlen(name);
|
||||
tvins.item.cchTextMax = strlen(name);
|
||||
tvins.hInsertAfter = TVI_LAST;
|
||||
|
||||
if(icon)
|
||||
@ -128,7 +128,7 @@ int AddItem (int id, const char* name, int parent, int icon)
|
||||
nodes[id] = (HTREEITEM)SendMessage(hTree, TVM_INSERTITEMA, 0, (LPARAM)&tvins);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the Help from file and display it
|
||||
void Help (void)
|
||||
@ -158,43 +158,43 @@ void InitControls (HWND hwnd)
|
||||
WCHAR errbuf[2000];
|
||||
|
||||
// Create the controls
|
||||
hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
|
||||
hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
|
||||
0, 0, 0, 0, hwnd, NULL, hinst, NULL);
|
||||
|
||||
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
|
||||
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
|
||||
0, 0, 100, 100, hwnd, NULL, hinst, NULL);
|
||||
|
||||
|
||||
hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP));
|
||||
|
||||
// Create Tree Icons
|
||||
HIMAGELIST hIcon = ImageList_Create(16, 16, ILC_MASK|ILC_COLOR32, 1, 1);
|
||||
SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hIcon);
|
||||
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14)));
|
||||
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14)));
|
||||
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9)));
|
||||
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10)));
|
||||
|
||||
// Setup Hotkeys
|
||||
hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS));
|
||||
}
|
||||
|
||||
// Set the Icons
|
||||
int SetIcon (int id, int icon)
|
||||
int SetIcon (int id, int icon)
|
||||
{
|
||||
TVITEMEX item;
|
||||
|
||||
|
||||
item.hItem = nodes[id];
|
||||
item.iImage = icon;
|
||||
item.iSelectedImage = icon;
|
||||
@ -204,8 +204,8 @@ int SetIcon (int id, int icon)
|
||||
}
|
||||
|
||||
// Set the Icons
|
||||
int Ask (const WCHAR* message)
|
||||
{
|
||||
int Ask (const WCHAR* message)
|
||||
{
|
||||
int ans = MessageBox (0,message,0,MB_YESNO);
|
||||
|
||||
if(ans == IDYES)
|
||||
@ -215,7 +215,7 @@ int Ask (const WCHAR* message)
|
||||
}
|
||||
|
||||
// En- or Disable a Button inside of the toolbar and the Context Menu
|
||||
int SetButton (DWORD id, BOOL state)
|
||||
int SetButton (DWORD id, BOOL state)
|
||||
{
|
||||
// Change the Toorbar Button
|
||||
TBBUTTONINFO ti;
|
||||
@ -248,7 +248,7 @@ int SetButton (DWORD id, BOOL state)
|
||||
}
|
||||
|
||||
// Set the text of the text box
|
||||
int SetText (const char* text)
|
||||
int SetText (const char* text)
|
||||
{
|
||||
int i, j;
|
||||
char buffer [2000];
|
||||
@ -283,7 +283,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_CREATE:
|
||||
{
|
||||
InitControls(hwnd);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// calculate the size of the controls
|
||||
@ -304,15 +304,15 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
// for the treeview
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
if(((LPNMHDR)lParam)->code == TVN_SELCHANGED)
|
||||
if(((LPNMHDR)lParam)->code == TVN_SELCHANGED)
|
||||
{
|
||||
selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam;
|
||||
selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam;
|
||||
PML_LoadPackage (tree, selected, SetButton);
|
||||
SetText(PML_GetDescription (tree, selected));
|
||||
}
|
||||
|
||||
else if ((int)(((LPNMHDR)lParam)->code) == NM_RCLICK) // <= aarrggg LISP
|
||||
{
|
||||
{
|
||||
// which item has been click on
|
||||
HTREEITEM item = TreeView_GetDropHilight(hTree);
|
||||
|
||||
@ -422,7 +422,7 @@ INT_PTR CALLBACK StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
hStatus = hwnd;
|
||||
|
||||
|
||||
} break;
|
||||
|
||||
case WM_COMMAND: // can only be the about button
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <package.h>
|
||||
#include "resource.h"
|
||||
|
||||
/* Some Variables */
|
||||
/* Some Variables */
|
||||
|
||||
int selected, splitter_pos = 50;
|
||||
|
||||
@ -22,7 +22,7 @@ HWND hTBar, hTree, hEdit, hStatus;
|
||||
HTREEITEM nodes [MAXNODES];
|
||||
|
||||
/* Window Callbacks */
|
||||
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK StatusProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK OptionsProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -5,11 +5,11 @@
|
||||
#define TBSIZE 32
|
||||
#define IDB_TOOLBAR 0x102
|
||||
#define IDD_OPTIONS 0x103
|
||||
#define IDD_DOIT 0x104
|
||||
#define IDR_POPUP 0x105
|
||||
#define IDD_DOIT 0x104
|
||||
#define IDR_POPUP 0x105
|
||||
|
||||
#define IDC_STATUS1 0x110
|
||||
#define IDC_STATUS2 0x111
|
||||
#define IDC_CANCEL 0x112
|
||||
#define IDC_TSTATUS 0x113
|
||||
#define IDC_STATUS1 0x110
|
||||
#define IDC_STATUS2 0x111
|
||||
#define IDC_CANCEL 0x112
|
||||
#define IDC_TSTATUS 0x113
|
||||
#define IDR_HOTKEYS 0x114
|
||||
|
10
gui/ru.rc
10
gui/ru.rc
@ -15,22 +15,22 @@ IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Âûïîëíåíèå îïåðàöèé"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
BEGIN
|
||||
|
||||
CTEXT "{Ñîñòîÿíèå}", IDC_TSTATUS, 0, 10, 180, 8
|
||||
|
||||
CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15
|
||||
|
||||
|
||||
CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15
|
||||
|
||||
PUSHBUTTON "Ïðåðâàòü", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
POPUP "PopUp", MENUBARBREAK
|
||||
BEGIN
|
||||
MENUITEM "Íåò äåéñòâèÿ", 1, GRAYED
|
||||
MENUITEM "Íåò äåéñòâèÿ", 1, GRAYED
|
||||
MENUITEM "Óñòàíîâèòü (ðåêîìåíäóåòñÿ)", 2, GRAYED
|
||||
MENUITEM "Óñòàíîâèòü èç èñõîäíûõ êîäîâ", 3, GRAYED
|
||||
MENUITEM "Îáíîâèòü", 4, GRAYED
|
||||
|
@ -2,7 +2,7 @@
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
/* String Tables */
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOAD "Lade ..."
|
||||
ERR_OK "Fertig."
|
||||
@ -10,7 +10,7 @@ BEGIN
|
||||
ERR_GENERIC "Ein Fehler ist aufgetreten. \nnFür mehr Details schauen Sie bitte in ""logfile.html""."
|
||||
ERR_DOWNL "Eine benötigte Datei konnte nicht runtergeladen werden!\nFür mehr Details schauen Sie bitte in ""logfile.html""."
|
||||
ERR_FILE "Bei der Scriptausfürhung trat ein Fehler auf.\nDatei konnte nicht geöffnet werden."
|
||||
|
||||
|
||||
ERR_SYNATX "Bei der Scriptausfürhung trat ein Fehler auf.\nSynatx-Fehler."
|
||||
ERR_CALL "Bei der Scriptausfürhung trat ein Fehler auf.\nUnbekannte Funktion."
|
||||
ERR_PARAMETER "Bei der Scriptausfürhung trat ein Fehler auf.\nUngültige(r) Parameter."
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// download.cpp
|
||||
//
|
||||
//
|
||||
// Stuff related to downloading
|
||||
//
|
||||
//
|
||||
@ -15,7 +15,7 @@
|
||||
#include "log.h"
|
||||
#include <urlmon.h>
|
||||
|
||||
HRESULT WINAPI URLDownloadToFileA(
|
||||
HRESULT WINAPI URLDownloadToFileA(
|
||||
LPUNKNOWN pCaller,
|
||||
LPCSTR szURL,
|
||||
LPCSTR szFileName,
|
||||
@ -26,8 +26,8 @@ HRESULT WINAPI URLDownloadToFileA(
|
||||
int FindCount (string What, string Where, int start = 0, int end = -1);
|
||||
|
||||
|
||||
// Download a file
|
||||
char* PML_Download (pTree tree, const char* url, const char* server = "tree", const char* filename = "packmgr.xml")
|
||||
// Download a file
|
||||
char* PML_Download (pTree tree, const char* url, const char* server = "tree", const char* filename = "packmgr.xml")
|
||||
{
|
||||
UINT i;
|
||||
static char downl [MAX_PATH]; // the full url
|
||||
@ -47,7 +47,7 @@ char* PML_Download (pTree tree, const char* url, const char* server = "tree", co
|
||||
else
|
||||
strcpy(path, "");
|
||||
|
||||
|
||||
|
||||
// create the local file name
|
||||
if(filename)
|
||||
{
|
||||
@ -55,13 +55,13 @@ char* PML_Download (pTree tree, const char* url, const char* server = "tree", co
|
||||
DeleteFileA (path);
|
||||
}
|
||||
else
|
||||
GetTempFileNameA (path, "pml", 1, path);
|
||||
GetTempFileNameA (path, "pml", 1, path);
|
||||
|
||||
// get the url
|
||||
if (!server)
|
||||
strcpy(downl, "");
|
||||
|
||||
else if(!strcmp(server, "tree"))
|
||||
else if(!strcmp(server, "tree"))
|
||||
{
|
||||
char* ret;
|
||||
for (i=0; i<tree->sources.size(); i++)
|
||||
@ -73,7 +73,7 @@ char* PML_Download (pTree tree, const char* url, const char* server = "tree", co
|
||||
return NULL;
|
||||
}
|
||||
|
||||
else
|
||||
else
|
||||
strcpy(downl, server);
|
||||
|
||||
strcat(downl, url);
|
||||
@ -108,7 +108,7 @@ char* PML_Download (pTree tree, const char* url, const char* server = "tree", co
|
||||
|
||||
// Download and prozess a xml file
|
||||
int PML_XmlDownload (pTree tree, const char* url, void* usrdata,
|
||||
XML_StartElementHandler start, XML_EndElementHandler end, XML_CharacterDataHandler text)
|
||||
XML_StartElementHandler start, XML_EndElementHandler end, XML_CharacterDataHandler text)
|
||||
{
|
||||
int done = 0;
|
||||
char buffer[255];
|
||||
@ -126,7 +126,7 @@ int PML_XmlDownload (pTree tree, const char* url, void* usrdata,
|
||||
filename = PML_Download(tree, url);
|
||||
|
||||
|
||||
if(!filename)
|
||||
if(!filename)
|
||||
{
|
||||
Log("! ERROR: Could not download the xml file");
|
||||
return ERR_DOWNL;
|
||||
@ -134,7 +134,7 @@ int PML_XmlDownload (pTree tree, const char* url, void* usrdata,
|
||||
|
||||
// open the file
|
||||
FILE* file = fopen(filename, "r");
|
||||
if(!file)
|
||||
if(!file)
|
||||
{
|
||||
Log("! ERROR: Could not open the xml file ");
|
||||
LogAdd(filename);
|
||||
@ -153,7 +153,7 @@ int PML_XmlDownload (pTree tree, const char* url, void* usrdata,
|
||||
done = len < sizeof(buffer);
|
||||
|
||||
buffer[len] = 0;
|
||||
if(!XML_Parse(parser, buffer, len, done))
|
||||
if(!XML_Parse(parser, buffer, len, done))
|
||||
{
|
||||
Log("! ERROR: Could not parse the xml file");
|
||||
return ERR_GENERIC;
|
||||
|
@ -2,7 +2,7 @@
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
/* String Tables */
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOAD "Loading ..."
|
||||
ERR_OK "Operation done."
|
||||
@ -10,7 +10,7 @@ BEGIN
|
||||
ERR_GENERIC "An error occured. \nFor more information please have a look at the log file."
|
||||
ERR_DOWNL "A needed file could not be downloaded!\nFor more information please have a look at the log file."
|
||||
ERR_FILE "Error while Script Execution.\nFile could not be opened."
|
||||
|
||||
|
||||
ERR_SYNATX "Error while Script Execution.\nWrong Synatx."
|
||||
ERR_CALL "Error while Script Execution.\nCould not find function."
|
||||
ERR_PARAMETER "Error while Script Execution.\nWrong Parameter(s)."
|
||||
|
@ -1,7 +1,7 @@
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
/* String Tables */
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOAD "Cargando ..."
|
||||
ERR_OK "Operación completada."
|
||||
@ -9,7 +9,7 @@ BEGIN
|
||||
ERR_GENERIC "Ocurrió un error. \nPor favor, mira el archivo de log para más detalles."
|
||||
ERR_DOWNL "¡Un archivo necesario no pudo ser descargado!\nPor favor, mira el archivo de log para más detalles."
|
||||
ERR_FILE "Error durante la ejecución del Script.\nEl archivo no pudo abrirse."
|
||||
|
||||
|
||||
ERR_SYNATX "Error durante la ejecución del Script.\nSintaxis errónea."
|
||||
ERR_CALL "Error durante la ejecución del Script.\nNo se pudo encontrar la función."
|
||||
ERR_PARAMETER "Error durante la ejecución del Script.\nParametro(s) erróneo."
|
||||
|
16
lib/expat.h
16
lib/expat.h
@ -834,20 +834,20 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
|
||||
(resumable = 0) an already suspended parser. Some call-backs may
|
||||
still follow because they would otherwise get lost. Examples:
|
||||
- endElementHandler() for empty elements when stopped in
|
||||
startElementHandler(),
|
||||
- endNameSpaceDeclHandler() when stopped in endElementHandler(),
|
||||
startElementHandler(),
|
||||
- endNameSpaceDeclHandler() when stopped in endElementHandler(),
|
||||
and possibly others.
|
||||
|
||||
Can be called from most handlers, including DTD related call-backs,
|
||||
except when parsing an external parameter entity and resumable != 0.
|
||||
Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
|
||||
Possible error codes:
|
||||
Possible error codes:
|
||||
- XML_ERROR_SUSPENDED: when suspending an already suspended parser.
|
||||
- XML_ERROR_FINISHED: when the parser has already finished.
|
||||
- XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
|
||||
|
||||
When resumable != 0 (true) then parsing is suspended, that is,
|
||||
XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
|
||||
When resumable != 0 (true) then parsing is suspended, that is,
|
||||
XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
|
||||
Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
|
||||
return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
|
||||
|
||||
@ -858,7 +858,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
|
||||
the externalEntityRefHandler() to call XML_StopParser() on the parent
|
||||
parser (recursively), if one wants to stop parsing altogether.
|
||||
|
||||
When suspended, parsing can be resumed by calling XML_ResumeParser().
|
||||
When suspended, parsing can be resumed by calling XML_ResumeParser().
|
||||
*/
|
||||
XMLPARSEAPI(enum XML_Status)
|
||||
XML_StopParser(XML_Parser parser, XML_Bool resumable);
|
||||
@ -866,7 +866,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable);
|
||||
/* Resumes parsing after it has been suspended with XML_StopParser().
|
||||
Must not be called from within a handler call-back. Returns same
|
||||
status codes as XML_Parse() or XML_ParseBuffer().
|
||||
Additional error code XML_ERROR_NOT_SUSPENDED possible.
|
||||
Additional error code XML_ERROR_NOT_SUSPENDED possible.
|
||||
|
||||
*Note*:
|
||||
This must be called on the most deeply nested child parser instance
|
||||
@ -967,7 +967,7 @@ XML_GetErrorCode(XML_Parser parser);
|
||||
be within the relevant markup. When called outside of the callback
|
||||
functions, the position indicated will be just past the last parse
|
||||
event (regardless of whether there was an associated callback).
|
||||
|
||||
|
||||
They may also be called after returning from a call to XML_Parse
|
||||
or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then
|
||||
the location is the location of the character at which the error
|
||||
|
@ -5,7 +5,7 @@
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
/* String Tables */
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOAD "Chargement ..."
|
||||
ERR_OK "Fini."
|
||||
@ -13,7 +13,7 @@ BEGIN
|
||||
ERR_GENERIC "Une erreur s'est produite. \nVeuillez consulter le fichier journal pour les détails."
|
||||
ERR_DOWNL "Un fichier requis ne peut etre téléchargé !\nVeuillez consulter le fichier journal pour les détails."
|
||||
ERR_FILE "Erreur pendant l'éxécution du script.\nUn fichier n'a pu etre ouvert."
|
||||
|
||||
|
||||
ERR_SYNATX "Erreur pendant l'éxécution du script.\nErreur de syntaxe."
|
||||
ERR_CALL "Erreur pendant l'éxécution du script.\nUne fonction ne peut etre trouvée."
|
||||
ERR_PARAMETER "Erreur pendant l'éxécution du script.\nParamètre(s) erroné(s)."
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// functions.cpp
|
||||
//
|
||||
//
|
||||
// Script Functions
|
||||
//
|
||||
//
|
||||
@ -36,7 +36,7 @@ int download (int argc, char* argv[])
|
||||
else if (argc==2)
|
||||
result = PML_Download(NULL, argv[1], NULL, argv[2]);
|
||||
|
||||
else
|
||||
else
|
||||
return ERR_GENERIC;
|
||||
|
||||
if(!result)
|
||||
@ -59,7 +59,7 @@ int msgbox (int argc, char* argv[])
|
||||
else if (argc==2)
|
||||
MessageBoxA(0,argv[1],argv[2],0);
|
||||
|
||||
else
|
||||
else
|
||||
return ERR_GENERIC;
|
||||
|
||||
return ERR_OK;
|
||||
@ -75,7 +75,7 @@ int shell (int argc, char* argv[])
|
||||
info.cbSize = sizeof(SHELLEXECUTEINFO);
|
||||
info.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
info.lpVerb = "open";
|
||||
info.lpFile = argv[1];
|
||||
info.lpFile = argv[1];
|
||||
info.lpDirectory = tmp;
|
||||
info.nShow = SW_SHOW;
|
||||
|
||||
@ -92,7 +92,7 @@ int shell (int argc, char* argv[])
|
||||
|
||||
const FUNC_TABLE FuncTable[] =
|
||||
{
|
||||
/* Name */ /* Function */
|
||||
/* Name */ /* Function */
|
||||
{"download", download},
|
||||
{"extract", extract},
|
||||
{"shell", shell},
|
||||
|
22
lib/log.cpp
22
lib/log.cpp
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// log.cpp
|
||||
//
|
||||
//
|
||||
// Script Functions
|
||||
//
|
||||
//
|
||||
@ -28,14 +28,14 @@ void Log (const char *message)
|
||||
char version[50];
|
||||
char versionos[50];
|
||||
|
||||
if (!LogCreated)
|
||||
{
|
||||
if (!LogCreated)
|
||||
{
|
||||
file = fopen(LOGFILE, "w");
|
||||
LogCreated = true;
|
||||
|
||||
//HTML Header
|
||||
fputs("<html><head><title>Logfile</title></head><body>\n", file);
|
||||
|
||||
|
||||
// date and time
|
||||
time_t now;
|
||||
now = time(NULL);
|
||||
@ -57,23 +57,23 @@ void Log (const char *message)
|
||||
fputs("<h2>ReactOS Package Manager - Log File</h2>\n", file);
|
||||
//fputs("WARNING: This is still pre-alpha software.<br>\n", file);
|
||||
|
||||
fputs("Date: ", file);
|
||||
fputs("Date: ", file);
|
||||
fputs(GTime, file);
|
||||
fputs("<br>\n", file);
|
||||
|
||||
fputs("Version: ", file);
|
||||
fputs(version, file);
|
||||
fputs(version, file);
|
||||
fputs("<br>\n", file);
|
||||
|
||||
fputs("OS: ", file);
|
||||
fputs(versionos, file);
|
||||
fputs(versionos, file);
|
||||
fputs("<br>\n", file);
|
||||
}
|
||||
|
||||
else
|
||||
else
|
||||
file = fopen(LOGFILE, "a");
|
||||
|
||||
if (file == NULL)
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
if (LogCreated)
|
||||
LogCreated = false;
|
||||
@ -107,7 +107,7 @@ void LogAdd (const char *message)
|
||||
FILE *file;
|
||||
|
||||
file = fopen(LOGFILE, "a");
|
||||
|
||||
|
||||
// Save log entry
|
||||
fputs(message, file);
|
||||
fclose(file);
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// log.h
|
||||
//
|
||||
//
|
||||
// Script Functions
|
||||
//
|
||||
//
|
||||
|
26
lib/main.cpp
26
lib/main.cpp
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// main.cpp
|
||||
//
|
||||
//
|
||||
// Doit stuff and
|
||||
// everything that fits nowhere else.
|
||||
//
|
||||
@ -32,17 +32,17 @@ extern "C" void PML_Abort (void)
|
||||
}
|
||||
|
||||
// Callback function of the "doit"-thread
|
||||
DWORD WINAPI DoitThread (void* lpParam)
|
||||
{
|
||||
DWORD WINAPI DoitThread (void* lpParam)
|
||||
{
|
||||
UINT i;
|
||||
int ret = ERR_OK;
|
||||
TREE* tree = (TREE*)lpParam;
|
||||
vector<SCRIPT*> scripts;
|
||||
|
||||
|
||||
/* Load the scripts */
|
||||
|
||||
tree->setStatus(0, 0, L"Downloading Install instructions ...");
|
||||
|
||||
|
||||
for(i=0; i<tree->todo.size(); i++)
|
||||
{
|
||||
SCRIPT* script;
|
||||
@ -60,7 +60,7 @@ DWORD WINAPI DoitThread (void* lpParam)
|
||||
Log("* enter preinstall");
|
||||
|
||||
tree->setStatus(250, 0, L"Preinstall");
|
||||
|
||||
|
||||
for(i=0; i<scripts.size(); i++)
|
||||
{
|
||||
if(RPS_Execute(scripts[i], "preinstall") != ERR_OK)
|
||||
@ -105,13 +105,13 @@ DWORD WINAPI DoitThread (void* lpParam)
|
||||
|
||||
tree->setStatus(1000, ret, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Do the actions the user wants us to do
|
||||
extern "C" int PML_DoIt (TREE* tree, PML_SetStatus SetStatus, PML_Ask Ask)
|
||||
{
|
||||
DWORD dummy;
|
||||
{
|
||||
DWORD dummy;
|
||||
tree->setStatus = SetStatus;
|
||||
|
||||
if(!tree->todo.size())
|
||||
@ -125,15 +125,15 @@ extern "C" int PML_DoIt (TREE* tree, PML_SetStatus SetStatus, PML_Ask Ask)
|
||||
|
||||
if(!Ask(buffer))
|
||||
return ERR_GENERIC;
|
||||
|
||||
|
||||
|
||||
hThread = CreateThread(NULL, 0, DoitThread, tree, 0, &dummy);
|
||||
|
||||
if(!hThread)
|
||||
return ERR_GENERIC;
|
||||
|
||||
|
||||
LogAdd("\n");
|
||||
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// options.cpp
|
||||
//
|
||||
// Settting and Loading Options
|
||||
//
|
||||
// Settting and Loading Options
|
||||
//
|
||||
//
|
||||
// Maarten Bosma, 09.01.2004
|
||||
@ -69,7 +69,7 @@ int CreateOptions (TREE* tree)
|
||||
Log("! ERROR: Could not load it !");
|
||||
return ERR_GENERIC;
|
||||
}
|
||||
|
||||
|
||||
MessageBox(0,(WCHAR*)LockResource(LoadResource(NULL, hres)), 0, 0); // is empty
|
||||
//file << (WCHAR*)LockResource(LoadResource(NULL, hres));
|
||||
|
||||
@ -84,7 +84,7 @@ int CreateOptions (TREE* tree)
|
||||
Log("* Load options.xml from the Internet (Temporary Hack)");
|
||||
|
||||
CopyFileA( PML_Download(tree, "http://svn.reactos.org/svn/*checkout*/reactos/trunk/rosapps/packmgr/lib/options.xml", NULL, "options.xml"), "options.xml", TRUE);
|
||||
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// package.cpp
|
||||
//
|
||||
//
|
||||
// package related functions
|
||||
//
|
||||
//
|
||||
@ -14,7 +14,7 @@
|
||||
#include "expat.h"
|
||||
#include "log.h"
|
||||
|
||||
int PML_XmlDownload (pTree, const char* url, void* usrdata, XML_StartElementHandler start,
|
||||
int PML_XmlDownload (pTree, const char* url, void* usrdata, XML_StartElementHandler start,
|
||||
XML_EndElementHandler end, XML_CharacterDataHandler text=0);
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ void pack_start (void* usrdata, const char* tag, const char** arg)
|
||||
if(!strcmp(tag, "scripts"))
|
||||
{
|
||||
// ... read the arguments
|
||||
for (i=0; arg[i]; i+=2)
|
||||
for (i=0; arg[i]; i+=2)
|
||||
{
|
||||
if(!strcmp(arg[i], "inst"))
|
||||
id = 0;
|
||||
@ -98,9 +98,9 @@ extern "C" int PML_LoadPackage (TREE* tree, int id, PML_SetButton SetButton)
|
||||
{
|
||||
SetButton(1, pack->action);
|
||||
SetButton(2, pack->inst); // && pack->action != 0
|
||||
SetButton(3, pack->src_inst);
|
||||
SetButton(3, pack->src_inst);
|
||||
SetButton(4, pack->update);
|
||||
SetButton(5, pack->uninstall);
|
||||
SetButton(5, pack->uninstall);
|
||||
}
|
||||
|
||||
// root notes (like network) return here
|
||||
@ -155,11 +155,11 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
|
||||
for (i=0; i<pack->children.size(); i++)
|
||||
ret = ret || PML_SetAction(tree, pack->children[i], action, SetIcon, Ask);
|
||||
|
||||
// is the action possible ?
|
||||
// is the action possible ?
|
||||
if(!pack->actions[action])
|
||||
return ERR_GENERIC;
|
||||
|
||||
// is it already set
|
||||
// is it already set
|
||||
if(pack->action == action)
|
||||
return ERR_OK;
|
||||
|
||||
@ -244,14 +244,14 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
|
||||
|
||||
// root notes (like network) return here
|
||||
if(!pack->path)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
// save the name of the corresponding script in a vector
|
||||
tree->todo.push_back(pack->files[action-1]);
|
||||
}
|
||||
|
||||
// undoing
|
||||
else
|
||||
else
|
||||
{
|
||||
for(i=0; i<pack->neededBy.size(); i++)
|
||||
{
|
||||
@ -264,7 +264,7 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
|
||||
|
||||
// root notes (like network) return here
|
||||
if(!pack->path || pack->action==0)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
// erase from todo list
|
||||
for(i=0; i<tree->todo.size(); i++)
|
||||
|
@ -40,7 +40,7 @@ int PML_DoIt (pTree, PML_SetStatus, PML_Ask);
|
||||
void PML_CloseTree (pTree);
|
||||
|
||||
|
||||
/* Version */
|
||||
/* Version */
|
||||
|
||||
#define PACKMGR_VERSION_MAJOR 0
|
||||
#define PACKMGR_VERSION_MINOR 3
|
||||
|
@ -3,7 +3,7 @@
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
/* String Tables */
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOAD "Загрузка ..."
|
||||
ERR_OK "Операция завершена."
|
||||
@ -11,7 +11,7 @@ BEGIN
|
||||
ERR_GENERIC "Произошла ошибка. \nПожалуйста просмотрите в журнале подробности."
|
||||
ERR_DOWNL "Невозможно загрузить необходимый файл!\nПожалуйста просмотрите в журнале подробности."
|
||||
ERR_FILE "Ошибка во время выполнения сценария.\nНе удалось открыть файл."
|
||||
|
||||
|
||||
ERR_SYNATX "Ошибка во время выполнения сценария.\nНеверный синтаксис."
|
||||
ERR_CALL "Ошибка во время выполнения сценария.\nНе удалось найти функцию."
|
||||
ERR_PARAMETER "Ошибка во время выполнения сценария.\nНеверный параметр(ы)."
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// script.cpp
|
||||
//
|
||||
//
|
||||
// Implementaion of a basic basic :) interpreter
|
||||
//
|
||||
//
|
||||
@ -29,9 +29,9 @@ int RPS_Load (SCRIPT** script, const char* path)
|
||||
{
|
||||
string source;
|
||||
|
||||
/* We have to do it that way (doublepointer) because MinGw
|
||||
/* We have to do it that way (doublepointer) because MinGw
|
||||
calls "delete" at the end of function otherwise. */
|
||||
(*script) = new SCRIPT;
|
||||
(*script) = new SCRIPT;
|
||||
|
||||
// Load file to string
|
||||
ifstream file(path, ios_base::in);
|
||||
@ -41,11 +41,11 @@ int RPS_Load (SCRIPT** script, const char* path)
|
||||
getline(file, source, '\0');
|
||||
|
||||
// make sure last char is a new line
|
||||
source += "\n";
|
||||
|
||||
source += "\n";
|
||||
|
||||
// Are all subs and strings closed ?
|
||||
// FIXME: Just a quick hack sould be both checked line by line
|
||||
if(FindCount(source, "\"")%2) // if count is uneven not all strings are closed
|
||||
if(FindCount(source, "\"")%2) // if count is uneven not all strings are closed
|
||||
return ERR_SYNATX;
|
||||
|
||||
if(FindCount(source, "Sub ") != FindCount(source, "End Sub\n"))
|
||||
@ -103,7 +103,7 @@ int RPS_Load (SCRIPT** script, const char* path)
|
||||
for (i=0; i < (*script)->code.size(); i++) // code.size() is the cout of lines
|
||||
{
|
||||
SUB sub;
|
||||
|
||||
|
||||
if((*script)->code[i].substr(0,4) != "sub ")
|
||||
return ERR_SYNATX; // script has to start with sub
|
||||
|
||||
@ -115,7 +115,7 @@ int RPS_Load (SCRIPT** script, const char* path)
|
||||
i++;
|
||||
//if script does not end with "end sub" we got a problem
|
||||
if (i>(*script)->code.size())
|
||||
return ERR_SYNATX;
|
||||
return ERR_SYNATX;
|
||||
}
|
||||
|
||||
sub.end = i;
|
||||
@ -145,13 +145,13 @@ int RPS_Execute (SCRIPT* script, const char* function)
|
||||
// call the function
|
||||
for (a=script->subs[nr].start; a<script->subs[nr].end; a++)
|
||||
{
|
||||
// create a temporarry buffer
|
||||
// create a temporarry buffer
|
||||
buffer = new char[script->code[a].size()];
|
||||
strcpy(buffer, script->code[a].c_str());
|
||||
|
||||
// make the fist argument the function's name
|
||||
argv[0] = &buffer[0];
|
||||
|
||||
|
||||
int buffer_size = (int)strlen(buffer);
|
||||
for (b=0; b<buffer_size+1; b++)
|
||||
{
|
||||
@ -173,7 +173,7 @@ int RPS_Execute (SCRIPT* script, const char* function)
|
||||
buffer[b] = '\0';
|
||||
|
||||
// we don't want buffer overflows
|
||||
if(argc == 99)
|
||||
if(argc == 99)
|
||||
return ERR_GENERIC;
|
||||
|
||||
}
|
||||
@ -187,7 +187,7 @@ int RPS_Execute (SCRIPT* script, const char* function)
|
||||
Log("* excute command: ");
|
||||
for(c=0; c<argc+1; c++)
|
||||
{
|
||||
LogAdd(argv[c]);
|
||||
LogAdd(argv[c]);
|
||||
LogAdd(" ");
|
||||
}
|
||||
|
||||
@ -228,12 +228,12 @@ void RPS_Clear (SCRIPT* script)
|
||||
int FindCount (string where, string what, int start, int end)
|
||||
{
|
||||
int counter = 0, pos;
|
||||
|
||||
|
||||
while(true)
|
||||
{
|
||||
pos = (int)where.find (what, start);
|
||||
//could could not be found or is outside of search area
|
||||
if (pos == (int)string::npos || (end!=-1 && pos>end))
|
||||
//could could not be found or is outside of search area
|
||||
if (pos == (int)string::npos || (end!=-1 && pos>end))
|
||||
break;
|
||||
start = pos+1;
|
||||
counter++;
|
||||
@ -247,14 +247,14 @@ int Find (string where, string what, int start, int end, int instring)
|
||||
{
|
||||
int pos = (int)where.find (what, start);
|
||||
|
||||
//could could not be found or is outside of search area
|
||||
if (pos == (int)string::npos || (end!=-1 && pos>end))
|
||||
//could could not be found or is outside of search area
|
||||
if (pos == (int)string::npos || (end!=-1 && pos>end))
|
||||
return -1;
|
||||
|
||||
// if the count of this quotes is eaven we are in string
|
||||
// if the count of this quotes is eaven we are in string
|
||||
int isInString = FindCount(where, "\"", start, pos)%2;
|
||||
|
||||
// if so we go on searching
|
||||
// if so we go on searching
|
||||
if(isInString == instring)
|
||||
return Find (where, what, pos+1, end, instring);
|
||||
|
||||
|
@ -48,7 +48,7 @@ typedef struct
|
||||
FUNC_PROC function;
|
||||
} FUNC_TABLE;
|
||||
|
||||
// very function is listed in there
|
||||
// very function is listed in there
|
||||
extern const FUNC_TABLE FuncTable[];
|
||||
|
||||
// count of functions
|
||||
@ -61,5 +61,5 @@ extern const FUNC_TABLE FuncTable[];
|
||||
#define STR_ONLY 0x0;
|
||||
#define STR_YES 0x2;
|
||||
|
||||
// ^^ I would write down here that they
|
||||
// ^^ I would write down here that they
|
||||
// mean but I don't know anymore myself :O
|
||||
|
@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// tree.cpp
|
||||
//
|
||||
//
|
||||
// Loading of the package tree
|
||||
//
|
||||
//
|
||||
@ -20,7 +20,7 @@ int LoadOptions (TREE* tree);
|
||||
void tree_end (void* tree, const char* tag);
|
||||
void tree_start (void* usrdata, const char* tag, const char** arg);
|
||||
|
||||
int PML_XmlDownload (pTree tree, const char* file, void* usrdata, XML_StartElementHandler start,
|
||||
int PML_XmlDownload (pTree tree, const char* file, void* usrdata, XML_StartElementHandler start,
|
||||
XML_EndElementHandler end, XML_CharacterDataHandler text=0);
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ extern "C" int PML_LoadTree (TREE** tree, char* url, PML_AddItem AddItem)
|
||||
|
||||
// set every to zero
|
||||
memset((*tree), 0, sizeof((*tree)));
|
||||
|
||||
|
||||
// set addItem callback
|
||||
(*tree)->addItem = AddItem;
|
||||
|
||||
@ -64,7 +64,7 @@ void tree_start (void* usrdata, const char* tag, const char** arg)
|
||||
tree->packages[id].name = "\0";
|
||||
|
||||
// read the arguments
|
||||
for (i=0; arg[i]; i+=2)
|
||||
for (i=0; arg[i]; i+=2)
|
||||
{
|
||||
if(!strcmp(arg[i], "name"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user