Commit 0d2d994e authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

regedit: Remove cruft and make functions static, reordering where necessary to…

regedit: Remove cruft and make functions static, reordering where necessary to avoid forward declarations. Remove the command parameter of processRegLines() as it can only be used with processRegEntry().
parent de2fc93b
...@@ -154,7 +154,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, ...@@ -154,7 +154,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
index = ListView_InsertItem(hwndLV, &item); index = ListView_InsertItem(hwndLV, &item);
if (index != -1) { if (index != -1) {
/* LPTSTR pszText = NULL; */
switch (dwValType) { switch (dwValType) {
case REG_SZ: case REG_SZ:
case REG_EXPAND_SZ: case REG_EXPAND_SZ:
...@@ -169,7 +168,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, ...@@ -169,7 +168,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
wsprintf(buf, _T("0x%08X (%d)"), *(DWORD*)ValBuf, *(DWORD*)ValBuf); wsprintf(buf, _T("0x%08X (%d)"), *(DWORD*)ValBuf, *(DWORD*)ValBuf);
ListView_SetItemText(hwndLV, index, 2, buf); ListView_SetItemText(hwndLV, index, 2, buf);
} }
/* lpsRes = convertHexToDWORDStr(lpbData, dwLen); */
break; break;
case REG_BINARY: { case REG_BINARY: {
unsigned int i; unsigned int i;
...@@ -188,7 +186,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, ...@@ -188,7 +186,6 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
break; break;
default: default:
{ {
/* lpsRes = convertHexToHexCSV(lpbData, dwLen); */
TCHAR szText[128]; TCHAR szText[128];
LoadString(hInst, IDS_REGISTRY_VALUE_CANT_DISPLAY, szText, COUNT_OF(szText)); LoadString(hInst, IDS_REGISTRY_VALUE_CANT_DISPLAY, szText, COUNT_OF(szText));
ListView_SetItemText(hwndLV, index, 2, szText); ListView_SetItemText(hwndLV, index, 2, szText);
......
...@@ -158,7 +158,7 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -158,7 +158,7 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), filename); fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), filename);
exit(1); exit(1);
} }
processRegLines(reg_file, doSetValue); processRegLines(reg_file);
if (realname) if (realname)
{ {
HeapFree(GetProcessHeap(),0,realname); HeapFree(GetProcessHeap(),0,realname);
......
...@@ -17,49 +17,11 @@ ...@@ -17,49 +17,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/******************************************************************************
* Defines and consts
*/
#define KEY_MAX_LEN 1024 #define KEY_MAX_LEN 1024
/* Return values */ const CHAR *getAppName(void);
#define SUCCESS 0
#define KEY_VALUE_ALREADY_SET 2
typedef void (*CommandAPI)(LPSTR lpsLine);
void doSetValue(LPSTR lpsLine);
void doDeleteValue(LPSTR lpsLine);
void doCreateKey(LPSTR lpsLine);
void doDeleteKey(LPSTR lpsLine);
void doRegisterDLL(LPSTR lpsLine);
void doUnregisterDLL(LPSTR lpsLine);
BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name); BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
BOOL import_registry_file(LPTSTR filename); BOOL import_registry_file(LPTSTR filename);
void delete_registry_key(CHAR *reg_key_name); void delete_registry_key(CHAR *reg_key_name);
void processRegLines(FILE *in);
const CHAR *getAppName(void);
void processRegLines(FILE *in, CommandAPI command);
/*
* Generic prototypes
*/
char* getToken(char** str, const char* delims);
DWORD convertHexToDWord(char *str, BYTE *buf);
DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen);
LPSTR convertHexToHexCSV( BYTE *buf, ULONG len);
LPSTR convertHexToDWORDStr( BYTE *buf, ULONG len);
LPSTR getRegKeyName(LPSTR lpLine);
HKEY getRegClass(LPSTR lpLine);
DWORD getDataType(LPSTR *lpValue, DWORD* parse_type);
LPSTR getArg(LPSTR arg);
HRESULT openKey(LPSTR stdInput);
void closeKey(void);
/*
* api setValue prototypes
*/
void processSetValue(LPSTR cmdline);
HRESULT setValue(LPSTR val_name, LPSTR val_data);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment