home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / ace_gpl_release / src / lib / c / system.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-04  |  1.2 KB  |  48 lines

  1. /*
  2. ** db.lib module: void     SYSTEM command-string
  3. **          short    SYSTEM
  4. ** Copyright (C) 1998 David Benn
  5. ** 
  6. ** This program is free software; you can redistribute it and/or
  7. ** modify it under the terms of the GNU General Public License
  8. ** as published by the Free Software Foundation; either version 2
  9. ** of the License, or (at your option) any later version.
  10. **
  11. ** This program is distributed in the hope that it will be useful,
  12. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ** GNU General Public License for more details.
  15. **
  16. ** You should have received a copy of the GNU General Public License
  17. ** along with this program; if not, write to the Free Software
  18. ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19. **
  20. ** Author: David J Benn
  21. **   Date: 27th December 1993,
  22. **       5th January 1994
  23. */
  24.  
  25. #include <exec/types.h>
  26. #include <exec/execbase.h>
  27. #include <dos/dosextens.h>
  28.  
  29. /* externals */
  30. extern    BPTR     stdout;
  31. extern    struct     ExecBase *AbsExecBase;
  32.  
  33. /* functions */
  34. void system_call(command)
  35. STRPTR command;
  36. {
  37. BPTR out = 0L;
  38.  
  39.   if (stdout) out = stdout;
  40.  
  41.   Execute(command,0L,out);
  42. }
  43.  
  44. SHORT system_version()
  45. {
  46.   return (SHORT)(AbsExecBase->LibNode.lib_Version);
  47. }
  48.