comparison tools/dumpmod.c @ 2586:9807ae37ad69

Require stdbool.h, we require C11 now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Dec 2022 15:59:22 +0200
parents d56a0e86067a
children
comparison
equal deleted inserted replaced
2585:ef6c826c5b7a 2586:9807ae37ad69
11 #include "dmargs.h" 11 #include "dmargs.h"
12 #include "dmmutex.h" 12 #include "dmmutex.h"
13 13
14 14
15 char *optFilename = NULL; 15 char *optFilename = NULL;
16 BOOL optViewPatterns = FALSE, 16 bool optViewPatterns = false,
17 optViewInstruments = FALSE, 17 optViewInstruments = false,
18 optViewExtInstruments = FALSE, 18 optViewExtInstruments = false,
19 optViewGeneralInfo = FALSE, 19 optViewGeneralInfo = false,
20 optDump = FALSE; 20 optDump = false;
21 21
22 22
23 static const DMOptArg optList[] = 23 static const DMOptArg optList[] =
24 { 24 {
25 { 0, '?', "help" , "Show this help", OPT_NONE }, 25 { 0, '?', "help" , "Show this help", OPT_NONE },
42 dmPrintBanner(stdout, dmProgName, "[options] [modfile]"); 42 dmPrintBanner(stdout, dmProgName, "[options] [modfile]");
43 dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); 43 dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2);
44 } 44 }
45 45
46 46
47 BOOL argHandleOpt(const int optN, char *optArg, char *currArg) 47 bool argHandleOpt(const int optN, char *optArg, char *currArg)
48 { 48 {
49 (void) optArg; 49 (void) optArg;
50 50
51 switch (optN) 51 switch (optN)
52 { 52 {
63 case 2: 63 case 2:
64 dmVerbosity++; 64 dmVerbosity++;
65 break; 65 break;
66 66
67 case 10: 67 case 10:
68 optViewPatterns = TRUE; 68 optViewPatterns = true;
69 break; 69 break;
70 70
71 case 12: 71 case 12:
72 optViewInstruments = TRUE; 72 optViewInstruments = true;
73 break; 73 break;
74 74
75 case 14: 75 case 14:
76 optViewExtInstruments = TRUE; 76 optViewExtInstruments = true;
77 break; 77 break;
78 78
79 case 16: 79 case 16:
80 optViewGeneralInfo = TRUE; 80 optViewGeneralInfo = true;
81 break; 81 break;
82 82
83 case 18: 83 case 18:
84 optDump = TRUE; 84 optDump = true;
85 break; 85 break;
86 86
87 case 20: 87 case 20:
88 optViewPatterns = TRUE; 88 optViewPatterns = true;
89 optViewInstruments = TRUE; 89 optViewInstruments = true;
90 optViewGeneralInfo = TRUE; 90 optViewGeneralInfo = true;
91 optViewExtInstruments = TRUE; 91 optViewExtInstruments = true;
92 break; 92 break;
93 93
94 default: 94 default:
95 dmErrorMsg("Unimplemented option argument '%s'.\n", currArg); 95 dmErrorMsg("Unimplemented option argument '%s'.\n", currArg);
96 return FALSE; 96 return false;
97 } 97 }
98 98
99 return TRUE; 99 return true;
100 } 100 }
101 101
102 102
103 BOOL argHandleFile(char *currArg) 103 bool argHandleFile(char *currArg)
104 { 104 {
105 // Was not option argument 105 // Was not option argument
106 if (!optFilename) 106 if (!optFilename)
107 optFilename = currArg; 107 optFilename = currArg;
108 else 108 else
109 { 109 {
110 dmErrorMsg("Oh noes, we can only hand one file and '%s' looks like a second one!\n", currArg); 110 dmErrorMsg("Oh noes, we can only hand one file and '%s' looks like a second one!\n", currArg);
111 return FALSE; 111 return false;
112 } 112 }
113 113
114 return TRUE; 114 return true;
115 } 115 }
116 116
117 117
118 const char patNoteTable[12][3] = 118 const char patNoteTable[12][3] =
119 { 119 {
459 #ifdef JSS_SUP_XM 459 #ifdef JSS_SUP_XM
460 if (mod == NULL) 460 if (mod == NULL)
461 { 461 {
462 dmMsg(2, "* Trying XM...\n"); 462 dmMsg(2, "* Trying XM...\n");
463 dmfreset(file); 463 dmfreset(file);
464 if ((res = jssLoadXM(file, &mod, TRUE)) == DMERR_OK) 464 if ((res = jssLoadXM(file, &mod, true)) == DMERR_OK)
465 { 465 {
466 dmfreset(file); 466 dmfreset(file);
467 res = jssLoadXM(file, &mod, FALSE); 467 res = jssLoadXM(file, &mod, false);
468 } 468 }
469 } 469 }
470 #endif 470 #endif
471 #ifdef JSS_SUP_JSSMOD 471 #ifdef JSS_SUP_JSSMOD
472 if (mod == NULL) 472 if (mod == NULL)
473 { 473 {
474 dmMsg(1, "* Trying JSSMOD ...\n"); 474 dmMsg(1, "* Trying JSSMOD ...\n");
475 dmfreset(file); 475 dmfreset(file);
476 if ((res = jssLoadJSSMOD(file, &mod, TRUE)) == DMERR_OK) 476 if ((res = jssLoadJSSMOD(file, &mod, true)) == DMERR_OK)
477 { 477 {
478 dmfreset(file); 478 dmfreset(file);
479 res = jssLoadJSSMOD(file, &mod, FALSE); 479 res = jssLoadJSSMOD(file, &mod, false);
480 } 480 }
481 } 481 }
482 #endif 482 #endif
483 dmf_close(file); 483 dmf_close(file);
484 484