mk_task_user.c 568 B

123456789101112131415161718192021222324252627282930
  1. #include <stdio.h>
  2. void print(char *name, char *type, int offset)
  3. {
  4. printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
  5. offset);
  6. }
  7. void print_ptr(char *name, char *type, int offset)
  8. {
  9. printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
  10. offset);
  11. }
  12. void print_head(void)
  13. {
  14. printf("/*\n");
  15. printf(" * Generated by mk_task\n");
  16. printf(" */\n");
  17. printf("\n");
  18. printf("#ifndef __TASK_H\n");
  19. printf("#define __TASK_H\n");
  20. printf("\n");
  21. }
  22. void print_tail(void)
  23. {
  24. printf("\n");
  25. printf("#endif\n");
  26. }