-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathComLib.h
More file actions
734 lines (650 loc) · 18.8 KB
/
Copy pathComLib.h
File metadata and controls
734 lines (650 loc) · 18.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
//Copyright+LGPL
//-----------------------------------------------------------------------------------------------------------------------------------------------
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
//-----------------------------------------------------------------------------------------------------------------------------------------------
// This file is part of MMVARI.
// MMVARI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// MMVARI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see
// <http://www.gnu.org/licenses/>.
//-----------------------------------------------------------------------------------------------------------------------------------------------
#ifndef ComLibH
#define ComLibH
#include <ComCtrls.hpp>
#include <inifiles.hpp>
#include <Grids.hpp>
#include <Buttons.hpp>
#include <values.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mbstring.h>
#include <dir.h>
#include <Wingdi.h> //ja7ude 0522
#define VERBETA ""
#define VERNO "0.45"
#define INI_SCHEMA 3
//DEBUG should be FALSE, thanks to Mori-san JE3HHT
#define DEBUG FALSE
#define MEASIMD FALSE
#define LOGFFT FALSE
#define SHOWERRCOUNT FALSE
#define FORCELANG 0
#if DEBUG
#include <assert.h>
#define ASSERT(c) assert(c)
#else
#define ASSERT(c)
#endif
#if SHOWERRCOUNT
#define EPHASE(c) sys.m_ErrPhase = c
enum {
P_NULL,
P_DEMBPF,
P_DEMAGC,
P_DEMLPF,
P_DEMAFC,
P_DEMLOCK,
P_DEMVCO,
P_DEMOUT,
P_SUBCREATE,
P_SUBVIEW,
};
#else
#define EPHASE(c)
#endif
#define VERID "beta ver "VERNO
#define VERTTL2 "MMVARI "VERID VERBETA
#define VERTTL VERTTL2" (C) JE3HHT 2004-2010."
#define WM_WAVE WM_USER+400
#define CM_CRADIO WM_USER+400
#define CM_CMML WM_USER+401
#define CM_CMMR WM_USER+402
enum {
waveIN,
waveOUT,
waveCloseFileEdit,
waveCodeView,
wavePlayDlg,
waveCloseRxView,
waveSwapRxView,
waveClockAdj,
waveSeekMacro,
waveDoMacro,
waveLoadMacro,
#if DEBUG
waveRepeatMacro = 1024,
#endif
};
enum {
macOnTimer,
macOnPTT,
macOnQSO,
macOnFind,
macOnBand,
macOnStart,
macOnExit,
macOnMode,
macOnSpeed,
macOnClick,
macOnFFTScale,
macOnEnd,
};
//extern char g_MMLogDir[256];
extern const char MONN[];
extern const char MONU[];
extern const LPCSTR g_tLogModeTable[];
extern const LPCSTR g_tDispModeTable[];
extern const LPCSTR g_tMacEvent[];
extern const LPCSTR g_tSoundCH[];
extern const LPCSTR g_tOnOff[];
#ifndef LPCUSTR
typedef const unsigned char * LPCUSTR;
typedef unsigned char * LPUSTR;
#endif
#define ABS(c) (((c)<0)?(-(c)):(c))
#define AN(p) (sizeof(p)/sizeof(*(p)))
#define CR 0x0d
#define LF 0x0a
#define TAB '\t'
#define FSBOLD 1
#define FSITALIC 2
#define FSUNDERLINE 4
#define FSSTRIKEOUT 8
typedef struct {
AnsiString m_Name;
BYTE m_Charset;
int m_Height;
DWORD m_Style;
}FONTDATA;
enum {
kkTX,
kkTXOFF,
kkEOF,
};
typedef struct {
WORD Key;
LPCSTR pName;
}DEFKEYTBL;
extern const DEFKEYTBL KEYTBL[];
LPCSTR __fastcall ToDXKey(LPCSTR s);
LPCSTR __fastcall ToJAKey(LPCSTR s);
LPCSTR __fastcall GetKeyName(WORD Key);
WORD __fastcall GetKeyCode(LPCSTR pName);
enum {
fmJA,
fmHL,
fmJOHAB,
fmBV,
fmBY,
fmEND,
};
typedef struct {
AnsiString m_CallSign;
WORD m_DefKey[kkEOF];
BOOL m_PTTLock;
int m_bFSKOUT;
int m_bINVFSK;
AnsiString m_PTTCOM;
int m_DefaultMode;
int m_LoopBack;
int m_MsgEng;
LCID m_LCID;
WORD m_wLang;
BOOL m_fShowLangMsg;
BOOL m_fBaseMBCS;
DWORD m_dwVersion;
BOOL m_WinNT;
BOOL m_WinVista;
AnsiString m_FontName;
BYTE m_FontCharset;
BYTE m_Charset;
BOOL m_fFontFam;
BOOL m_tFontFam[fmEND];
int m_OptionPage;
int m_EventIndex;
char m_BgnDir[256];
char m_SoundDir[256];
char m_ExtLogDir[256];
char m_LogDir[256];
char m_TextDir[256];
char m_MacroDir[256];
int m_AutoTimeOffset;
int m_TimeOffset;
int m_TimeOffsetMin;
int m_LogLink;
AnsiString m_LogName;
BOOL m_fRestoreSubChannel;
BOOL m_fFixWindow;
RECT m_rcWindow; // ウインドウの配置
int m_WindowState; // ウインドウの状態
BOOL m_fAutoTS;
BOOL m_fSendSingleTone;
BOOL m_EnableMouseWheel;
AnsiString m_SoundIDRX;
AnsiString m_SoundIDTX;
AnsiString m_SoundMMW; // MMW名
AnsiString m_AS;
AnsiString m_MacEvent[macOnEnd];
BOOL m_fPlayBack;
int m_PlayBackSpeed;
BOOL m_fShowCtrlCode;
BOOL m_MFSK_Center;
BOOL m_MFSK_SQ_Metric;
BOOL m_MacroError;
int m_MaxCarrier;
int m_DecCutOff;
int m_MacBuffSize;
int m_OnTimerInterval;
RECT m_PosMacEdit;
#if DEBUG
BOOL m_test;
int m_testSN;
AnsiString m_testName;
double m_testGain;
double m_testNoiseGain;
int m_testCarrier1;
int m_testCarrier2;
int m_testDB2;
double m_testGain2;
int m_testQSBTime;
int m_testQSBDB;
BOOL m_test500;
BOOL m_testPhase;
int m_testClockErr;
#endif
#if SHOWERRCOUNT
int m_ErrPhase;
#endif
}SYSSET;
extern SYSSET sys;
typedef struct {
int WMax;
int Max;
int Sum;
int dBSum;
int dBMax;
int dBWMax;
int Timer;
int VW;
int LimitL, LimitH;
int Sig;
int DispSig;
}FFTSTG;
///---------------------------------------------------------
typedef union {
struct {
BYTE r;
BYTE g;
BYTE b;
BYTE s;
}b;
DWORD d;
TColor c;
}UCOL;
///---------------------------------------------------------
/// テキスト文字列ストリーマー
class CTextString
{
private:
LPCSTR rp;
public:
inline __fastcall CTextString(LPCSTR p){
rp = p;
};
inline __fastcall CTextString(AnsiString &As){
rp = As.c_str();
};
int __fastcall LoadText(LPSTR tp, int len);
};
class CWebRef
{
private:
AnsiString HTML;
public:
__fastcall CWebRef();
inline bool __fastcall IsHTML(void){
return !HTML.IsEmpty();
};
void __fastcall ShowHTML(LPCSTR url);
};
///---------------------------------------------------------
/// テキストバッファストリーマー
class StrText{
public:
char *Bp;
char *Wp;
inline __fastcall StrText(int max){
Bp = new char[max];
Clear();
};
inline __fastcall ~StrText(){
delete Bp;
};
inline char *Printf(char *ct, ...){
va_list pp;
va_start(pp, ct);
vsprintf(Wp, ct, pp );
va_end(pp);
ct = Wp;
Wp += strlen(Wp);
return(ct);
};
inline void __fastcall Add(LPCSTR sp){
strcpy(Wp, sp);
Wp += strlen(Wp);
};
inline void __fastcall Write(void *p, int n){
memcpy(Wp, p, n);
Wp += n;
*Wp = 0;
};
inline int __fastcall GetCnt(void){
return Wp - Bp;
};
inline void __fastcall Clear(void){
Wp = Bp;
*Wp = 0;
};
inline char *__fastcall GetText(void){
return Bp;
};
};
class CWaitCursor
{
private:
TCursor sv;
public:
__fastcall CWaitCursor();
__fastcall ~CWaitCursor();
void __fastcall Delete(void);
void __fastcall Wait(void);
};
///---------------------------------------------------------
/// コントロールのアラインの管理クラス
class CAlign
{
private:
int BTop, BLeft;
int BWidth, BHeight;
int OTop, OLeft;
int OWidth, OHeight;
int OFontHeight;
double m_FontAdj;
TControl *tp;
TFont *fp;
public:
inline __fastcall CAlign(void){
tp = NULL;
fp = NULL;
m_FontAdj = 1.0;
};
inline __fastcall ~CAlign(){
};
void __fastcall InitControl(TControl *p, TControl *pB, TFont *pF = NULL);
void __fastcall InitControl(TControl *p, RECT *rp, TFont *pF = NULL);
void __fastcall NewAlign(TControl *pB);
inline double __fastcall GetFontAdj(void){return fabs(m_FontAdj);};
inline TControl *__fastcall GetControl(void){return tp;};
void __fastcall NewAlign(TControl *pB, double hx);
void __fastcall NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs);
void __fastcall NewFixAlign(TControl *pB, int XR);
void __fastcall Resume(void);
};
///---------------------------------------------------------
/// コントロールのアラインの管理クラス
class CAlignList
{
private:
int Max;
int Cnt;
CAlign **AlignList;
void __fastcall Alloc(void);
public:
__fastcall CAlignList(void);
__fastcall ~CAlignList();
void __fastcall EntryControl(TControl *tp, TControl *pB, TFont *pF = NULL);
void __fastcall EntryControl(TControl *tp, RECT *rp, TFont *pF = NULL);
void __fastcall EntryControl(TControl *tp, int XW, int YW, TFont *pF = NULL);
void __fastcall NewAlign(TControl *pB);
double __fastcall GetFontAdj(TControl *pB);
void __fastcall NewAlign(TControl *pB, TControl *pS, double hx);
void __fastcall NewFont(AnsiString &FontName, BYTE Charset, TFontStyles fs);
void __fastcall NewFixAlign(TControl *pB, int XR);
void __fastcall Resume(TControl *pB);
};
int __fastcall FindStringTableStrictly(const LPCSTR _tt[], LPCSTR pName, int max);
int __fastcall FindStringTable(const LPCSTR _tt[], LPCSTR pName, int max);
int __fastcall GetModeIndex(LPCSTR pName);
int __fastcall IsFile(LPCSTR pName);
BOOL __fastcall StrWindowsVer(LPSTR t);
//---------------------------------------------------------------------------
int __fastcall SetTimeOffsetInfo(int &Hour, int &Min);
void __fastcall AddjustOffset(SYSTEMTIME *tp);
void __fastcall GetUTC(SYSTEMTIME *tp);
void __fastcall GetLocal(SYSTEMTIME *tp);
LPSTR __fastcall StrDupe(LPCSTR s);
LPUSTR __fastcall jstrupr(LPUSTR s);
LPUSTR __fastcall jstrlwr(LPUSTR s);
inline LPSTR __fastcall jstrupr(LPSTR s){return (LPSTR)jstrupr(LPUSTR(s));};
inline LPSTR __fastcall jstrlwr(LPSTR s){return (LPSTR)jstrlwr(LPUSTR(s));};
LPCSTR __fastcall ConvAndChar(LPSTR t, LPCSTR p);
void __fastcall OnWave(void);
int __fastcall SetTimeOffsetInfo(int &Hour, int &Min);
WORD __fastcall AdjustRolTimeUTC(WORD tim, char c);
void __fastcall DrawMessage(TCanvas *pCanvas, int XW, int YW, LPCSTR p, int Pos);
void __fastcall FormCenter(TForm *tp, int XW, int YW);
void __fastcall FormCenter(TForm *tp, TForm *pOwner);
void __fastcall FormCenter(TForm *tp);
char *__fastcall lastp(char *p);
char *__fastcall clipsp(char *s);
LPCSTR __fastcall _strdmcpy(LPSTR t, LPCSTR p, char c);
const char *__fastcall StrDlmCpy(char *t, const char *p, char Dlm, int len);
const char *__fastcall StrDlmCpyK(char *t, const char *p, char Dlm, int len);
void __fastcall StrCopy(LPSTR t, LPCSTR s, int n);
char __fastcall LastC(LPCSTR p);
LPCSTR __fastcall GetEXT(LPCSTR Fname);
void __fastcall SetEXT(LPSTR pName, LPSTR pExt);
BOOL __fastcall CheckEXT(LPCSTR pName, LPCSTR pExt);
void __fastcall SetCurDir(LPSTR t, int size);
void __fastcall SetDirName(LPSTR t, LPCSTR pName);
void __fastcall GetFileName(AnsiString &Name, LPCSTR pName);
void __fastcall GetFullPathName(AnsiString &as, LPCSTR pName);
void __fastcall GetFullPathName(AnsiString &as, LPCSTR pName, LPCSTR pFolder);
void __fastcall LimitInt(int *pInt, int min, int max);
void __fastcall LimitDbl(double *pInt, double min, double max);
LPCSTR __fastcall StrDbl(LPSTR bf, double d);
void __fastcall AdjustAS(AnsiString *pAS);
void __fastcall ClipLF(LPSTR sp);
void __fastcall DelCR(AnsiString &ws, LPCSTR s);
void __fastcall DeleteComment(LPSTR bf);
LPSTR __fastcall FillSpace(LPSTR s, int n);
LPCSTR __fastcall SkipToValue(LPCSTR sp);
LPSTR __fastcall SkipSpace(LPSTR sp);
LPCSTR __fastcall SkipSpace(LPCSTR sp);
LPSTR __fastcall DelLastSpace(LPSTR t);
LPSTR __fastcall StrDlm(LPSTR &t, LPSTR p);
LPSTR __fastcall StrDlm(LPSTR &t, LPSTR p, char c);
void __fastcall ChgString(LPSTR t, char a, char b);
void __fastcall DelChar(LPSTR t, char a);
int __fastcall atoin(const char *p, int n);
int __fastcall htoin(const char *p, int n);
int __fastcall GetActiveIndex(TPageControl *pp);
void __fastcall SetActiveIndex(TPageControl *pp, int page);
int __fastcall InvMenu(TMenuItem *pItem);
void InfoMB(LPCSTR fmt, ...);
void ErrorMB(LPCSTR fmt, ...);
void WarningMB(LPCSTR fmt, ...);
int YesNoMB(LPCSTR fmt, ...);
int YesNoCancelMB(LPCSTR fmt, ...);
int OkCancelMB(LPCSTR fmt, ...);
void __fastcall ErrorFWrite(LPCSTR pName);
int __fastcall RemoveL2(LPSTR t, LPSTR ss, LPCSTR pKey, int size);
void __fastcall AddL2(LPSTR t, LPCSTR pKey, LPCSTR s, UCHAR c1, UCHAR c2, int size);
int __fastcall IsJA(const char *s);
LPCSTR __fastcall ClipCall(LPCSTR s);
void __fastcall chgptb(LPSTR s);
LPCSTR __fastcall ClipCC(LPCSTR s);
void __fastcall Yen2CrLf(AnsiString &ws, AnsiString &cs);
void __fastcall CrLf2Yen(AnsiString &ws, AnsiString &cs);
void __fastcall GetLogFont(LOGFONT *pLogfont, TFont *pFont);
void __fastcall AddStyle(AnsiString &as, BYTE charset, DWORD style);
TFontStyles __fastcall Code2FontStyle(int code);
int __fastcall FontStyle2Code(TFontStyles style);
void __fastcall LoadFontFromInifile(TFont *pFont, LPCSTR pSect, TMemIniFile *pIniFile);
void __fastcall SaveFontToInifile(TFont *pFont, LPCSTR pSect, TMemIniFile *pIniFile);
UCOL __fastcall GetGrade2(UCOL s[2], int x, int xw);
void __fastcall CheckFontCharset(void);
BOOL __fastcall SetLangFont(TFont *pFont, WORD wLang);
void __fastcall SetMBCP(BYTE charset);
void __fastcall Font2FontData(FONTDATA *pData, TFont *pFont);
void __fastcall FontData2Font(TFont *pFont, FONTDATA *pData);
void __fastcall LoadFontFromInifile(FONTDATA *pData, LPCSTR pSect, TMemIniFile *pIniFile);
void __fastcall SaveFontToInifile(FONTDATA *pData, LPCSTR pSect, TMemIniFile *pIniFile);
void __fastcall NumCopy(LPSTR t, LPCSTR p);
int __fastcall IsNumbs(LPCSTR p);
int __fastcall IsNumbAll(LPCSTR p);
int __fastcall IsAlphas(LPCSTR p);
int __fastcall IsAlphaAll(LPCSTR p);
int __fastcall IsRST(LPCSTR p);
int __fastcall IsCallChar(char c);
int __fastcall IsCall(LPCSTR p);
int __fastcall IsJA(const char *s);
LPCSTR __fastcall ClipCall(LPCSTR s);
LPCSTR __fastcall ClipCC(LPCSTR s);
/*
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPUSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p), c);};
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPUSTR p){return (LPUSTR)StrDlm(LPSTR(t), LPSTR(p));};
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPSTR p, char c){return (LPUSTR)StrDlm(LPSTR(t), p, c);};
inline LPUSTR __fastcall StrDlm(LPUSTR &t, LPSTR p){return (LPUSTR)StrDlm(LPSTR(t), p);};
*/
void __fastcall SetGroupEnabled(TGroupBox *gp);
void __fastcall KeyEvent(const short *p);
int __fastcall Calc(double &d, LPCSTR p);
int __fastcall CalcI(int &d, LPCSTR p);
int __fastcall CalcU(int &d, LPCSTR p);
void __fastcall GPS2SystemTime(ULONG gps, SYSTEMTIME *sp);
ULONG __fastcall SystemTime2GPS(SYSTEMTIME *sp);
void __fastcall SetComboBox(TComboBox *pCombo, LPCSTR pList);
void __fastcall GetComboBox(AnsiString &as, TComboBox *pCombo);
void __fastcall ConvDummy(AnsiString &ws, LPCSTR p, LPCSTR pNames, LPCSTR pValues);
typedef struct {
LPSTR pStr;
int Count;
}MULTSET;
class CMULT
{
private:
int m_CNT;
int m_MAX;
MULTSET *m_pBase;
// LPSTR *m_pStr;
// LPSTR m_pStr[MULTMAX];
private:
void __fastcall Alloc(void);
public:
__fastcall CMULT();
__fastcall ~CMULT(){
Clear();
};
void __fastcall Clear(void);
int __fastcall Add(LPCSTR pKey);
int __fastcall Set(LPCSTR pKey, int n);
int __fastcall GetCount(void){
return m_CNT;
};
void __fastcall Sort(void);
void __fastcall SortCount(void);
LPCSTR __fastcall GetText(int n){
if( (n >= 0) && (n < m_CNT) ){
return m_pBase[n].pStr;
}
else {
return NULL;
}
};
int __fastcall GetCount(int n){
if( (n >= 0) && (n < m_CNT) ){
return m_pBase[n].Count;
}
else {
return 0;
}
};
int __fastcall GetCount(LPCSTR pKey);
int __fastcall GetTotal(void);
};
//---------------------------------------------------------------------------
class CCond
{
private:
int m_CIFMAX;
int m_f; /* 条件のカウンタ */
int m_fc; /* 偽の場合のレベルカウンタ */
int *m_pE; /* 状態のネスト配列 */
int *m_pAF; /* 展開フラグのネスト配列 */
int m_err; /* エラーチェック */
BOOL m_fCond;
int __fastcall BgnCond(void);
public:
int __fastcall CondJob(const char *p, TSpeedButton *pButton);
int __fastcall CondStr(AnsiString &Cond, const char *p);
inline void __fastcall SetCond(void){m_fCond=TRUE;};
inline BOOL __fastcall IsCond(void){return m_fCond;};
inline int __fastcall GetLevel(void){return m_f;};
inline void __fastcall ClearLevel(void){m_f = 0;};
__fastcall CCond(int max);
__fastcall ~CCond(void);
};
//---------------------------------------------------------------------------
#pragma option -a- // パックの指示
typedef struct {
WORD hash;
BYTE mtype;
BYTE dummy;
LPCSTR pName;
LPCSTR pString;
LPCSTR pPara;
}VALDATA;
#pragma option -a. // パック解除の指示
#define _VAL_NORMAL 1
#define _VAL_INIFILE 2
#define _VAL_PROC 4
class CVal
{
private:
VALDATA *m_pBase;
int m_Max;
int m_Count;
BOOL m_fHandleProc;
private:
void __fastcall Alloc(void);
public:
__fastcall CVal();
__fastcall ~CVal(){Delete();};
inline int __fastcall GetCount(void){return m_Count;};
inline BOOL __fastcall IsHandleProc(void){return m_fHandleProc;};
void __fastcall Delete(void);
void __fastcall Delete(BYTE mtype);
BOOL __fastcall Delete(LPCSTR pName, BYTE mtype);
int __fastcall FindName(LPCSTR pName, BYTE mtype);
void __fastcall RegisterString(LPCSTR pName, LPCSTR pString, LPCSTR pPara, BYTE mtype);
void __fastcall WriteInifile(TMemIniFile *pIniFile, LPCSTR pSect);
void __fastcall ReadInifile(TMemIniFile *pIniFile, LPCSTR pSect);
inline LPCSTR __fastcall GetString(int n){ return m_pBase[n].pString; };
inline LPCSTR __fastcall GetPara(int n){ return m_pBase[n].pPara; };
};
//---------------------------------------------------------------------------
#pragma option -a- // パックの指示
typedef struct {
WORD cMBCS;
WORD cASCII;
}CONVALPHA;
#pragma option -a. // パック解除の指示
class CMBCS
{
private:
BYTE *m_pLead;
int m_Charset;
public:
__fastcall CMBCS();
__fastcall ~CMBCS();
void __fastcall Create(BYTE charset);
void __fastcall Create(void);
BOOL __fastcall IsLead(BYTE c);
BOOL __fastcall IsLead(const unsigned char *p);
int __fastcall ConvAlpha(int code);
inline BOOL __fastcall IsCreate(void){return m_pLead != NULL;};
inline void __fastcall SetCharset(BYTE charset){m_Charset = charset;};
};
//---------------------------------------------------------------------------
// CLIBLクラス
typedef struct {
LPCSTR pName;
//HANDLE hLib; //ja7ude 0522
HINSTANCE hLib;
}LIBD;
typedef void (__stdcall *tmmMacro)(HWND hWnd, LPSTR t, LPCSTR p);
class CLIBL {
public:
int m_AMax;
int m_Count;
LIBD *m_pBase;
private:
void __fastcall Alloc(void);
void __fastcall Add(LPCSTR pName, HANDLE hLib);
public:
CLIBL(){
m_pBase = NULL;
Delete();
};
~CLIBL(){
Delete();
};
void __fastcall Delete(void);
HANDLE __fastcall LoadLibrary(LPCSTR pName);
void __fastcall DeleteLibrary(HANDLE hLib);
};
#endif