File: biewutil.h

package info (click to toggle)
biew 5.6.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,004 kB
  • ctags: 7,157
  • sloc: ansic: 50,860; asm: 809; makefile: 396; pascal: 371
file content (170 lines) | stat: -rw-r--r-- 6,448 bytes parent folder | download | duplicates (2)
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
/**
 * @namespace   biew
 * @file        biewutil.h
 * @brief       This file contains prototypes of BIEW utilities.
 * @version     -
 * @remark      this source file is part of Binary vIEW project (BIEW).
 *              The Binary vIEW (BIEW) is copyright (C) 1995 Nick Kurshev.
 *              All rights reserved. This software is redistributable under the
 *              licence given in the file "Licence.en" ("Licence.ru" in russian
 *              translation) distributed in the BIEW archive.
 * @note        Requires POSIX compatible development system
 *
 * @author      Nick Kurshev
 * @since       1995
 * @note        Development, fixes and improvements
**/
#ifndef __BIEWUTIL__H
#define __BIEWUTIL__H

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __TWIN_H
#include "biewlib/twin.h"
#endif

#ifndef __BBIO_H
#include "biewlib/bbio.h"
#endif

#ifndef __FILE_INI_RUNTIME_SUPPORT_SYSTEM__
#include "biewlib/file_ini.h"
#endif

extern char legalchars[];
extern unsigned long headshift;
extern tBool DumpMode;
extern tBool EditMode;

extern unsigned long lastbyte;
extern char * ini_name;

extern int   __FASTCALL__ GetBool(tBool _bool);
extern void **            FAllocPtrPtr(unsigned num);
extern void *             FAllocPtr(unsigned size);
extern void               FFreeArr(void **arr,unsigned n);
extern void               CriticalExit(int code);

extern void               init_addons(void);
extern void               term_addons(void);
extern void               SelectTool( void );
extern void               init_sysinfo( void );
extern void               term_sysinfo( void );
extern void               SelectSysInfo( void );
                          /** return True if LastOpenFile == Current open file */
extern tBool              isValidIniArgs( void );

extern tBool              NewSource( void );
extern tBool              FileUtils( void );
extern unsigned long      IsNewExe(void);

extern char * __FASTCALL__ Get2Digit(tUInt8);
extern char * __FASTCALL__ Get2SignDig(tInt8);
extern char * __FASTCALL__ Get4Digit(tUInt16);
extern char * __FASTCALL__ Get4SignDig(tInt16);
extern char * __FASTCALL__ Get8Digit(tUInt32);
extern char * __FASTCALL__ Get8SignDig(tInt32);
#ifdef INT64_C
extern char * __FASTCALL__ Get16Digit(tUInt64);
extern char * __FASTCALL__ Get16SignDig(tInt64);
#else
extern char * __FASTCALL__ Get16Digit(tUInt32 low,tUInt32 high);
extern char * __FASTCALL__ Get16SignDig(tInt32 low,tInt32 high);
#endif
extern char * __FASTCALL__ GetBinary(char val);

extern int      __FASTCALL__ ExpandHex(char * dest,const unsigned char * src,int size,char hard);
extern void     __FASTCALL__ CompressHex(unsigned char * dest,const char * src,int sizedest,tBool usespace);
extern unsigned __FASTCALL__ Summ(unsigned char *array,unsigned size);

extern void   ExtHelp(void);
extern void   drawEditPrompt( void );
extern void   drawEmptyPrompt( void );
extern void   drawEmptyListPrompt( void );
extern void   drawAsmEdPrompt( void );
extern int    EditAsmActionFromMenu( void );
extern void   drawListPrompt( void );
extern void   drawOrdListPrompt( void );
extern void   drawSearchListPrompt( void );
extern void   drawHelpPrompt( void );
extern int    HelpActionFromMenu( void );
extern void   drawHelpListPrompt( void );
extern void   drawPrompt( void );
extern int    MainActionFromMenu(void);
extern void   About( void );

extern unsigned long __FASTCALL__ WhereAMI(unsigned long ctrl_pos);

#define RAPREF_NONE            0 /**< means reference is not appended */
#define RAPREF_DONE    ULONG_MAX /**< means reference is appended */

                   /** Appends disassembler reference to string.
                     * @param str          string buffer for append to
                     * @param ulShift      physical address of field, that required of binding
                     * @param mode         see reg_form.h for detail
                     * @param codelen      length of field, that required binding
                     * @param r_shift      used only if APPREF_TRY_LABEL mode is set, contains real value of field, that required binding
                     * @return             one of RAPREF_* constants or physical
                                           offset of target which is applied to
                                           fixing field.
                    **/
extern unsigned long __FASTCALL__ AppendAsmRef(char *str,unsigned long ulShift,
                                               int mode,char codelen,
                                               unsigned long r_shift);


extern void  ShowSysInfo( void );
extern void  PaintTitle( void );
extern void  MainLoop( void );

extern int  __FASTCALL__ isHOnLine(unsigned long cp,int width);

#define HLS_NORMAL               0x0000
#define HLS_USE_DOUBLE_WIDTH     0x0001
#define HLS_USE_BUFFER_AS_VIDEO  0x0002

typedef union tag_HLInfo
{
  const char     *text;
  tvioBuff        buff;
}HLInfo;

extern void __FASTCALL__ HiLightSearch(TWindow *out,unsigned long cfp,tRelCoord minx,
                          tRelCoord maxx,tRelCoord y,HLInfo *buff,unsigned flags);

/** Class memory array */

typedef struct tag_memArray
{
  void **  data;
  unsigned nItems;
  unsigned nSize;
}memArray;

extern memArray *__FASTCALL__ ma_Build( int maxitems, tBool interact );
extern tBool     __FASTCALL__ ma_AddString(memArray *obj,const char *data,tBool interact);
extern tBool     __FASTCALL__ ma_AddData(memArray *obj,const void *data,unsigned size,tBool interact);
extern void      __FASTCALL__ ma_Destroy(memArray *obj);
extern int       __FASTCALL__ ma_Display(memArray *obj,const char *title,int flg,unsigned defsel);

extern unsigned __FASTCALL__ biewReadProfileString(hIniProfile *ini,
                                      const char *section,
                                      const char *subsection,
                                      const char *_item,
                                      const char *def_value,
                                      char *buffer,
                                      unsigned cbBuffer);

extern tBool __FASTCALL__ biewWriteProfileString(hIniProfile *ini,
                                                 const char *section,
                                                 const char *subsection,
                                                 const char *item,
                                                 const char *value);

#ifdef __cplusplus
}
#endif

#endif