macro.5.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 3 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, see <http://www.gnu.org/licenses/>.
  32. */
  33. EOF
  34. fi
  35. if [ "$a" = "type" ]; then
  36. cat <<EOF > %b
  37. typedef struct {
  38. ;
  39. } ?;
  40. EOF
  41. fi