-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgroup__ExtendingClingo.html
485 lines (459 loc) · 28.4 KB
/
group__ExtendingClingo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Clingo C API: Extending Clingo</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="clingo.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Clingo C API
</div>
<div id="projectbrief">C API for clingo providing high level functions to control grounding and solving.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Extending Clingo</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions to customize clingo's main function. </p>
<p>This module allows for customizing the clingo application. For example, this can be used to register custom propagators and command line options with clingo.</p>
<p>Warning: This part of the API is not yet finalized and might change in the future. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structclingo__application.html">clingo_application</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This struct contains a set of functions to customize the clingo application. <a href="structclingo__application.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structclingo__script.html">clingo_script</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Custom scripting language to run functions during grounding. <a href="structclingo__script.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga2b159cfef1bc326a9e25617095be39cf"><td class="memItemLeft" align="right" valign="top"><a id="ga2b159cfef1bc326a9e25617095be39cf"></a>
typedef struct clingo_options </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga2b159cfef1bc326a9e25617095be39cf">clingo_options_t</a></td></tr>
<tr class="memdesc:ga2b159cfef1bc326a9e25617095be39cf"><td class="mdescLeft"> </td><td class="mdescRight">Object to add command-line options. <br /></td></tr>
<tr class="separator:ga2b159cfef1bc326a9e25617095be39cf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4526c69810a4d334b1df9d9f36fc97d9"><td class="memItemLeft" align="right" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga4526c69810a4d334b1df9d9f36fc97d9">clingo_main_function_t</a>) (<a class="el" href="group__Control.html#gaf008e9db9dbb37b0b7ef039bb9d582f0">clingo_control_t</a> *control, char const *const *files, size_t size, void *data)</td></tr>
<tr class="memdesc:ga4526c69810a4d334b1df9d9f36fc97d9"><td class="mdescLeft"> </td><td class="mdescRight">Callback to customize clingo main function. <a href="group__ExtendingClingo.html#ga4526c69810a4d334b1df9d9f36fc97d9">More...</a><br /></td></tr>
<tr class="separator:ga4526c69810a4d334b1df9d9f36fc97d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga28813b724b16c0261abbef7459284d14"><td class="memItemLeft" align="right" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga28813b724b16c0261abbef7459284d14">clingo_default_model_printer_t</a>) (void *data)</td></tr>
<tr class="memdesc:ga28813b724b16c0261abbef7459284d14"><td class="mdescLeft"> </td><td class="mdescRight">Callback to print a model in default format. <a href="group__ExtendingClingo.html#ga28813b724b16c0261abbef7459284d14">More...</a><br /></td></tr>
<tr class="separator:ga28813b724b16c0261abbef7459284d14"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7e8435c4f6707cabea49f800eaff21f4"><td class="memItemLeft" align="right" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga7e8435c4f6707cabea49f800eaff21f4">clingo_model_printer_t</a>) (<a class="el" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> const *model, <a class="el" href="group__ExtendingClingo.html#ga28813b724b16c0261abbef7459284d14">clingo_default_model_printer_t</a> printer, void *printer_data, void *data)</td></tr>
<tr class="memdesc:ga7e8435c4f6707cabea49f800eaff21f4"><td class="mdescLeft"> </td><td class="mdescRight">Callback to customize model printing. <a href="group__ExtendingClingo.html#ga7e8435c4f6707cabea49f800eaff21f4">More...</a><br /></td></tr>
<tr class="separator:ga7e8435c4f6707cabea49f800eaff21f4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae7c48dd1214af43e005947beea794df7"><td class="memItemLeft" align="right" valign="top"><a id="gae7c48dd1214af43e005947beea794df7"></a>
typedef struct <a class="el" href="structclingo__application.html">clingo_application</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#gae7c48dd1214af43e005947beea794df7">clingo_application_t</a></td></tr>
<tr class="memdesc:gae7c48dd1214af43e005947beea794df7"><td class="mdescLeft"> </td><td class="mdescRight">This struct contains a set of functions to customize the clingo application. <br /></td></tr>
<tr class="separator:gae7c48dd1214af43e005947beea794df7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga12291b8ae5e5c67fe89d9a091b634e1b"><td class="memItemLeft" align="right" valign="top"><a id="ga12291b8ae5e5c67fe89d9a091b634e1b"></a>
typedef struct <a class="el" href="structclingo__script.html">clingo_script</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga12291b8ae5e5c67fe89d9a091b634e1b">clingo_script_t</a></td></tr>
<tr class="memdesc:ga12291b8ae5e5c67fe89d9a091b634e1b"><td class="mdescLeft"> </td><td class="mdescRight">Custom scripting language to run functions during grounding. <br /></td></tr>
<tr class="separator:ga12291b8ae5e5c67fe89d9a091b634e1b"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad2404aa611652a0f16624bd97066a6fa"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#gad2404aa611652a0f16624bd97066a6fa">clingo_options_add</a> (<a class="el" href="group__ExtendingClingo.html#ga2b159cfef1bc326a9e25617095be39cf">clingo_options_t</a> *options, char const *group, char const *option, char const *description, bool(*parse)(char const *value, void *data), void *data, bool multi, char const *argument)</td></tr>
<tr class="memdesc:gad2404aa611652a0f16624bd97066a6fa"><td class="mdescLeft"> </td><td class="mdescRight">Add an option that is processed with a custom parser. <a href="group__ExtendingClingo.html#gad2404aa611652a0f16624bd97066a6fa">More...</a><br /></td></tr>
<tr class="separator:gad2404aa611652a0f16624bd97066a6fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga5a8f9d9f28293cfde4a350b97f7b5674"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga5a8f9d9f28293cfde4a350b97f7b5674">clingo_options_add_flag</a> (<a class="el" href="group__ExtendingClingo.html#ga2b159cfef1bc326a9e25617095be39cf">clingo_options_t</a> *options, char const *group, char const *option, char const *description, bool *target)</td></tr>
<tr class="memdesc:ga5a8f9d9f28293cfde4a350b97f7b5674"><td class="mdescLeft"> </td><td class="mdescRight">Add an option that is a simple flag. <a href="group__ExtendingClingo.html#ga5a8f9d9f28293cfde4a350b97f7b5674">More...</a><br /></td></tr>
<tr class="separator:ga5a8f9d9f28293cfde4a350b97f7b5674"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8a8f258e5484315d8f86d4832df41d67"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga8a8f258e5484315d8f86d4832df41d67">clingo_main</a> (<a class="el" href="group__ExtendingClingo.html#gae7c48dd1214af43e005947beea794df7">clingo_application_t</a> *application, char const *const *arguments, size_t size, void *data)</td></tr>
<tr class="memdesc:ga8a8f258e5484315d8f86d4832df41d67"><td class="mdescLeft"> </td><td class="mdescRight">Run clingo with a customized main function (similar to python and lua embedding). <a href="group__ExtendingClingo.html#ga8a8f258e5484315d8f86d4832df41d67">More...</a><br /></td></tr>
<tr class="separator:ga8a8f258e5484315d8f86d4832df41d67"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac8fca4dd38b81cbc278de25962f4d8be"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#gac8fca4dd38b81cbc278de25962f4d8be">clingo_register_script</a> (char const *name, <a class="el" href="group__ExtendingClingo.html#ga12291b8ae5e5c67fe89d9a091b634e1b">clingo_script_t</a> const *script, void *data)</td></tr>
<tr class="memdesc:gac8fca4dd38b81cbc278de25962f4d8be"><td class="mdescLeft"> </td><td class="mdescRight">Add a custom scripting language to clingo. <a href="group__ExtendingClingo.html#gac8fca4dd38b81cbc278de25962f4d8be">More...</a><br /></td></tr>
<tr class="separator:gac8fca4dd38b81cbc278de25962f4d8be"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga02b77c193881686ead8313c182f0668d"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__ExtendingClingo.html#ga02b77c193881686ead8313c182f0668d">clingo_script_version</a> (char const *name)</td></tr>
<tr class="memdesc:ga02b77c193881686ead8313c182f0668d"><td class="mdescLeft"> </td><td class="mdescRight">Get the version of the registered scripting language. <a href="group__ExtendingClingo.html#ga02b77c193881686ead8313c182f0668d">More...</a><br /></td></tr>
<tr class="separator:ga02b77c193881686ead8313c182f0668d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga28813b724b16c0261abbef7459284d14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga28813b724b16c0261abbef7459284d14">◆ </a></span>clingo_default_model_printer_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef bool(* clingo_default_model_printer_t) (void *data)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback to print a model in default format. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data for the callback</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
</div>
</div>
<a id="ga4526c69810a4d334b1df9d9f36fc97d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4526c69810a4d334b1df9d9f36fc97d9">◆ </a></span>clingo_main_function_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef bool(* clingo_main_function_t) (<a class="el" href="group__Control.html#gaf008e9db9dbb37b0b7ef039bb9d582f0">clingo_control_t</a> *control, char const *const *files, size_t size, void *data)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback to customize clingo main function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">control</td><td>corresponding control object </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">files</td><td>files passed via command line arguments </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>number of files </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data for the callback</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
</div>
</div>
<a id="ga7e8435c4f6707cabea49f800eaff21f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e8435c4f6707cabea49f800eaff21f4">◆ </a></span>clingo_model_printer_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef bool(* clingo_model_printer_t) (<a class="el" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> const *model, <a class="el" href="group__ExtendingClingo.html#ga28813b724b16c0261abbef7459284d14">clingo_default_model_printer_t</a> printer, void *printer_data, void *data)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback to customize model printing. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">model</td><td>the model </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">printer</td><td>the default model printer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">printer_data</td><td>user data for the printer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data for the callback</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga8a8f258e5484315d8f86d4832df41d67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a8f258e5484315d8f86d4832df41d67">◆ </a></span>clingo_main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT int clingo_main </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__ExtendingClingo.html#gae7c48dd1214af43e005947beea794df7">clingo_application_t</a> * </td>
<td class="paramname"><em>application</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const *const * </td>
<td class="paramname"><em>arguments</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>data</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Run clingo with a customized main function (similar to python and lua embedding). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">application</td><td>struct with callbacks to override default clingo functionality </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">arguments</td><td>command line arguments </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>number of arguments </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data to pass to callbacks in application </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>exit code to return from main function </dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a11">application.c</a>.</dd>
</dl>
</div>
</div>
<a id="gad2404aa611652a0f16624bd97066a6fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad2404aa611652a0f16624bd97066a6fa">◆ </a></span>clingo_options_add()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_options_add </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__ExtendingClingo.html#ga2b159cfef1bc326a9e25617095be39cf">clingo_options_t</a> * </td>
<td class="paramname"><em>options</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>group</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>option</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>description</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool(*)(char const *value, void *data) </td>
<td class="paramname"><em>parse</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>multi</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>argument</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add an option that is processed with a custom parser. </p>
<p>Note that the parser also has to take care of storing the semantic value of the option somewhere.</p>
<p>Parameter option specifies the name(s) of the option. For example, "ping,p" adds the short option "-p" and its long form "--ping". It is also possible to associate an option with a help level by adding ",@l" to the option specification. Options with a level greater than zero are only shown if the argument to help is greater or equal to l.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">options</td><td>object to register the option with </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">group</td><td>options are grouped into sections as given by this string </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">option</td><td>specifies the command line option </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>the description of the option </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">parse</td><td>callback to parse the value of the option </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data for the callback </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">multi</td><td>whether the option can appear multiple times on the command-line </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">argument</td><td>optional string to change the value name in the generated help output </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a6">application.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga5a8f9d9f28293cfde4a350b97f7b5674"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5a8f9d9f28293cfde4a350b97f7b5674">◆ </a></span>clingo_options_add_flag()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_options_add_flag </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__ExtendingClingo.html#ga2b159cfef1bc326a9e25617095be39cf">clingo_options_t</a> * </td>
<td class="paramname"><em>options</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>group</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>option</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>description</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool * </td>
<td class="paramname"><em>target</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add an option that is a simple flag. </p>
<p>This function is similar to <a class="el" href="group__ExtendingClingo.html#gad2404aa611652a0f16624bd97066a6fa">clingo_options_add()</a> but simpler because it only supports flags, which do not have values. If a flag is passed via the command-line the parameter target is set to true.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">options</td><td>object to register the option with </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">group</td><td>options are grouped into sections as given by this string </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">option</td><td>specifies the command line option </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>the description of the option </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>boolean set to true if the flag is given on the command-line </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
</div>
</div>
<a id="gac8fca4dd38b81cbc278de25962f4d8be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac8fca4dd38b81cbc278de25962f4d8be">◆ </a></span>clingo_register_script()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_register_script </td>
<td>(</td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__ExtendingClingo.html#ga12291b8ae5e5c67fe89d9a091b634e1b">clingo_script_t</a> const * </td>
<td class="paramname"><em>script</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>data</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a custom scripting language to clingo. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>the name of the scripting language </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">script</td><td>struct with functions implementing the language </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data to pass to callbacks in the script </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful </dd></dl>
</div>
</div>
<a id="ga02b77c193881686ead8313c182f0668d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga02b77c193881686ead8313c182f0668d">◆ </a></span>clingo_script_version()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT const char* clingo_script_version </td>
<td>(</td>
<td class="paramtype">char const * </td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the version of the registered scripting language. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>the name of the scripting language </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the version </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 16 2022 19:52:36 for Clingo C API by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>