]> git.donarmstrong.com Git - lilypond.git/blob - scm/lily.scm
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scm / lily.scm
1 ;;;; lily.scm -- toplevel Scheme stuff
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 ;; Internationalisation: (_i "to be translated") gets an entry in the
9 ;; POT file (gettext ) must be invoked explicitely to do the actual
10 ;; "translation".
11 ;;(define-macro (_i x) x)
12 ;;(define-macro-public _i (x) x)
13 ;;(define-public-macro _i (x) x)
14 ;; Abbrv-PWR!
15 (defmacro-public _i (x) x)
16
17 (read-enable 'positions)
18 (debug-enable 'debug)
19
20
21 (define (define-scheme-options)
22   (for-each (lambda (x)
23               (ly:add-option (car x) (cadr x) (caddr x)))
24           
25             `(
26
27               ;; NAMING: either
28
29               ;; - [subject-]object-object-verb +"ing"
30               ;; - [subject-]-verb-object-object
31
32               (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
33               (check-internal-types #f "check every property assignment for types")
34               (clip-systems #f "Generate cut-out snippets of a score")
35               (debug-gc #f "dump memory debugging statistics")
36               (debug-gc-assert-parsed-dead #f "for memory debugging:
37 ensure that all refs to parsed objects are dead.  This is an internal option, and is switched on automatically for -ddebug-gc.") 
38               (debug-lexer #f "debug the flex lexer")
39               (debug-parser #f "debug the bison parser")
40               (debug-skylines #f "debug skylines")
41               (delete-intermediate-files #f
42                                          "delete unusable PostScript files")
43               (dump-profile #f "dump timing information for each file")
44               (dump-signatures #f "dump output signatures of each system.  Used for regression testing.")
45               
46               (eps-box-padding #f "Pad EPS bounding box left edge.  Guarantee alignment between systems in LaTeX.")
47               (gs-load-fonts #f
48                             "load fonts via Ghostscript.")
49               (gui #f "running from gui; redirect stderr to log file")
50
51               (include-book-title-preview #t "include book-titles in preview images.")
52               (include-eps-fonts #t "Include fonts in separate-system EPS files.")
53               (job-count #f "Process in parallel") 
54               (log-file #f "redirect output to log FILE.log")
55
56               (old-relative #f
57                             "relative for simultaneous music works
58 similar to chord syntax")
59               (point-and-click #t "use point & click")
60               (paper-size "a4" "the default paper size")
61               (pixmap-format "png16m" "GS format to use for pixel images")
62               (protected-scheme-parsing #t "continue when finding errors in inline
63 scheme are caught in the parser. If off, halt 
64 on errors, and print a stack trace.")
65               (profile-property-accesses #f "keep statistics of get_property() calls.")
66               
67               (resolution 101 "resolution for generating PNG bitmaps")
68               (read-file-list #f "Read files to be processed from command line arguments")
69
70               (safe #f "Run safely")
71               (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
72               (separate-log-files #f "Output to FILE.log per file.")
73               (ttf-verbosity 0
74                              "how much verbosity for TTF font embedding?")
75               (show-available-fonts #f
76                                     "List font names available.")
77               (verbose ,(ly:command-line-verbose?) "value for the --verbose flag")
78               ))
79
80   (map
81    (lambda (x)
82      (ly:set-option (car x) (cdr x))) 
83    (eval-string (ly:command-line-options))))
84
85
86 ;; need to do this in the beginning. Other parts of the
87 ;; Scheme init depend on these options.
88 ;;
89 (define-scheme-options)
90
91
92
93 (debug-set! stack 0)
94
95 (if (defined? 'set-debug-cell-accesses!)
96     (set-debug-cell-accesses! #f))
97
98                                         ;(set-debug-cell-accesses! 1000)
99
100 (use-modules (ice-9 regex)
101              (ice-9 safe)
102              (ice-9 rdelim)
103              (ice-9 optargs)
104              (oop goops)
105              (srfi srfi-1)
106              (srfi srfi-13)
107              (srfi srfi-14)
108              (scm clip-region)
109              )
110
111 ;; my display
112 (define-public (myd k v) (display k) (display ": ") (display v) (display ", ")
113   v)
114
115 (define-public (print . args)
116   (apply format (cons (current-output-port) args)))
117
118
119 ;;; General settings
120 ;;; debugging evaluator is slower.  This should
121 ;;; have a more sensible default.
122
123 (if (ly:get-option 'verbose)
124     (begin
125       (ly:set-option 'protected-scheme-parsing #f)
126       (debug-enable 'debug)
127       (debug-enable 'backtrace)
128       (read-enable 'positions)))
129
130 (define-public tex-backend?
131   (member (ly:output-backend) '("texstr" "tex")))
132
133 (define-public parser #f)
134
135 (define-public (lilypond-version)
136   (string-join
137    (map (lambda (x) (if (symbol? x)
138                         (symbol->string x)
139                         (number->string x)))
140         (ly:version))
141    "."))
142
143
144 ;; TeX C++ code actually hooks into TEX_STRING_HASHLIMIT 
145 (define-public TEX_STRING_HASHLIMIT 10000000)
146
147
148
149 ;; gettext wrapper for guile < 1.7.2
150 (if (defined? 'gettext)
151     (define-public _ gettext)
152     (define-public _ ly:gettext))
153
154 (define-public (ly:load x)
155   (let* ((file-name (%search-load-path x)))
156     (if (ly:get-option 'verbose)
157         (ly:progress "[~A" file-name))
158     (if (not file-name)
159         (ly:error (_ "cannot find: ~A") x))
160     (primitive-load file-name)
161     (if (ly:get-option 'verbose)
162         (ly:progress "]"))))
163
164 ;; Cygwin
165 ;; #(CYGWIN_NT-5.1 Hostname 1.5.12(0.116/4/2) 2004-11-10 08:34 i686)
166 ;;
167 ;; Debian
168 ;; #(Linux hostname 2.4.27-1-686 #1 Fri Sep 3 06:28:00 UTC 2004 i686)
169 ;;
170 ;; Mingw
171 ;; #(Windows XP HOSTNAME build 2600 5.01 Service Pack 1 i686)
172 ;;
173
174 ;; ugh, code dup.
175 (define-public PLATFORM
176   (string->symbol
177    (string-downcase
178     (car (string-tokenize (vector-ref (uname) 0) char-set:letter)))))
179
180 (define-public DOS
181   (let ((platform (string-tokenize
182                    (vector-ref (uname) 0) char-set:letter+digit)))
183     (if (null? (cdr platform)) #f
184         (member (string-downcase (cadr platform)) '("95" "98" "me")))))
185
186 (case PLATFORM
187   ((windows)
188    (define native-getcwd getcwd)
189    (define (slashify x)
190      (if (string-index x #\\)
191          x
192          (string-regexp-substitute
193           "//*" "/"
194           (string-regexp-substitute "\\\\" "/" x))))
195    ;; FIXME: this prints a warning.
196    (define-public (ly-getcwd)
197      (slashify (native-getcwd))))
198   (else (define-public ly-getcwd getcwd)))
199
200 (define-public (is-absolute? file-name)
201   (let ((file-name-length (string-length file-name)))
202     (if (= file-name-length 0)
203         #f
204         (or (eq? (string-ref file-name 0) #\/)
205             (and (eq? PLATFORM 'windows)
206                  (> file-name-length 2)
207                  (eq? (string-ref file-name 1) #\:)
208                  (eq? (string-ref file-name 2) #\/))))))
209
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
211
212 (define (type-check-list location signature arguments)
213   "Typecheck a list of arguments against a list of type
214 predicates. Print a message at LOCATION if any predicate failed."
215
216   (define (recursion-helper signature arguments count) 
217     (define (helper pred? arg count) 
218       (if (not (pred? arg))
219
220           (begin
221             (ly:input-message
222              location
223              (format
224               #f (_ "wrong type for argument ~a.  Expecting ~a, found ~s")
225               count (type-name pred?) arg))
226             #f)
227           #t))
228
229     (if (null? signature)
230         #t
231         (and (helper (car signature) (car arguments) count)
232              (recursion-helper (cdr signature) (cdr arguments) (1+ count)))))
233
234   (recursion-helper signature arguments 1))
235
236 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
237 ;;  output
238
239
240 ;;(define-public (output-framework) (write "hello\n"))
241
242 (define output-tex-module
243   (make-module 1021 (list (resolve-interface '(scm output-tex)))))
244 (define output-ps-module
245   (make-module 1021 (list (resolve-interface '(scm output-ps)))))
246
247 (define-public (ps-output-expression expr port)
248   (display (eval expr output-ps-module) port))
249
250 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
251 ;; Safe definitions utility
252 (define safe-objects (list))
253
254 (define-macro (define-safe-public arglist . body)
255   "Define a variable, export it, and mark it as safe, ie usable in LilyPond safe mode.
256 The syntax is the same as `define*-public'."
257   (define (get-symbol arg)
258     (if (pair? arg)
259         (get-symbol (car arg))
260         arg))
261   (let ((safe-symbol (get-symbol arglist)))
262     `(begin
263        (define*-public ,arglist
264          ,@body)
265        (set! safe-objects (cons (cons ',safe-symbol ,safe-symbol)
266                                 safe-objects))
267        ,safe-symbol)))
268
269 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
270 ;; init pitch system
271
272 (ly:set-default-scale (ly:make-scale #(0 1 2 5/2 7/2 9/2 11/2)))
273
274
275
276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
277 ;; other files.
278
279
280 (define
281   init-scheme-files
282   '("lily-library.scm"
283             "file-cache.scm"
284             "define-event-classes.scm"
285             "define-music-types.scm"
286             "output-lib.scm"
287             "c++.scm"
288             "chord-ignatzek-names.scm"
289             "chord-entry.scm"
290             "chord-generic-names.scm"
291             "stencil.scm"
292             "markup.scm"
293             "music-functions.scm"
294             "part-combiner.scm"
295             "autochange.scm"
296             "define-music-properties.scm"
297             "auto-beam.scm"
298             "chord-name.scm"
299
300             "parser-ly-from-scheme.scm"
301             "ly-syntax-constructors.scm"
302             
303             "define-context-properties.scm"
304             "translation-functions.scm"
305             "script.scm"
306             "midi.scm"
307             "layout-beam.scm"
308             "parser-clef.scm"
309             "layout-slur.scm"
310             "font.scm"
311             "encoding.scm"
312             
313             "fret-diagrams.scm"
314             "define-markup-commands.scm"
315             "define-grob-properties.scm"
316             "define-grobs.scm"
317             "define-grob-interfaces.scm"
318             "define-stencil-commands.scm"
319             "titling.scm"
320             
321             "paper.scm"
322             "backend-library.scm"
323             "x11-color.scm"
324
325             ;; must be after everything has been defined
326             "safe-lily.scm"))
327
328
329
330
331 (for-each ly:load init-scheme-files)
332
333
334 (set! type-p-name-alist
335       `(
336         (,boolean-or-symbol? . "boolean or symbol")
337         (,boolean? . "boolean")
338         (,char? . "char")
339         (,grob-list? . "list of grobs")
340         (,hash-table? . "hash table")
341         (,input-port? . "input port")
342         (,integer? . "integer")
343         (,list? . "list")
344         (,ly:context? . "context")
345         (,ly:dimension? . "dimension, in staff space")
346         (,ly:dir? . "direction")
347         (,ly:duration? . "duration")
348         (,ly:grob? . "layout object")
349         (,ly:input-location? . "input location")
350         (,ly:moment? . "moment")
351         (,ly:music? . "music")
352         (,ly:pitch? . "pitch")
353         (,ly:translator? . "translator")
354         (,ly:font-metric? . "font metric")
355         (,ly:simple-closure? . "simple closure")
356         (,markup-list? . "list of markups")
357         (,markup? . "markup")
358         (,ly:music-list? . "list of music")
359         (,number-or-grob? . "number or grob")
360         (,number-or-string? . "number or string")
361         (,number-pair? . "pair of numbers")
362         (,number? . "number")
363         (,output-port? . "output port")   
364         (,pair? . "pair")
365         (,procedure? . "procedure")
366         (,rhythmic-location? . "rhythmic location")
367         (,scheme? . "any type")
368         (,string? . "string")
369         (,symbol? . "symbol")
370         (,vector? . "vector")))
371
372 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
373 ;; timing
374
375 (define (profile-measurements)
376   (let* ((t (times))
377          (stats (gc-stats)))
378     
379     (list
380      (- (+ (tms:cutime t)
381            (tms:utime t))
382         (ly:assoc-get 'gc-time-taken stats))
383      
384      (ly:assoc-get 'total-cells-allocated  stats 0)
385      )))
386
387 (define (dump-profile base last this)
388   (let*
389       ((outname (format "~a.profile" (basename base ".ly")))
390        (diff (map (lambda (y) (apply - y)) (zip this last))))
391     
392     (ly:progress "\nWriting timing to ~a..." outname)
393     (format (open-file outname "w")
394             "time: ~a\ncells: ~a\n"
395             (car diff)
396             (cadr diff)
397             )))
398
399
400 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
401 ;; debug mem leaks
402
403 (define gc-dumping #f)
404 (define gc-protect-stat-count 0)
405
406 (define-public (dump-live-object-stats outfile)
407   (for-each
408    (lambda (x)
409      (format outfile "~a: ~a\n" (car x) (cdr x)))
410    (sort (gc-live-object-stats)
411          (lambda (x y)
412            (string<? (car x) (car y))))))
413
414 (define-public (dump-gc-protects)
415   (set! gc-protect-stat-count (1+ gc-protect-stat-count))
416   (let* ((protects (sort
417                     (hash-table->alist (ly:protects))
418                     (lambda (a b)
419                       (< (object-address (car a))
420                          (object-address (car b))))))
421
422          (out-file-name (string-append
423                          "gcstat-" (number->string gc-protect-stat-count)
424                          ".scm"))
425          (outfile    (open-file  out-file-name  "w")))
426
427     (set! gc-dumping #t)
428     (display (format "Dumping GC statistics ~a...\n" out-file-name))
429     (display
430      (map (lambda (y)
431             (let ((x (car y))
432                   (c (cdr y)))
433               (display 
434                (format "~a (~a) = ~a\n" (object-address x) c x)
435                outfile)))
436           (filter
437            (lambda (x)
438              (not (symbol? (car x))))
439            protects))
440      outfile)
441
442     (format outfile "\nprotected symbols: ~a\n"
443             (length (filter symbol?  (map car protects))))
444     
445              
446
447     ;; (display (ly:smob-protects))
448     (newline outfile)
449     (if (defined? 'gc-live-object-stats)
450         (let* ((stats #f))
451           (display "Live object statistics: GC'ing\n")
452           (ly:reset-all-fonts)
453           (gc)
454           (gc)
455           (display "Asserting dead objects\n")
456           (ly:set-option 'debug-gc-assert-parsed-dead #t)
457           (gc)
458           (ly:set-option 'debug-gc-assert-parsed-dead #f)
459
460           (set! stats (gc-live-object-stats))
461           (display "Dumping live object statistics.\n")
462           (dump-live-object-stats outfile)))
463
464     (newline outfile)
465     (let*
466         ((stats (gc-stats)))
467       
468       (for-each
469        (lambda (sym)
470          (display
471           (format "~a ~a ~a\n"
472                   gc-protect-stat-count
473                   sym
474                   (let ((sym-stat (assoc sym stats)))
475                     (if sym-stat 
476                         (cdr sym-stat)
477                         "?")))
478           outfile))
479        '(protected-objects bytes-malloced cell-heap-size
480                            
481                            )))
482
483     (set! gc-dumping #f)
484     (close-port outfile)
485     
486     ))
487
488
489 (define (check-memory)
490   "read /proc/self to check up on memory use." 
491   (define (gulp-file name)
492     (let* ((file (open-input-file name))
493            (text (read-delimited "" file)))
494       (close file)
495       text))
496   (let*
497       ((stat (gulp-file "/proc/self/status"))
498        (lines (string-split stat #\newline))
499        (interesting (filter identity
500                             (map
501                              (lambda (l)
502                                (string-match "^VmData:[ \t]*([0-9]*) kB" l))
503                              lines)))
504        (mem (string->number (match:substring (car interesting) 1)))
505        )
506
507     
508     (display (format  "VMDATA: ~a\n" mem))
509     (display (gc-stats))
510     (if (> mem 100000)
511         (begin
512           (dump-gc-protects)
513           (raise 1)))
514     
515     ))
516
517 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
518
519
520 (define (multi-fork count)
521   (define (helper count acc)
522     (if (> count 0)
523       (let*
524           ((pid  (primitive-fork)))
525         (if (= pid 0)
526             (1- count)
527             (helper (1- count) (cons pid acc))))
528       acc))
529   (helper count '()))
530
531
532 (define-public (lilypond-main files)
533   "Entry point for LilyPond."
534
535   (define (no-files-handler)
536     (ly:usage)
537     (exit 2))
538
539   (eval-string (ly:command-line-code))
540   
541   (if (ly:get-option 'gui)
542       (gui-main files))
543
544   (if (null? files)
545       (no-files-handler))
546
547   (if (ly:get-option 'read-file-list)
548       (set! files
549             (filter (lambda (s)
550                       (> (string-length s) 0))
551                     (apply append
552                            (map (lambda (f) (string-split (ly:gulp-file f) #\nl))
553                                 files)))
554             ))
555   
556   (if (and (number? (ly:get-option 'job-count))
557            (>= (length files) (ly:get-option 'job-count)))
558       
559       (let*
560           ((count (ly:get-option 'job-count))
561            (split-todo (split-list files count)) 
562            (joblist (multi-fork count))
563            (errors '()))
564
565         (if (not (string-or-symbol? (ly:get-option 'log-file)))
566             (ly:set-option 'log-file "lilypond-multi-run"))
567         
568         (if (number? joblist)
569             (begin
570               (ly:set-option 'log-file (format "~a-~a"
571                                                (ly:get-option 'log-file) joblist))
572               (set! files (vector-ref split-todo joblist)))
573
574             (begin
575               (ly:progress "\nForking into jobs:  ~a\n" joblist)
576               (for-each
577                (lambda (pid)
578                  (let* ((stat (cdr (waitpid pid))))
579                    
580                    (if (not (= stat 0))
581                        (set! errors (acons (list-element-index joblist pid) stat errors)))))
582                joblist)
583
584               (for-each
585                (lambda (x)
586                  (let* ((job (car x))
587                         (state (cdr x))
588                         (logfile  (format "~a-~a.log"
589                                           (ly:get-option 'log-file) job))
590                         (log (ly:gulp-file logfile))
591                         (len (string-length log))
592                         (tail (substring  log (max 0 (- len 1024)))))
593
594                    (if (status:term-sig state)
595                        (ly:message "\n\n~a\n"
596                                    (format (_ "job ~a terminated with signal: ~a")
597                                            job
598                                            (status:term-sig state)))
599                        (ly:message (_ "logfile ~a (exit ~a):\n~a") logfile (status:exit-val state) tail))))
600
601                errors)
602
603               (if (pair? errors)
604                   (ly:error "Children ~a exited with errors." (map car errors)))
605
606               ;; must overwrite individual entries
607               (if (ly:get-option 'dump-profile)
608                   (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
609
610             (exit (if (null? errors) 0 1))))))
611               
612            
613   (if (string-or-symbol? (ly:get-option 'log-file))
614       (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w"))
615
616   
617   (let ((failed (lilypond-all files)))
618     (if (pair? failed)
619         (begin
620           (ly:error (_ "failed files: ~S") (string-join failed))
621           (exit 1))
622         (begin
623           ;; HACK: be sure to exit with single newline
624           (ly:message "")
625           (exit 0)))))
626
627 (define-public (lilypond-all files)
628   
629
630   (if (ly:get-option 'show-available-fonts)
631       (begin
632         (ly:font-config-display-fonts)
633         (exit 0)
634         ))
635   
636   (let* ((failed '())
637          (separate-logs (ly:get-option 'separate-log-files))
638          (do-measurements (ly:get-option 'dump-profile))
639          (handler (lambda (key failed-file)
640                     (set! failed (append (list failed-file) failed)))))
641
642     (gc)
643     (for-each
644      (lambda (x)
645        (let*
646            ((start-measurements (if do-measurements
647                                     (profile-measurements)
648                                     #f))
649             (base (basename x ".ly"))
650             (all-settings (ly:all-options)))
651
652          (if separate-logs
653              (ly:stderr-redirect (format "~a.log" base) "w"))
654        
655          (lilypond-file handler x)
656          (if start-measurements
657              (dump-profile x start-measurements (profile-measurements)))
658        
659          (for-each
660           (lambda (s)
661             (ly:set-option (car s) (cdr s)))
662           all-settings)
663
664          (ly:clear-anonymous-modules)
665          (ly:set-option 'debug-gc-assert-parsed-dead #t)
666          (gc)
667          (ly:set-option 'debug-gc-assert-parsed-dead #f)
668
669          
670          (if (ly:get-option 'debug-gc)
671              (dump-gc-protects)
672              (if (= (random 40) 1)
673                  (ly:reset-all-fonts)))))
674
675      files)
676
677     ;; we want the failed-files notice in the aggregrate logfile.
678     (if (ly:get-option 'separate-logs)
679         (ly:stderr-redirect
680          (if (string-or-symbol? (ly:get-option 'log-file))
681              (format "~a.log" (ly:get-option 'log-file))
682              "/dev/tty") "a"))
683
684     (if (ly:get-option 'dump-profile)
685         (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
686
687     failed))
688
689 (define (lilypond-file handler file-name)
690   (catch 'ly-file-failed
691          (lambda () (ly:parse-file file-name))
692          (lambda (x . args) (handler x file-name))))
693
694 (use-modules (scm editor))
695
696 (define-public (gui-main files)
697   (if (null? files)
698       (gui-no-files-handler))
699
700   (if (not (string? (ly:get-option 'log-file)))
701       (let* ((base (basename (car files) ".ly"))
702              (log-name (string-append base ".log")))
703         (if (not (ly:get-option 'gui))
704             (ly:message (_ "Redirecting output to ~a...") log-name))
705         (ly:stderr-redirect log-name "w")
706         (ly:message "# -*-compilation-*-"))
707     
708     (let ((failed (lilypond-all files)))
709       (if (pair? failed)
710           (begin
711             ;; ugh
712             (ly:stderr-redirect "foo" "r")
713             (system (get-editor-command log-name 0 0 0))
714             (ly:error (_ "failed files: ~S") (string-join failed))
715             ;; not reached?
716             (exit 1))
717           (exit 0)))))
718
719 (define (gui-no-files-handler)
720   (let* ((ly (string-append (ly:effective-prefix) "/ly/"))
721          ;; FIXME: soft-code, localize
722          (welcome-ly (string-append ly "Welcome_to_LilyPond.ly"))
723          (cmd (get-editor-command welcome-ly 0 0 0)))
724     (ly:message (_ "Invoking `~a'...") cmd)
725     (system cmd)
726     (exit 1)))