File:  [local] / rpl / src / conversion.awk
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Jan 26 15:22:44 2010 UTC (14 years, 3 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Initial revision

    1: BEGIN {
    2:     indicateur = 0;
    3: }
    4: 
    5: /^\/\/ BEGIN C PROTOTYPES/ {
    6:     indicateur = 1;
    7: }
    8: 
    9: /^\/\/ END C PROTOTYPES/ {
   10:     indicateur = 0;
   11: }
   12: 
   13: /^([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]+[ ]+)+/ {
   14:     if (indicateur == 1)
   15:     {
   16:         if ($1 == "unsigned" || $1 == "signed") LIGNE = $3; else LIGNE = $2;
   17:         LIGNE = substr(LIGNE, 1, index(LIGNE, "(") - 1);
   18:         while(substr(LIGNE, 1, 1) == "*")
   19:             LIGNE = substr(LIGNE, 2, length(LIGNE) - 1);
   20:         printf("#define %s librpl_%s\n", LIGNE, LIGNE);
   21:     }
   22: }

CVSweb interface <joel.bertrand@systella.fr>