luci-base: add luci.sys.net.host_hints() and regenerate documentation
[project/luci.git] / documentation / api / modules / luci.model.uci.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5 <title>Reference</title>
6 <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7 <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
8 </head>
9
10 <body>
11 <div id="container">
12
13 <div id="product">
14 <div id="product_logo"></div>
15 <div id="product_name"><big><b></b></big></div>
16 <div id="product_description"></div>
17 </div> <!-- id="product" -->
18
19 <div id="main">
20
21 <div id="navigation">
22
23
24 <h1>LuaDoc</h1>
25 <ul>
26
27 <li><a href="../index.html">Index</a></li>
28
29 </ul>
30
31
32 <!-- Module list -->
33
34 <h1>Modules</h1>
35 <ul>
36
37 <li>
38 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
39 </li>
40
41 <li>
42 <a href="../modules/luci.http.html">luci.http</a>
43 </li>
44
45 <li>
46 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
47 </li>
48
49 <li>
50 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
51 </li>
52
53 <li>
54 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
55 </li>
56
57 <li>
58 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
59 </li>
60
61 <li>
62 <a href="../modules/luci.i18n.html">luci.i18n</a>
63 </li>
64
65 <li>
66 <a href="../modules/luci.ip.html">luci.ip</a>
67 </li>
68
69 <li>
70 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
71 </li>
72
73 <li>
74 <a href="../modules/luci.json.html">luci.json</a>
75 </li>
76
77 <li>
78 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
79 </li>
80
81 <li>
82 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
83 </li>
84
85 <li>
86 <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
87 </li>
88
89 <li><strong>luci.model.uci</strong></li>
90
91 <li>
92 <a href="../modules/luci.rpcc.html">luci.rpcc</a>
93 </li>
94
95 <li>
96 <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
97 </li>
98
99 <li>
100 <a href="../modules/luci.sys.html">luci.sys</a>
101 </li>
102
103 <li>
104 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
105 </li>
106
107 <li>
108 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
109 </li>
110
111 <li>
112 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
113 </li>
114
115 <li>
116 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
117 </li>
118
119 <li>
120 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
121 </li>
122
123 <li>
124 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
125 </li>
126
127 <li>
128 <a href="../modules/luci.util.html">luci.util</a>
129 </li>
130
131 <li>
132 <a href="../modules/nixio.html">nixio</a>
133 </li>
134
135 <li>
136 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
137 </li>
138
139 <li>
140 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
141 </li>
142
143 <li>
144 <a href="../modules/nixio.File.html">nixio.File</a>
145 </li>
146
147 <li>
148 <a href="../modules/nixio.README.html">nixio.README</a>
149 </li>
150
151 <li>
152 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
153 </li>
154
155 <li>
156 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
157 </li>
158
159 <li>
160 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
161 </li>
162
163 <li>
164 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
165 </li>
166
167 <li>
168 <a href="../modules/nixio.bin.html">nixio.bin</a>
169 </li>
170
171 <li>
172 <a href="../modules/nixio.bit.html">nixio.bit</a>
173 </li>
174
175 <li>
176 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
177 </li>
178
179 <li>
180 <a href="../modules/nixio.fs.html">nixio.fs</a>
181 </li>
182
183 </ul>
184
185
186
187 <!-- File list -->
188
189
190
191
192
193
194
195 </div><!-- id="navigation" -->
196
197 <div id="content">
198
199 <h1>Object Instance <code>luci.model.uci</code></h1>
200
201 <p></p>
202
203
204
205
206
207
208
209 <h2>Functions</h2>
210 <table class="function_list">
211
212 <tr>
213 <td class="name" nowrap><a href="#Cursor.add">Cursor:add</a>&nbsp;(config, type)</td>
214 <td class="summary">
215
216 Add an anonymous section.</td>
217 </tr>
218
219 <tr>
220 <td class="name" nowrap><a href="#Cursor.apply">Cursor:apply</a>&nbsp;(configlist, command)</td>
221 <td class="summary">
222
223 Applies UCI configuration changes
224 </td>
225 </tr>
226
227 <tr>
228 <td class="name" nowrap><a href="#Cursor.changes">Cursor:changes</a>&nbsp;(config)</td>
229 <td class="summary">
230
231 Get a table of saved but uncommitted changes.</td>
232 </tr>
233
234 <tr>
235 <td class="name" nowrap><a href="#Cursor.commit">Cursor:commit</a>&nbsp;(config)</td>
236 <td class="summary">
237
238 Commit saved changes.</td>
239 </tr>
240
241 <tr>
242 <td class="name" nowrap><a href="#Cursor.delete">Cursor:delete</a>&nbsp;(config, section, option)</td>
243 <td class="summary">
244
245 Deletes a section or an option.</td>
246 </tr>
247
248 <tr>
249 <td class="name" nowrap><a href="#Cursor.delete_all">Cursor:delete_all</a>&nbsp;(config, type, comparator)</td>
250 <td class="summary">
251
252 Delete all sections of a given type that match certain criteria.</td>
253 </tr>
254
255 <tr>
256 <td class="name" nowrap><a href="#Cursor.foreach">Cursor:foreach</a>&nbsp;(config, type, callback)</td>
257 <td class="summary">
258
259 Call a function for every section of a certain type.</td>
260 </tr>
261
262 <tr>
263 <td class="name" nowrap><a href="#Cursor.get">Cursor:get</a>&nbsp;(config, section, option)</td>
264 <td class="summary">
265
266 Get a section type or an option
267 </td>
268 </tr>
269
270 <tr>
271 <td class="name" nowrap><a href="#Cursor.get_all">Cursor:get_all</a>&nbsp;(config, section)</td>
272 <td class="summary">
273
274 Get all sections of a config or all values of a section.</td>
275 </tr>
276
277 <tr>
278 <td class="name" nowrap><a href="#Cursor.get_bool">Cursor:get_bool</a>&nbsp;(config, section, option)</td>
279 <td class="summary">
280
281 Get a boolean option and return it's value as true or false.</td>
282 </tr>
283
284 <tr>
285 <td class="name" nowrap><a href="#Cursor.get_confdir">Cursor:get_confdir</a>&nbsp;()</td>
286 <td class="summary">
287
288 Get the configuration directory.</td>
289 </tr>
290
291 <tr>
292 <td class="name" nowrap><a href="#Cursor.get_first">Cursor:get_first</a>&nbsp;(config, type, option, default)</td>
293 <td class="summary">
294
295 Get the given option from the first section with the given type.</td>
296 </tr>
297
298 <tr>
299 <td class="name" nowrap><a href="#Cursor.get_list">Cursor:get_list</a>&nbsp;(config, section, option)</td>
300 <td class="summary">
301
302 Get an option or list and return values as table.</td>
303 </tr>
304
305 <tr>
306 <td class="name" nowrap><a href="#Cursor.get_savedir">Cursor:get_savedir</a>&nbsp;()</td>
307 <td class="summary">
308
309 Get the directory for uncomitted changes.</td>
310 </tr>
311
312 <tr>
313 <td class="name" nowrap><a href="#Cursor.load">Cursor:load</a>&nbsp;(config)</td>
314 <td class="summary">
315
316 Manually load a config.</td>
317 </tr>
318
319 <tr>
320 <td class="name" nowrap><a href="#Cursor.revert">Cursor:revert</a>&nbsp;(config)</td>
321 <td class="summary">
322
323 Revert saved but uncommitted changes.</td>
324 </tr>
325
326 <tr>
327 <td class="name" nowrap><a href="#Cursor.save">Cursor:save</a>&nbsp;(config)</td>
328 <td class="summary">
329
330 Saves changes made to a config to make them committable.</td>
331 </tr>
332
333 <tr>
334 <td class="name" nowrap><a href="#Cursor.section">Cursor:section</a>&nbsp;(config, type, name, values)</td>
335 <td class="summary">
336
337 Create a new section and initialize it with data.</td>
338 </tr>
339
340 <tr>
341 <td class="name" nowrap><a href="#Cursor.set">Cursor:set</a>&nbsp;(config, section, option, value)</td>
342 <td class="summary">
343
344 Set a value or create a named section.</td>
345 </tr>
346
347 <tr>
348 <td class="name" nowrap><a href="#Cursor.set_confdir">Cursor:set_confdir</a>&nbsp;(directory)</td>
349 <td class="summary">
350
351 Set the configuration directory.</td>
352 </tr>
353
354 <tr>
355 <td class="name" nowrap><a href="#Cursor.set_list">Cursor:set_list</a>&nbsp;(config, section, option, value)</td>
356 <td class="summary">
357
358 Set given values as list.</td>
359 </tr>
360
361 <tr>
362 <td class="name" nowrap><a href="#Cursor.set_savedir">Cursor:set_savedir</a>&nbsp;(directory)</td>
363 <td class="summary">
364
365 Set the directory for uncommited changes.</td>
366 </tr>
367
368 <tr>
369 <td class="name" nowrap><a href="#Cursor.substate">Cursor:substate</a>&nbsp;()</td>
370 <td class="summary">
371
372 Create a sub-state of this cursor.</td>
373 </tr>
374
375 <tr>
376 <td class="name" nowrap><a href="#Cursor.tset">Cursor:tset</a>&nbsp;(config, section, values)</td>
377 <td class="summary">
378
379 Updated the data of a section using data from a table.</td>
380 </tr>
381
382 <tr>
383 <td class="name" nowrap><a href="#Cursor.unload">Cursor:unload</a>&nbsp;(config)</td>
384 <td class="summary">
385
386 Discard changes made to a config.</td>
387 </tr>
388
389 <tr>
390 <td class="name" nowrap><a href="#cursor">cursor</a>&nbsp;()</td>
391 <td class="summary">
392
393 Create a new UCI-Cursor.</td>
394 </tr>
395
396 <tr>
397 <td class="name" nowrap><a href="#cursor_state">cursor_state</a>&nbsp;()</td>
398 <td class="summary">
399
400 Create a new Cursor initialized to the state directory.</td>
401 </tr>
402
403 </table>
404
405
406
407
408
409
410 <br/>
411 <br/>
412
413
414 <h2><a name="functions"></a>Functions</h2>
415 <dl class="function">
416
417
418
419 <dt><a name="Cursor.add"></a><strong>Cursor:add</strong>&nbsp;(config, type)</dt>
420 <dd>
421
422
423 Add an anonymous section.
424
425
426
427 <h3>Parameters</h3>
428 <ul>
429
430 <li>
431 config: UCI config
432 </li>
433
434 <li>
435 type: UCI section type
436 </li>
437
438 </ul>
439
440
441
442
443
444
445 <h3>Return value:</h3>
446 Name of created section
447
448
449
450 </dd>
451
452
453
454
455 <dt><a name="Cursor.apply"></a><strong>Cursor:apply</strong>&nbsp;(configlist, command)</dt>
456 <dd>
457
458
459 Applies UCI configuration changes
460
461
462
463 <h3>Parameters</h3>
464 <ul>
465
466 <li>
467 configlist: List of UCI configurations
468 </li>
469
470 <li>
471 command: Don't apply only return the command
472 </li>
473
474 </ul>
475
476
477
478
479
480
481
482
483 </dd>
484
485
486
487
488 <dt><a name="Cursor.changes"></a><strong>Cursor:changes</strong>&nbsp;(config)</dt>
489 <dd>
490
491
492 Get a table of saved but uncommitted changes.
493
494
495
496 <h3>Parameters</h3>
497 <ul>
498
499 <li>
500 config: UCI config
501 </li>
502
503 </ul>
504
505
506
507
508
509
510 <h3>Return value:</h3>
511 Table of changes
512
513
514
515 <h3>See also:</h3>
516 <ul>
517
518 <li><a href="#Cursor.save">
519 Cursor:save
520 </a>
521
522 </ul>
523
524 </dd>
525
526
527
528
529 <dt><a name="Cursor.commit"></a><strong>Cursor:commit</strong>&nbsp;(config)</dt>
530 <dd>
531
532
533 Commit saved changes.
534
535
536
537 <h3>Parameters</h3>
538 <ul>
539
540 <li>
541 config: UCI config
542 </li>
543
544 </ul>
545
546
547
548
549
550
551 <h3>Return value:</h3>
552 Boolean whether operation succeeded
553
554
555
556 <h3>See also:</h3>
557 <ul>
558
559 <li><a href="#Cursor.revert">
560 Cursor:revert
561 </a>
562
563 <li><a href="#Cursor.save">
564 Cursor:save
565 </a>
566
567 </ul>
568
569 </dd>
570
571
572
573
574 <dt><a name="Cursor.delete"></a><strong>Cursor:delete</strong>&nbsp;(config, section, option)</dt>
575 <dd>
576
577
578 Deletes a section or an option.
579
580
581
582 <h3>Parameters</h3>
583 <ul>
584
585 <li>
586 config: UCI config
587 </li>
588
589 <li>
590 section: UCI section name
591 </li>
592
593 <li>
594 option: UCI option (optional)
595 </li>
596
597 </ul>
598
599
600
601
602
603
604 <h3>Return value:</h3>
605 Boolean whether operation succeeded
606
607
608
609 </dd>
610
611
612
613
614 <dt><a name="Cursor.delete_all"></a><strong>Cursor:delete_all</strong>&nbsp;(config, type, comparator)</dt>
615 <dd>
616
617
618 Delete all sections of a given type that match certain criteria.
619
620
621
622 <h3>Parameters</h3>
623 <ul>
624
625 <li>
626 config: UCI config
627 </li>
628
629 <li>
630 type: UCI section type
631 </li>
632
633 <li>
634 comparator: Function that will be called for each section and
635 returns a boolean whether to delete the current section (optional)
636 </li>
637
638 </ul>
639
640
641
642
643
644
645
646
647 </dd>
648
649
650
651
652 <dt><a name="Cursor.foreach"></a><strong>Cursor:foreach</strong>&nbsp;(config, type, callback)</dt>
653 <dd>
654
655
656 Call a function for every section of a certain type.
657
658
659
660 <h3>Parameters</h3>
661 <ul>
662
663 <li>
664 config: UCI config
665 </li>
666
667 <li>
668 type: UCI section type
669 </li>
670
671 <li>
672 callback: Function to be called
673 </li>
674
675 </ul>
676
677
678
679
680
681
682 <h3>Return value:</h3>
683 Boolean whether operation succeeded
684
685
686
687 </dd>
688
689
690
691
692 <dt><a name="Cursor.get"></a><strong>Cursor:get</strong>&nbsp;(config, section, option)</dt>
693 <dd>
694
695
696 Get a section type or an option
697
698
699
700 <h3>Parameters</h3>
701 <ul>
702
703 <li>
704 config: UCI config
705 </li>
706
707 <li>
708 section: UCI section name
709 </li>
710
711 <li>
712 option: UCI option (optional)
713 </li>
714
715 </ul>
716
717
718
719
720
721
722 <h3>Return value:</h3>
723 UCI value
724
725
726
727 </dd>
728
729
730
731
732 <dt><a name="Cursor.get_all"></a><strong>Cursor:get_all</strong>&nbsp;(config, section)</dt>
733 <dd>
734
735
736 Get all sections of a config or all values of a section.
737
738
739
740 <h3>Parameters</h3>
741 <ul>
742
743 <li>
744 config: UCI config
745 </li>
746
747 <li>
748 section: UCI section name (optional)
749 </li>
750
751 </ul>
752
753
754
755
756
757
758 <h3>Return value:</h3>
759 Table of UCI sections or table of UCI values
760
761
762
763 </dd>
764
765
766
767
768 <dt><a name="Cursor.get_bool"></a><strong>Cursor:get_bool</strong>&nbsp;(config, section, option)</dt>
769 <dd>
770
771
772 Get a boolean option and return it's value as true or false.
773
774
775
776 <h3>Parameters</h3>
777 <ul>
778
779 <li>
780 config: UCI config
781 </li>
782
783 <li>
784 section: UCI section name
785 </li>
786
787 <li>
788 option: UCI option
789 </li>
790
791 </ul>
792
793
794
795
796
797
798 <h3>Return value:</h3>
799 Boolean
800
801
802
803 </dd>
804
805
806
807
808 <dt><a name="Cursor.get_confdir"></a><strong>Cursor:get_confdir</strong>&nbsp;()</dt>
809 <dd>
810
811
812 Get the configuration directory.
813
814
815
816
817
818
819
820
821 <h3>Return value:</h3>
822 Configuration directory
823
824
825
826 </dd>
827
828
829
830
831 <dt><a name="Cursor.get_first"></a><strong>Cursor:get_first</strong>&nbsp;(config, type, option, default)</dt>
832 <dd>
833
834
835 Get the given option from the first section with the given type.
836
837
838
839 <h3>Parameters</h3>
840 <ul>
841
842 <li>
843 config: UCI config
844 </li>
845
846 <li>
847 type: UCI section type
848 </li>
849
850 <li>
851 option: UCI option (optional)
852 </li>
853
854 <li>
855 default: Default value (optional)
856 </li>
857
858 </ul>
859
860
861
862
863
864
865 <h3>Return value:</h3>
866 UCI value
867
868
869
870 </dd>
871
872
873
874
875 <dt><a name="Cursor.get_list"></a><strong>Cursor:get_list</strong>&nbsp;(config, section, option)</dt>
876 <dd>
877
878
879 Get an option or list and return values as table.
880
881
882
883 <h3>Parameters</h3>
884 <ul>
885
886 <li>
887 config: UCI config
888 </li>
889
890 <li>
891 section: UCI section name
892 </li>
893
894 <li>
895 option: UCI option
896 </li>
897
898 </ul>
899
900
901
902
903
904
905 <h3>Return value:</h3>
906 table. If the option was not found, you will simply get
907 an empty table.
908
909
910
911 </dd>
912
913
914
915
916 <dt><a name="Cursor.get_savedir"></a><strong>Cursor:get_savedir</strong>&nbsp;()</dt>
917 <dd>
918
919
920 Get the directory for uncomitted changes.
921
922
923
924
925
926
927
928
929 <h3>Return value:</h3>
930 Save directory
931
932
933
934 </dd>
935
936
937
938
939 <dt><a name="Cursor.load"></a><strong>Cursor:load</strong>&nbsp;(config)</dt>
940 <dd>
941
942
943 Manually load a config.
944
945
946
947 <h3>Parameters</h3>
948 <ul>
949
950 <li>
951 config: UCI config
952 </li>
953
954 </ul>
955
956
957
958
959
960
961 <h3>Return value:</h3>
962 Boolean whether operation succeeded
963
964
965
966 <h3>See also:</h3>
967 <ul>
968
969 <li><a href="#Cursor.save">
970 Cursor:save
971 </a>
972
973 <li><a href="#Cursor.unload">
974 Cursor:unload
975 </a>
976
977 </ul>
978
979 </dd>
980
981
982
983
984 <dt><a name="Cursor.revert"></a><strong>Cursor:revert</strong>&nbsp;(config)</dt>
985 <dd>
986
987
988 Revert saved but uncommitted changes.
989
990
991
992 <h3>Parameters</h3>
993 <ul>
994
995 <li>
996 config: UCI config
997 </li>
998
999 </ul>
1000
1001
1002
1003
1004
1005
1006 <h3>Return value:</h3>
1007 Boolean whether operation succeeded
1008
1009
1010
1011 <h3>See also:</h3>
1012 <ul>
1013
1014 <li><a href="#Cursor.commit">
1015 Cursor:commit
1016 </a>
1017
1018 <li><a href="#Cursor.save">
1019 Cursor:save
1020 </a>
1021
1022 </ul>
1023
1024 </dd>
1025
1026
1027
1028
1029 <dt><a name="Cursor.save"></a><strong>Cursor:save</strong>&nbsp;(config)</dt>
1030 <dd>
1031
1032
1033 Saves changes made to a config to make them committable.
1034
1035
1036
1037 <h3>Parameters</h3>
1038 <ul>
1039
1040 <li>
1041 config: UCI config
1042 </li>
1043
1044 </ul>
1045
1046
1047
1048
1049
1050
1051 <h3>Return value:</h3>
1052 Boolean whether operation succeeded
1053
1054
1055
1056 <h3>See also:</h3>
1057 <ul>
1058
1059 <li><a href="#Cursor.load">
1060 Cursor:load
1061 </a>
1062
1063 <li><a href="#Cursor.unload">
1064 Cursor:unload
1065 </a>
1066
1067 </ul>
1068
1069 </dd>
1070
1071
1072
1073
1074 <dt><a name="Cursor.section"></a><strong>Cursor:section</strong>&nbsp;(config, type, name, values)</dt>
1075 <dd>
1076
1077
1078 Create a new section and initialize it with data.
1079
1080
1081
1082 <h3>Parameters</h3>
1083 <ul>
1084
1085 <li>
1086 config: UCI config
1087 </li>
1088
1089 <li>
1090 type: UCI section type
1091 </li>
1092
1093 <li>
1094 name: UCI section name (optional)
1095 </li>
1096
1097 <li>
1098 values: Table of key - value pairs to initialize the section with
1099 </li>
1100
1101 </ul>
1102
1103
1104
1105
1106
1107
1108 <h3>Return value:</h3>
1109 Name of created section
1110
1111
1112
1113 </dd>
1114
1115
1116
1117
1118 <dt><a name="Cursor.set"></a><strong>Cursor:set</strong>&nbsp;(config, section, option, value)</dt>
1119 <dd>
1120
1121
1122 Set a value or create a named section.
1123
1124 When invoked with three arguments <code>config</code>, <code>sectionname</code>, <code>sectiontype</code>,
1125 then a named section of the given type is created.
1126
1127 When invoked with four arguments <code>config</code>, <code>sectionname</code>, <code>optionname</code> and
1128 <code>optionvalue</code> then the value of the specified option is set to the given value.
1129
1130
1131
1132 <h3>Parameters</h3>
1133 <ul>
1134
1135 <li>
1136 config: UCI config
1137 </li>
1138
1139 <li>
1140 section: UCI section name
1141 </li>
1142
1143 <li>
1144 option: UCI option or UCI section type
1145 </li>
1146
1147 <li>
1148 value: UCI value or nothing if you want to create a section
1149 </li>
1150
1151 </ul>
1152
1153
1154
1155
1156
1157
1158 <h3>Return value:</h3>
1159 Boolean whether operation succeeded
1160
1161
1162
1163 </dd>
1164
1165
1166
1167
1168 <dt><a name="Cursor.set_confdir"></a><strong>Cursor:set_confdir</strong>&nbsp;(directory)</dt>
1169 <dd>
1170
1171
1172 Set the configuration directory.
1173
1174
1175
1176 <h3>Parameters</h3>
1177 <ul>
1178
1179 <li>
1180 directory: UCI configuration directory
1181 </li>
1182
1183 </ul>
1184
1185
1186
1187
1188
1189
1190 <h3>Return value:</h3>
1191 Boolean whether operation succeeded
1192
1193
1194
1195 </dd>
1196
1197
1198
1199
1200 <dt><a name="Cursor.set_list"></a><strong>Cursor:set_list</strong>&nbsp;(config, section, option, value)</dt>
1201 <dd>
1202
1203
1204 Set given values as list. Setting a list option to an empty list
1205 has the same effect as deleting the option.
1206
1207
1208
1209 <h3>Parameters</h3>
1210 <ul>
1211
1212 <li>
1213 config: UCI config
1214 </li>
1215
1216 <li>
1217 section: UCI section name
1218 </li>
1219
1220 <li>
1221 option: UCI option
1222 </li>
1223
1224 <li>
1225 value: value or table. Raw values will become a single item table.
1226 </li>
1227
1228 </ul>
1229
1230
1231
1232
1233
1234
1235 <h3>Return value:</h3>
1236 Boolean whether operation succeeded
1237
1238
1239
1240 </dd>
1241
1242
1243
1244
1245 <dt><a name="Cursor.set_savedir"></a><strong>Cursor:set_savedir</strong>&nbsp;(directory)</dt>
1246 <dd>
1247
1248
1249 Set the directory for uncommited changes.
1250
1251
1252
1253 <h3>Parameters</h3>
1254 <ul>
1255
1256 <li>
1257 directory: UCI changes directory
1258 </li>
1259
1260 </ul>
1261
1262
1263
1264
1265
1266
1267 <h3>Return value:</h3>
1268 Boolean whether operation succeeded
1269
1270
1271
1272 </dd>
1273
1274
1275
1276
1277 <dt><a name="Cursor.substate"></a><strong>Cursor:substate</strong>&nbsp;()</dt>
1278 <dd>
1279
1280
1281 Create a sub-state of this cursor. The sub-state is tied to the parent
1282
1283 curser, means it the parent unloads or loads configs, the sub state will
1284 do so as well.
1285
1286
1287
1288
1289
1290
1291
1292 <h3>Return value:</h3>
1293 UCI state cursor tied to the parent cursor
1294
1295
1296
1297 </dd>
1298
1299
1300
1301
1302 <dt><a name="Cursor.tset"></a><strong>Cursor:tset</strong>&nbsp;(config, section, values)</dt>
1303 <dd>
1304
1305
1306 Updated the data of a section using data from a table.
1307
1308
1309
1310 <h3>Parameters</h3>
1311 <ul>
1312
1313 <li>
1314 config: UCI config
1315 </li>
1316
1317 <li>
1318 section: UCI section name (optional)
1319 </li>
1320
1321 <li>
1322 values: Table of key - value pairs to update the section with
1323 </li>
1324
1325 </ul>
1326
1327
1328
1329
1330
1331
1332
1333
1334 </dd>
1335
1336
1337
1338
1339 <dt><a name="Cursor.unload"></a><strong>Cursor:unload</strong>&nbsp;(config)</dt>
1340 <dd>
1341
1342
1343 Discard changes made to a config.
1344
1345
1346
1347 <h3>Parameters</h3>
1348 <ul>
1349
1350 <li>
1351 config: UCI config
1352 </li>
1353
1354 </ul>
1355
1356
1357
1358
1359
1360
1361 <h3>Return value:</h3>
1362 Boolean whether operation succeeded
1363
1364
1365
1366 <h3>See also:</h3>
1367 <ul>
1368
1369 <li><a href="#Cursor.load">
1370 Cursor:load
1371 </a>
1372
1373 <li><a href="#Cursor.save">
1374 Cursor:save
1375 </a>
1376
1377 </ul>
1378
1379 </dd>
1380
1381
1382
1383
1384 <dt><a name="cursor"></a><strong>cursor</strong>&nbsp;()</dt>
1385 <dd>
1386
1387
1388 Create a new UCI-Cursor.
1389
1390
1391
1392
1393
1394
1395
1396
1397 <h3>Return value:</h3>
1398 UCI-Cursor
1399
1400
1401
1402 </dd>
1403
1404
1405
1406
1407 <dt><a name="cursor_state"></a><strong>cursor_state</strong>&nbsp;()</dt>
1408 <dd>
1409
1410
1411 Create a new Cursor initialized to the state directory.
1412
1413
1414
1415
1416
1417
1418
1419
1420 <h3>Return value:</h3>
1421 UCI cursor
1422
1423
1424
1425 </dd>
1426
1427
1428 </dl>
1429
1430
1431
1432
1433
1434 </div> <!-- id="content" -->
1435
1436 </div> <!-- id="main" -->
1437
1438 <div id="about">
1439 <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
1440 </div> <!-- id="about" -->
1441
1442 </div> <!-- id="container" -->
1443 </body>
1444 </html>