;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\"\210\304\305\307\"\207" [require cc-mode ob org-macs add-to-list org-babel-tangle-lang-exts ("C++" . "cpp") ("D" . "d")] 3) (defvar org-babel-default-header-args:C nil) #@34 C/C++-specific header arguments. (defconst org-babel-header-args:C '((includes . :any) (defines . :any) (main . :any) (flags . :any) (cmdline . :any) (libs . :any)) (#$ . 642)) #@32 C++-specific header arguments. (defconst org-babel-header-args:C++ (append '((namespaces . :any)) org-babel-header-args:C) (#$ . 825)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \210\300\314\302\303\315DD\316\306\307\310\311\312\313& \210\300\317\302\303\320DD\321\306\307\310\311\312\313& \207" [custom-declare-variable org-babel-C-compiler funcall function #[0 "\300\207" [#1="gcc"] 1 #1#] "Command used to compile a C source code file into an executable.\nMay be either a command in the path, like gcc\nor an absolute path name, like /usr/local/bin/gcc\nparameter may be used, like gcc -v" :group org-babel :version "24.3" :type string org-babel-C++-compiler #[0 "\300\207" [#2="g++"] 1 #2#] "Command used to compile a C++ source code file into an executable.\nMay be either a command in the path, like g++\nor an absolute path name, like /usr/local/bin/g++\nparameter may be used, like g++ -v" org-babel-D-compiler #[0 "\300\207" [#3="rdmd"] 1 #3#] "Command used to compile and execute a D source code file.\nMay be either a command in the path, like rdmd\nor an absolute path name, like /usr/local/bin/rdmd\nparameter may be used, like rdmd --chatty"] 10) #@99 Internal variable used to hold which type of C (e.g. C or C++ or D) is currently being evaluated. (defvar org-babel-c-variant nil (#$ . 2013)) #@98 Execute BODY according to PARAMS. This function calls `org-babel-execute:C++'. (fn BODY PARAMS) (defalias 'org-babel-execute:cpp #[514 "\300\"\207" [org-babel-execute:C++] 5 (#$ . 2162)]) #@96 Expand a block of C++ code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-expand-body:cpp #[514 "\300\"\207" [org-babel-expand-body:C++] 5 (#$ . 2359)]) #@121 Execute a block of C++ code with org-babel. This function is called by `org-babel-execute-src-block'. (fn BODY PARAMS) (defalias 'org-babel-execute:C++ #[514 "\301\302\")\207" [org-babel-c-variant cpp org-babel-C-execute] 5 (#$ . 2563)]) #@96 Expand a block of C++ code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-expand-body:C++ #[514 "\301\302\")\207" [org-babel-c-variant cpp org-babel-C-expand-C++] 5 (#$ . 2811)]) #@119 Execute a block of D code with org-babel. This function is called by `org-babel-execute-src-block'. (fn BODY PARAMS) (defalias 'org-babel-execute:D #[514 "\301\302\")\207" [org-babel-c-variant d org-babel-C-execute] 5 (#$ . 3042)]) #@94 Expand a block of D code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-expand-body:D #[514 "\301\302\")\207" [org-babel-c-variant d org-babel-C-expand-D] 5 (#$ . 3284)]) #@119 Execute a block of C code with org-babel. This function is called by `org-babel-execute-src-block'. (fn BODY PARAMS) (defalias 'org-babel-execute:C #[514 "\301\302\")\207" [org-babel-c-variant c org-babel-C-execute] 5 (#$ . 3507)]) #@94 Expand a block of C code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-expand-body:C #[514 "\301\302\")\207" [org-babel-c-variant c org-babel-C-expand-C] 5 (#$ . 3749)]) #@133 This function should only be called by `org-babel-execute:C' or `org-babel-execute:C++' or `org-babel-execute:D'. (fn BODY PARAMS) (defalias 'org-babel-C-execute #[514 "\305\306\307=\203\f\310\202!\311=\203\312\202!\313=\203 \314\202!\315\"\316\305\317 \"!\320\236A\211\2036\321P\2027\322\323\236A\324\325<\203F\202HC\321#\326\327\236A\206X\330\315\331\332#\315\"\324\325<\203e\202gC\321#\307=\203x\333\n\n\"\202\227\311=\203\207\334\n\n\"\202\227\313=\203\226\335\n\n\"\202\227\315\336\337\340!!\341\342\343\344\345!\346\"\347$\216r\211q\210c\210)r\211q\210\350\315\211\315\342%\210*\266\351>\203\361\352\353\354\307=\203\324\n\202\337\311=\203\336 \202\337\315 \316!&\322\"\210\202\363\210\352\355>\203P\202\313=\203\353\356\f\316! %\202\315\322\"\211\205\323\357!\262\360\361\f\236A\362\235?\205\254\363\235\204r\364\235\204r\365\235\204r\366\235\204r\367\235\204r\370\235\204r\371\235\204l\372\235\204l\373\235\204l\374\235\203y\375\235\204y\326\332\"\202\254\305\376!\211\336\337\340!!\341\342\343\344\345!\377\"\347$\216r\211q\210c\210)r\211q\210\350\315\211\315\342%\210*\266\201@!\262\262\201A\201B\236A\201C\236A\"\201A\201D\236A\201E\236A\"#\262\207" [org-babel-c-variant org-babel-exeext org-babel-C-compiler org-babel-C++-compiler org-babel-D-compiler org-babel-temp-file "C-src-" c ".c" cpp ".cpp" d ".d" nil org-babel-process-file-name "C-bin-" :cmdline " " "" :flags mapconcat identity org-babel-read :libs org-entry-get "libs" t org-babel-C-expand-C org-babel-C-expand-C++ org-babel-C-expand-D get-buffer-create generate-new-buffer-name " *temp file*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 write-region (cpp c) org-babel-eval format "%s -o %s %s %s %s" (cpp c) "%s %s %s %s" org-remove-indentation org-babel-reassemble-table :result-params "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" "c-" [buffer-name kill-buffer] org-babel-import-elisp-from-file org-babel-pick-name :colname-names :colnames :rowname-names :rownames] 23 (#$ . 3972)]) #@101 Expand a block of C or C++ code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-C-expand-C++ #[514 "\300\"\207" [org-babel-C-expand-C] 5 (#$ . 6171)]) #@101 Expand a block of C or C++ code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-C-expand-C #[514 "\300!\301\236A\302\236A\303\230?\304\305\236A\306\"\304\307\236A\306\"\304\310\236A\306\";\203/\311!\262\211;\2039\311!\262;\203m\306\312C\311!\211\203f\211@\204T\211\262\202_\313QC\244\210\306\262A\266\202\202D\210\211A\262\266\314\315\314\316\317#\314\320<\203\202\202\205C\317#\314\321\317#\314\322\f\317#\314\323 \317# \205\240\324 \314\325\326\327\330\331!\332\"\333\334%\317#\f\203\276\335!\202\300\317\257 \317#\207" [org-babel--get-vars :colname-names :main "no" org-babel-read :includes nil :defines :namespaces split-string t " " mapconcat identity #[257 "\2119\203\n\300!\262\301\302\"\203\303\304\"\207\303\305\"\207" [symbol-name string-prefix-p "<" format "#include %s" "#include \"%s\""] 4 "\n\n(fn INC)"] "\n" #[257 "\300\301\"\207" [format "#define %s"] 4 "\n\n(fn INC)"] #[257 "\300\301\"\207" [format "using namespace %s;"] 4 "\n\n(fn INC)"] org-babel-C-var-to-C org-babel-C-table-sizes-to-C org-babel-C-utility-header-to-C make-byte-code 257 "\211@\300@@\232\204\211\203\211A\262\202\211\262@A\301!\302\"\207" vconcat vector [org-babel-C-val-to-base-type org-babel-C-header-to-C] 7 "\n\n(fn HEAD)" org-babel-C-ensure-main-wrap] 23 (#$ . 6372)]) #@94 Expand a block of D code with org-babel according to its header arguments. (fn BODY PARAMS) (defalias 'org-babel-C-expand-D #[514 "\300!\301\236A\302\236A\303\230?\304\236A\206\305\306\307\310\311#!\211;\203&\312!\262\313\314\"\262\315\316\317\315\320\321#\315\322 \321#\315\323\n\321#\205G\324 \315\325\326\327\330\331!\332\"\333\334% \321# \203e\335!\202g \321\257\321#\207" [org-babel--get-vars :colname-names :main "no" :imports org-babel-read org-entry-get nil "imports" t split-string append ("std.stdio" "std.conv") mapconcat identity "module mmm;" #[257 "\300\301\"\207" [format "import %s;"] 4 "\n\n(fn INC)"] "\n" org-babel-C-var-to-C org-babel-C-table-sizes-to-C org-babel-C-utility-header-to-C make-byte-code 257 "\211@\300@@\232\204\211\203\211A\262\202\211\262@A\301!\302\"\207" vconcat vector [org-babel-C-val-to-base-type org-babel-C-header-to-C] 7 "\n\n(fn HEAD)" org-babel-C-ensure-main-wrap] 20 (#$ . 7763)]) #@64 Wrap BODY in a "main" function call if none exists. (fn BODY) (defalias 'org-babel-C-ensure-main-wrap #[257 "\300\301\"\203\207\302\303\"\207" [string-match "^[ ]*[intvod]+[ \n ]*main[ ]*(.*)" format "int main() {\n%s\nreturn 0;\n}\n"] 4 (#$ . 8739)]) #@107 This function does nothing as C is a compiled language with no support for sessions. (fn SESSION PARAMS) (defalias 'org-babel-prep-session:C #[514 "\300\301!\207" [error "C is a compiled language -- no support for sessions"] 4 (#$ . 9006)]) #@112 This function does nothing as C is a compiled language with no support for sessions. (fn SESSION BODY PARAMS) (defalias 'org-babel-load-session:C #[771 "\300\301!\207" [error "C is a compiled language -- no support for sessions"] 5 (#$ . 9255)]) #@71 Handle the FORMAT part of TYPE with the data from VAL. (fn TYPE VAL) (defalias 'org-babel-C-format-val #[514 "A@\211;\203\300\301\"B\202\211!\207" ["" format] 7 (#$ . 9508)]) #@192 Determine the type of VAL. Return a list (TYPE-NAME FORMAT). TYPE-NAME should be the name of the type. FORMAT can be either a format string or a function which is called with VAL. (fn VAL) (defalias 'org-babel-C-val-to-C-type #[257 "\301!\211\302=\203 \303\2021\211\304=\203\305\2021\211\306=\203-\307=\203'\310\202(\311\312D\2021\313\314\"\250\203:\211\202\252\304!\203D\211\202\252<\203}@<\203}\211@\315\316\317\320\321\322\323\315\324\321\325\323\315\326\327A@\330BBE\331BB\332BBBE\333BB\334BBBEED\202\252<\204\210\335!\203\251\211@\315\336\317\337\321\340\323\315\341\327 A@\342BBE\343BB\344BBBEED\202\252\211\207" [org-babel-c-variant org-babel-C-val-to-base-type integerp ("int" "%d") floatp ("double" "%f") stringp d "string" "const char*" "\"%s\"" error "unknown type %S" lambda (val) cons (pcase org-babel-c-variant ((or `c `cpp) (format "[%d][%d]" (length val) (length (car val)))) (`d (format "[%d][%d]" (length (car val)) (length val)))) concat (if (eq org-babel-c-variant 'd) "[\n" "{\n") mapconcat (v) (if (eq org-babel-c-variant 'd) " [" " {") (w) format (w) (v ",") ((if (eq org-babel-c-variant 'd) "]" "}")) (val ",\n") ((if (eq org-babel-c-variant 'd) "\n]" "\n}")) vectorp (val) (format "[%d]" (length val)) (if (eq org-babel-c-variant 'd) "[" "{") (v) (v) (val ",") ((if (eq org-babel-c-variant 'd) "]" "}"))] 21 (#$ . 9699)]) #@186 Determine the base type of VAL which may be `integerp' if all base values are integers `floatp' if all base values are either floating points or integers `stringp' otherwise. (fn VAL) (defalias 'org-babel-C-val-to-base-type #[257 "\211\250\203\300\207\301!\203\301\207\211<\204\302!\2030\303C\304\305\306\307\310\311!\312\"\313\314%\"\210\211\242\207\315\207" [integerp floatp vectorp nil mapc make-byte-code 257 "\301!\211\302=\203\300\302\240\202:\211\303=\203'\300\242\203!\300\242\304=\205:\300\303\240\202:\211\304=\2039\300\242?\205:\300\304\240\202:\305\207" vconcat vector [org-babel-C-val-to-base-type stringp floatp integerp nil] 4 "\n\n(fn V)" stringp] 9 (#$ . 11086)]) #@93 Convert an elisp val into a string of C code specifying a var of the same value. (fn PAIR) (defalias 'org-babel-C-var-to-C #[257 "\211@A\2119\203\301!\262\211G\302U\203\303!\262\304!\211@\305\"\211@A\306>\2038\307\310 %\202J\311=\203I\307\312\n%\202J\313\266\205\207" [org-babel-c-variant symbol-name 1 string-to-char org-babel-C-val-to-C-type org-babel-C-format-val (cpp c) format "%s %s%s = %s;" d "%s%s %s = %s;" nil] 14 (#$ . 11797)]) #@70 Create constants of table dimensions, if PAIR is a table. (fn PAIR) (defalias 'org-babel-C-table-sizes-to-C #[257 "\211A<\205)\211A@<\203!\300\301@AG#\302\300\303@A@G#Q\207\300\303@AG#\207" [format "const int %s_rows = %d;" "\n" "const int %s_cols = %d;"] 7 (#$ . 12270)]) #@76 Generate a utility function to convert a column name into a column number. (defalias 'org-babel-C-utility-header-to-C #[0 "\301>\203\302\207\303=\203\304\207\305\207" [org-babel-c-variant (cpp c) "\n#ifndef _STRING_H\n#include \n#endif\nint get_column_num (int nbcols, const char** header, const char* column)\n{\n int c;\n for (c=0; c\203-\311\202<\312=\2037\313\202<\314\202<\314\315>\203Q\316\317G\320\321\322#$\202g\312=\203f\316\323G\320\324\322#$\202g\314\325\326>\203~\316\327\211G\n&\202\220\312=\203\217\316\330\211\211%\202\220\314Q\207" [org-babel-c-variant message "%S" integerp "int" floatp "double" stringp (cpp c) "const char*" d "string" nil (cpp c) format "const char* %s_header[%d] = {%s};" mapconcat #[257 "\300\301\"\207" [format "\"%s\""] 4 "\n\n(fn H)"] "," "string[%d] %s_header = [%s];" #[257 "\300\301\"\207" [format "\"%s\""] 4 "\n\n(fn H)"] "\n" (cpp c) "%s %s_h (int row, const char* col) { return %s[row][get_column_num(%d,%s_header,col)]; }" "%s %s_h (size_t row, string col) { return %s[row][get_column_num(%s_header,col)]; }"] 14 (#$ . 13178)]) (provide 'ob-C)