crun 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,282 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!top-level-namespace.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+
36
+
37
+ <span class="title">Top Level Namespace</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Top Level Namespace
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+ <dt class="r1">Includes:</dt>
79
+ <dd class="r1">Como</dd>
80
+
81
+
82
+
83
+
84
+
85
+ </dl>
86
+ <div class="clear"></div>
87
+
88
+ <h2>Defined Under Namespace</h2>
89
+ <p class="children">
90
+
91
+
92
+
93
+
94
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span>
95
+
96
+
97
+ </p>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ <h2>
107
+ Instance Method Summary
108
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
109
+ </h2>
110
+
111
+ <ul class="summary">
112
+
113
+ <li class="public ">
114
+ <span class="summary_signature">
115
+
116
+ <a href="top-level-namespace.html#apply_opt-instance_method" title="#apply_opt (instance method)">- (Object) <strong>apply_opt</strong>(opt) </a>
117
+
118
+
119
+
120
+ </span>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <span class="summary_desc"><div class='inline'>
131
+ <p>Parse and apply option setting.</p>
132
+ </div></span>
133
+
134
+ </li>
135
+
136
+
137
+ <li class="public ">
138
+ <span class="summary_signature">
139
+
140
+ <a href="top-level-namespace.html#crun_exe-instance_method" title="#crun_exe (instance method)">- (Object) <strong>crun_exe</strong>(cmd) </a>
141
+
142
+
143
+
144
+ </span>
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'>
155
+ <p>Execute shell command with optional verbosity.</p>
156
+ </div></span>
157
+
158
+ </li>
159
+
160
+
161
+ </ul>
162
+
163
+
164
+
165
+
166
+
167
+ <div id="instance_method_details" class="method_details_list">
168
+ <h2>Instance Method Details</h2>
169
+
170
+
171
+ <div class="method_details first">
172
+ <h3 class="signature first" id="apply_opt-instance_method">
173
+
174
+ - (<tt>Object</tt>) <strong>apply_opt</strong>(opt)
175
+
176
+
177
+
178
+
179
+
180
+ </h3><div class="docstring">
181
+ <div class="discussion">
182
+
183
+ <p>Parse and apply option setting.</p>
184
+
185
+
186
+ </div>
187
+ </div>
188
+ <div class="tags">
189
+
190
+
191
+ </div><table class="source_code">
192
+ <tr>
193
+ <td>
194
+ <pre class="lines">
195
+
196
+
197
+ 37
198
+ 38
199
+ 39
200
+ 40
201
+ 41
202
+ 42
203
+ 43
204
+ 44
205
+ 45</pre>
206
+ </td>
207
+ <td>
208
+ <pre class="code"><span class="info file"># File 'bin/crun', line 37</span>
209
+
210
+ <span class='kw'>def</span> <span class='id identifier rubyid_apply_opt'>apply_opt</span><span class='lparen'>(</span> <span class='id identifier rubyid_opt'>opt</span> <span class='rparen'>)</span>
211
+ <span class='kw'>if</span> <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:=</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>2</span>
212
+ <span class='id identifier rubyid_parts'>parts</span> <span class='op'>=</span> <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:=</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
213
+ <span class='ivar'>@crun</span><span class='lbracket'>[</span><span class='id identifier rubyid_parts'>parts</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='id identifier rubyid_parts'>parts</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='rbracket'>]</span>
214
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:+</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>2</span>
215
+ <span class='id identifier rubyid_parts'>parts</span> <span class='op'>=</span> <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:+</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
216
+ <span class='ivar'>@crun</span><span class='lbracket'>[</span><span class='id identifier rubyid_parts'>parts</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_parts'>parts</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
217
+ <span class='kw'>end</span>
218
+ <span class='kw'>end</span></pre>
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </div>
223
+
224
+ <div class="method_details ">
225
+ <h3 class="signature " id="crun_exe-instance_method">
226
+
227
+ - (<tt>Object</tt>) <strong>crun_exe</strong>(cmd)
228
+
229
+
230
+
231
+
232
+
233
+ </h3><div class="docstring">
234
+ <div class="discussion">
235
+
236
+ <p>Execute shell command with optional verbosity.</p>
237
+
238
+
239
+ </div>
240
+ </div>
241
+ <div class="tags">
242
+
243
+
244
+ </div><table class="source_code">
245
+ <tr>
246
+ <td>
247
+ <pre class="lines">
248
+
249
+
250
+ 29
251
+ 30
252
+ 31
253
+ 32
254
+ 33
255
+ 34</pre>
256
+ </td>
257
+ <td>
258
+ <pre class="code"><span class="info file"># File 'bin/crun', line 29</span>
259
+
260
+ <span class='kw'>def</span> <span class='id identifier rubyid_crun_exe'>crun_exe</span><span class='lparen'>(</span> <span class='id identifier rubyid_cmd'>cmd</span> <span class='rparen'>)</span>
261
+ <span class='kw'>if</span> <span class='const'>Opt</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>verbose</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_given'>given</span>
262
+ <span class='const'>STDERR</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>crun execution: \&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot; ...</span><span class='tstring_end'>&quot;</span></span>
263
+ <span class='kw'>end</span>
264
+ <span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span> <span class='id identifier rubyid_cmd'>cmd</span> <span class='rparen'>)</span>
265
+ <span class='kw'>end</span></pre>
266
+ </td>
267
+ </tr>
268
+ </table>
269
+ </div>
270
+
271
+ </div>
272
+
273
+ </div>
274
+
275
+ <div id="footer">
276
+ Generated on Sun Dec 25 20:31:45 2016 by
277
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
278
+ 0.8.7.6 (ruby-2.3.1).
279
+ </div>
280
+
281
+ </body>
282
+ </html>
@@ -0,0 +1,2 @@
1
+ @crun['compopts'].push "-O2"
2
+ @crun['progopts'].push "-c 4"
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Options for crun:
3
+ * -crun-compopts:=-O2
4
+ * crun-compopts:+-lm
5
+ * crun-progopts:=-c 12
6
+ */
7
+
8
+ #include <stdio.h>
9
+ #include <stdlib.h>
10
+ #include <string.h>
11
+ #include <math.h>
12
+
13
+ int main( int argc, char** argv )
14
+ {
15
+ char* greeting = "Greetings!\n";
16
+ char* greeting_n = "Greeting #%d!\n";
17
+
18
+ int strlenlog;
19
+ strlenlog = log2( strlen( greeting ) );
20
+
21
+ if ( strlenlog > 10 )
22
+ exit( 1 );
23
+
24
+ int times = 1;
25
+ if ( argc > 1 )
26
+ {
27
+ if ( !strcmp( argv[1], "-c" ) )
28
+ sscanf( argv[2], "%d", &times );
29
+ else
30
+ {
31
+ fprintf( stderr, "Usage: greeting [-c count]\n" );
32
+ exit( 1 );
33
+ }
34
+ }
35
+
36
+ if ( times > 1 )
37
+ {
38
+ for ( int i = 0; i < times; i++ )
39
+ printf( greeting_n, i+1 );
40
+ }
41
+ else
42
+ {
43
+ printf( greeting );
44
+ }
45
+
46
+ return 0;
47
+ }
@@ -0,0 +1,6 @@
1
+ #include <stdio.h>
2
+ int main( int argc, char** argv )
3
+ {
4
+ printf( "Hello World!\n" );
5
+ return 0;
6
+ }
@@ -0,0 +1,9 @@
1
+ #include <stdio.h>
2
+
3
+ int main( int argc, char** argv )
4
+ {
5
+ printf( "Size of int is: %d bytes\n", (int) sizeof(int) );
6
+ printf( "Size of long int is: %d bytes\n", (int) sizeof(long int) );
7
+ printf( "Size of ptr is: %d bytes\n", (int) sizeof(void*) );
8
+ return 0;
9
+ }
@@ -0,0 +1,6 @@
1
+ module Crun
2
+ VERSION = "0.0.1"
3
+ def Crun.version
4
+ Crun::VERSION
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crun
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tero Isannainen
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-12-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: como
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.2.0
30
+ description: ! 'Crun is an utility for compiling and running C-programs straight from
31
+
32
+ C source files. Crun supports compile-run and compile-debug flows.
33
+
34
+
35
+ You can embed custom compile options into the main c-file, if you
36
+
37
+ need, for example, an external library for the program. You can also
38
+
39
+ control the command line parameters passed to the program through
40
+
41
+ Crun.'
42
+ email: tero.isannainen@gmail.com
43
+ executables:
44
+ - crun
45
+ extensions: []
46
+ extra_rdoc_files:
47
+ - README.rdoc
48
+ - CHANGELOG.rdoc
49
+ files:
50
+ - README.rdoc
51
+ - CHANGELOG.rdoc
52
+ - LICENSE
53
+ - lib/version.rb
54
+ - examples/hello.c
55
+ - examples/greeting.c
56
+ - examples/sizeof.c
57
+ - examples/crun_conf.rb
58
+ - doc/top-level-namespace.html
59
+ - doc/js/full_list.js
60
+ - doc/js/app.js
61
+ - doc/js/jquery.js
62
+ - doc/index.html
63
+ - doc/css/common.css
64
+ - doc/css/full_list.css
65
+ - doc/css/style.css
66
+ - doc/Array.html
67
+ - doc/file.README.html
68
+ - doc/method_list.html
69
+ - doc/file_list.html
70
+ - doc/Crun.html
71
+ - doc/class_list.html
72
+ - doc/_index.html
73
+ - doc/file.CHANGELOG.html
74
+ - doc/CrunMod.html
75
+ - doc/frames.html
76
+ - bin/crun
77
+ homepage:
78
+ licenses:
79
+ - Ruby
80
+ post_install_message: Check README...
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: 1.9.3
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 1.8.23
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: Shell env variable management utility.
102
+ test_files: []