macro.5.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #silent
  2. s snippets
  3. a=`cat %b`
  4. if [ "$a" = "fori" ]; then
  5. echo "for (i = 0; i _; i++)" > %b
  6. fi
  7. if [ "$a" = "ife" ]; then
  8. cat <<EOF > %b
  9. if ( )
  10. {
  11. }
  12. else
  13. {
  14. }
  15. EOF
  16. fi
  17. if [ "$a" = "GPL" ]; then
  18. cat >>%b <<EOF
  19. /*
  20. * This program is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation; either version 2 of the License, or
  23. * (at your option) any later version.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU General Public License
  31. * along with this program; if not, write to the Free Software
  32. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  33. */
  34. EOF
  35. fi
  36. if [ "$a" = "type" ]; then
  37. cat <<EOF > %b
  38. typedef struct {
  39. ;
  40. } ?;
  41. EOF
  42. fi