hack-package
上传用户:sy_wanhua
上传日期:2013-07-25
资源大小:3048k
文件大小:3k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

C/C++

  1. #!/usr/bin/perl
  2. # ====================================================================
  3. # The Vovida Software License, Version 1.0 
  4. # Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of source code must retain the above copyright
  9. #    notice, this list of conditions and the following disclaimer.
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. #    notice, this list of conditions and the following disclaimer in
  12. #    the documentation and/or other materials provided with the
  13. #    distribution.
  14. # 3. The names "VOCAL", "Vovida Open Communication Application Library",
  15. #    and "Vovida Open Communication Application Library (VOCAL)" must
  16. #    not be used to endorse or promote products derived from this
  17. #    software without prior written permission. For written
  18. #    permission, please contact vocal@vovida.org.
  19. # 4. Products derived from this software may not be called "VOCAL", nor
  20. #    may "VOCAL" appear in their name, without prior written
  21. #    permission of Vovida Networks, Inc.
  22. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
  23. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  24. # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
  25. # NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
  26. # NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
  27. # IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
  28. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  29. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  30. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  31. # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  32. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  33. # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  34. # DAMAGE.
  35. # ====================================================================
  36. # This software consists of voluntary contributions made by Vovida
  37. # Networks, Inc. and many individuals on behalf of Vovida Networks,
  38. # Inc.  For more information on Vovida Networks, Inc., please see
  39. # <http://www.vovida.org/>.
  40. #  $Id: hack-package,v 1.6 2000/08/12 01:25:09 bogawa Exp $
  41. while(<>) {
  42.     chomp;
  43.     if(/BeginPackage/) {
  44. print $_, "n";
  45.     } elsif(/EndPackage/) {
  46. print $_, "n";
  47.     } else {
  48. chomp;
  49. if(!/^s*$/) {
  50.     @a = split(/|/);
  51.     
  52.     # fix parameter 2
  53.     # kill colons, dashes, etc
  54.     $a[2] =~ y/:/ /;
  55.     $a[2] =~ y/-/ /;
  56.     $a[2] =~ s/ ([a-z])/uc($1)/ge;
  57.     $a[2] =~ s/ ([0-9])/_$1/g;
  58.     $a[2] =~ s/ //g;
  59.     
  60.     print "    ", $a[2];
  61.     
  62.     $a[1] =~ s/^s*//;
  63.     $a[1] =~ s/s*$//;
  64.     
  65.     print "t"", $a[1], """;
  66.     print "t";
  67.     if($a[1] =~ /(/) {
  68. print "string";
  69.     } else {
  70. print "void";
  71.     }
  72.     
  73.     print "t";
  74.     if($a[3] =~ /x/) {
  75. print "Yes";
  76.     } else {
  77. print "No";
  78.     }
  79.     print "t";
  80.     if($a[4] =~ /BR/) {
  81. print "BR";
  82.     } elsif ($a[4] =~ /TO/) {
  83. print "TO";
  84.     } elsif ($a[4] =~ /OO/) {
  85. print "OO";
  86.     }
  87.     
  88.     print "n";
  89. }
  90.     }
  91.     
  92. }