Subversion Repositories wimsdev

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #! /bin/sh
  2.  
  3. cat <<@ >colors.c
  4.  
  5.         /* This file is automatically generated! Do not edit it. */
  6.  
  7. struct {
  8.         char *name;
  9.         int r,g,b;
  10. } colors[]={
  11.  
  12. @
  13.  
  14. sort -k 1,1 <colors | awk 'NF==2 {print "       {\""$1"\",      "$2"},"}' >>colors.c
  15.  
  16. cat <<@ >>colors.c
  17. };
  18.  
  19. #define colorno (sizeof(colors)/sizeof(colors[0]))
  20.  
  21. @
  22.  
  23.