org-babel-c: new header argument ":main no" allows inhibiting main wrap

This commit is contained in:
Eric Schulte 2010-04-10 15:54:40 -06:00
parent 99a07f1d4a
commit 7cbb35920d
1 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,7 @@ called by `org-babel-execute-src-block'."
(cmdline (cdr (assoc :cmdline params)))
(flags (cdr (assoc :flags params)))
(vars (second processed-params))
(main-p (not (string= (cdr (assoc :main params)) "no")))
(includes (or (cdr (assoc :includes params))
(org-entry-get nil "includes" t)))
(defines (org-babel-read
@ -95,7 +96,9 @@ called by `org-babel-execute-src-block'."
;; variables
(mapconcat 'org-babel-C-var-to-C vars "\n")
;; body
"\n" (org-babel-C-ensure-main-wrap body) "\n") "\n"))
"\n" (if main-p
(org-babel-C-ensure-main-wrap body)
body) "\n") "\n"))
(error-buf (get-buffer-create "*Org-Babel Error Output*"))
(compile
(progn