make.allocd 315 B

12345678910
  1. #!/bin/sh
  2. sed -e '
  3. s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\
  4. /* allocation definitions of struct \1 */\
  5. extern char *st_alloc();\
  6. extern struct \1 *h_\1;\
  7. #define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
  8. #define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
  9. :'