Function: org-babel-C-ensure-main-wrap

org-babel-C-ensure-main-wrap is a byte-compiled function defined in ob-C.el.gz.

Signature

(org-babel-C-ensure-main-wrap BODY)

Documentation

Wrap BODY in a "main" function call if none exists.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-C.el.gz
(defun org-babel-C-ensure-main-wrap (body)
  "Wrap BODY in a \"main\" function call if none exists."
  (if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body)
      body
    (format "int main() {\n%s\nreturn 0;\n}\n" body)))