Changeset 1498 for trunk/dll/command.c
- Timestamp:
- Jan 18, 2010, 1:57:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/command.c
r1497 r1498 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 20 08Steven H. Levine9 Copyright (c) 2004, 2010 Steven H. Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 36 36 27 Dec 09 GKY Added QueryCommandSettings to streamline code 37 37 27 Dec 09 GKY Made command hotkeys user selectable. 38 17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *. 38 39 39 40 ***********************************************************************/ … … 374 375 375 376 size = sizeof(BOOL) * 300; 376 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,377 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs, 377 378 &size); 378 379 size = sizeof(BOOL) * 40; 379 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,380 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs, 380 381 &size); size = sizeof(BOOL); 381 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.LoadCommandsFromINI",382 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.LoadCommandsFromINI", 382 383 &fLoadCommandsFromINI, &size); 383 384 if (!fLoadCommandsFromINI) { … … 480 481 cmdloaded = TRUE; 481 482 size = sizeof(ULONG); 482 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.SizeSortOrder",483 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.SizeSortOrder", 483 484 &ulSizeCommandsList, &size); 484 485 pszCommandsList = xmallocz(ulSizeCommandsList, pszSrcFile, __LINE__); 485 486 if (pszCommandsList) { 486 PrfQueryProfileString(fmprof, FM3Str, "COMMANDS.SortOrder",487 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder", 487 488 NullStr, pszCommandsList, ulSizeCommandsList); 488 489 p = pszCommandsList; … … 501 502 sprintf(key, "COMMAND.%sID", szTitle); 502 503 size = sizeof(ULONG); 503 PrfQueryProfileData(fmprof, FM3Str, key, &ID, &size);504 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &ID, &size); 504 505 sprintf(key, "COMMAND.%sHotKeyID", szTitle); 505 506 size = sizeof(ULONG); 506 PrfQueryProfileData(fmprof, FM3Str, key, &HotKeyID, &size);507 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &HotKeyID, &size); 507 508 sprintf(key, "COMMAND.%sflags", szTitle); 508 509 size = sizeof(ULONG); 509 PrfQueryProfileData(fmprof, FM3Str, key, &flags, &size);510 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &flags, &size); 510 511 sprintf(key, "COMMAND.%senv", szTitle); 511 PrfQueryProfileString(fmprof, FM3Str, key, NullStr, env, sizeof(env));512 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, env, sizeof(env)); 512 513 sprintf(key, "COMMAND.%sCmdLine", szTitle); 513 PrfQueryProfileString(fmprof, FM3Str, key, NullStr, pszCmdLine, MaxComLineStrg);514 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, pszCmdLine, MaxComLineStrg); 514 515 } 515 516 info = xmallocz(sizeof(LINKCMDS), pszSrcFile, __LINE__); … … 550 551 sprintf(key, "COMMAND.%sID", info->title); 551 552 size = sizeof(ULONG); 552 PrfQueryProfileData(fmprof, FM3Str, key, &ID, &size);553 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &ID, &size); 553 554 sprintf(key, "COMMAND.%sHotKeyID", info->title); 554 555 size = sizeof(ULONG); 555 PrfQueryProfileData(fmprof, FM3Str, key, &HotKeyID, &size);556 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &HotKeyID, &size); 556 557 sprintf(key, "COMMAND.%senv", info->title); 557 PrfQueryProfileString(fmprof, FM3Str, key, NullStr, env, sizeof(env));558 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, env, sizeof(env)); 558 559 if (ID != 0) { 559 560 if (env != NullStr) … … 584 585 GetPString(IDS_COMMANDSLIMITREACHEDTEXT )); 585 586 } 586 PrfQueryProfileString(fmprof, FM3Str, info->pszCmdLine, NullStr, env, sizeof(env));587 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, info->pszCmdLine, NullStr, env, sizeof(env)); 587 588 info->env = xstrdup(env, pszSrcFile, __LINE__); 588 589 } … … 610 611 while (info) { 611 612 sprintf(key, "COMMAND.%sflags", info->title); 612 PrfWriteProfileData(fmprof, FM3Str, key, &info->flags, sizeof(ULONG));613 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->flags, sizeof(ULONG)); 613 614 sprintf(key, "COMMAND.%sCmdLine", info->title); 614 PrfWriteProfileString(fmprof, FM3Str, key, info->pszCmdLine);615 PrfWriteProfileString(fmprof, (CHAR *) FM3Str, key, info->pszCmdLine); 615 616 bstripcr(info->title); 616 617 sprintf(key, "COMMAND.%sID", info->title); 617 PrfWriteProfileData(fmprof, FM3Str, key, &info->ID, sizeof(INT));618 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->ID, sizeof(INT)); 618 619 sprintf(key, "COMMAND.%sHotKeyID", info->title); 619 PrfWriteProfileData(fmprof, FM3Str, key, &info->HotKeyID, sizeof(INT));620 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->HotKeyID, sizeof(INT)); 620 621 if (info->env != NullStr) { 621 622 sprintf(key, "COMMAND.%senv", info->title); 622 PrfWriteProfileString(fmprof, FM3Str, key, info->env);623 PrfWriteProfileString(fmprof, (CHAR *) FM3Str, key, info->env); 623 624 } 624 625 if ((strlen(pszCommandsList) + strlen(info->title) + 1) > ulSizeCommandsList) … … 630 631 info = info->next; 631 632 } // while info 632 PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,633 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs, 633 634 sizeof(BOOL) * 300); 634 PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,635 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs, 635 636 sizeof(BOOL) * 40); 636 637 ulSizeCommandsList = strlen(pszCommandsList) + 1; 637 PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.SizeSortOrder",638 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.SizeSortOrder", 638 639 &ulSizeCommandsList, sizeof(ULONG)); 639 PrfWriteProfileString(fmprof, FM3Str, "COMMANDS.SortOrder", pszCommandsList);640 PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.LoadCommandsFromINI",640 PrfWriteProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder", pszCommandsList); 641 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.LoadCommandsFromINI", 641 642 &fLoadCommandsFromINI, sizeof(BOOL)); 642 643 } … … 747 748 pszCommandsList = xmallocz(ulSizeCommandsList, pszSrcFile, __LINE__); 748 749 if (pszCommandsList) 749 PrfQueryProfileString(fmprof, FM3Str, "COMMANDS.SortOrder",750 PrfQueryProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder", 750 751 NullStr, pszCommandsList, ulSizeCommandsList); 751 752 return 0; … … 1102 1103 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp); 1103 1104 sprintf(keyenv, "COMMAND.%senv", temp); 1104 PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, 0);1105 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, 0);1106 PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL);1105 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyID, NULL, 0); 1106 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, NULL, 0); 1107 PrfWriteProfileString(fmprof, (CHAR *) FM3Str, keyenv, NULL); 1107 1108 x = (SHORT) WinSendDlgItemMsg(hwnd, 1108 1109 CMD_LISTBOX, … … 1157 1158 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp->title); 1158 1159 sprintf(keyenv, "COMMAND.%senv", temp->title); 1159 PrfQueryProfileData(fmprof, FM3Str, keyID, &ID, &size);1160 PrfQueryProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, &size);1160 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, keyID, &ID, &size); 1161 PrfQueryProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, &HotKeyID, &size); 1161 1162 temp->ID = ID; 1162 1163 if (temp->HotKeyID == HotKeyID || temp->HotKeyID == 0) 1163 1164 fDontCheckHotKey = TRUE; 1164 1165 if (kill_command(temp->title)) { 1165 PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, 0);1166 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, 0);1167 PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL);1166 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyID, NULL, 0); 1167 PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, NULL, 0); 1168 PrfWriteProfileString(fmprof, (CHAR *) FM3Str, keyenv, NULL); 1168 1169 x = (SHORT) WinSendDlgItemMsg(hwnd, 1169 1170 CMD_LISTBOX,
Note:
See TracChangeset
for help on using the changeset viewer.