-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathm.c
More file actions
36 lines (28 loc) · 625 Bytes
/
m.c
File metadata and controls
36 lines (28 loc) · 625 Bytes
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
#include <stdio.h>
typedef unsigned short uint16_t;
typedef void (* f_t)(uint16_t);
#include "fundec1.h"
#include "fundec2.h"
#include "fundec3.h"
#include "fundec4.h"
#include "fundec5.h"
#include "fundec6.h"
#include "fundec7.h"
void mc_00_00(uint16_t w) {printf("%.4x\n", w);}
void mc_00_01(uint16_t w) {printf("00 01\n");}
//void mc_12_34(uint16_t w) {printf("12 34\n");}
static f_t fun_arr[65536] = {mc_00_00, mc_00_01, mc_00_02, mc_00_03};
void p(uint16_t w)
{
fun_arr[w](w);
}
int main(int argc, char* argv[])
{
fun_arr[0x3412] = mc_12_34;
p(0);
p(1);
p(3);
p(0x3412);
printf("ok!\n");
return 0;
}