123456789101112131415161718192021222324252627282930 |
- #include <stdio.h>
- void print(char *name, char *type, int offset)
- {
- printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
- offset);
- }
- void print_ptr(char *name, char *type, int offset)
- {
- printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
- offset);
- }
- void print_head(void)
- {
- printf("/*\n");
- printf(" * Generated by mk_task\n");
- printf(" */\n");
- printf("\n");
- printf("#ifndef __TASK_H\n");
- printf("#define __TASK_H\n");
- printf("\n");
- }
- void print_tail(void)
- {
- printf("\n");
- printf("#endif\n");
- }
|