Regenerate api 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 UCI value
907
908
909
910 </dd>
911
912
913
914
915 <dt><a name="Cursor.get_savedir"></a><strong>Cursor:get_savedir</strong>&nbsp;()</dt>
916 <dd>
917
918  
919 Get the directory for uncomitted changes. 
920
921
922
923
924
925
926
927
928 <h3>Return value:</h3>
929 Save directory
930
931
932
933 </dd>
934
935
936
937
938 <dt><a name="Cursor.load"></a><strong>Cursor:load</strong>&nbsp;(config)</dt>
939 <dd>
940
941  
942 Manually load a config. 
943
944
945
946 <h3>Parameters</h3>
947 <ul>
948         
949         <li>
950           config: UCI config
951         </li>
952         
953 </ul>
954
955
956
957
958
959
960 <h3>Return value:</h3>
961 Boolean whether operation succeeded
962
963
964
965 <h3>See also:</h3>
966 <ul>
967         
968         <li><a href="#Cursor.save">
969                 Cursor:save
970         </a>
971         
972         <li><a href="#Cursor.unload">
973                 Cursor:unload
974         </a>
975         
976 </ul>
977
978 </dd>
979
980
981
982
983 <dt><a name="Cursor.revert"></a><strong>Cursor:revert</strong>&nbsp;(config)</dt>
984 <dd>
985
986  
987 Revert saved but uncommitted changes. 
988
989
990
991 <h3>Parameters</h3>
992 <ul>
993         
994         <li>
995           config: UCI config
996         </li>
997         
998 </ul>
999
1000
1001
1002
1003
1004
1005 <h3>Return value:</h3>
1006 Boolean whether operation succeeded
1007
1008
1009
1010 <h3>See also:</h3>
1011 <ul>
1012         
1013         <li><a href="#Cursor.commit">
1014                 Cursor:commit
1015         </a>
1016         
1017         <li><a href="#Cursor.save">
1018                 Cursor:save
1019         </a>
1020         
1021 </ul>
1022
1023 </dd>
1024
1025
1026
1027
1028 <dt><a name="Cursor.save"></a><strong>Cursor:save</strong>&nbsp;(config)</dt>
1029 <dd>
1030
1031  
1032 Saves changes made to a config to make them committable. 
1033
1034
1035
1036 <h3>Parameters</h3>
1037 <ul>
1038         
1039         <li>
1040           config: UCI config
1041         </li>
1042         
1043 </ul>
1044
1045
1046
1047
1048
1049
1050 <h3>Return value:</h3>
1051 Boolean whether operation succeeded
1052
1053
1054
1055 <h3>See also:</h3>
1056 <ul>
1057         
1058         <li><a href="#Cursor.load">
1059                 Cursor:load
1060         </a>
1061         
1062         <li><a href="#Cursor.unload">
1063                 Cursor:unload
1064         </a>
1065         
1066 </ul>
1067
1068 </dd>
1069
1070
1071
1072
1073 <dt><a name="Cursor.section"></a><strong>Cursor:section</strong>&nbsp;(config, type, name, values)</dt>
1074 <dd>
1075
1076  
1077 Create a new section and initialize it with data. 
1078
1079
1080
1081 <h3>Parameters</h3>
1082 <ul>
1083         
1084         <li>
1085           config: UCI config
1086         </li>
1087         
1088         <li>
1089           type: UCI section type
1090         </li>
1091         
1092         <li>
1093           name: UCI section name (optional)
1094         </li>
1095         
1096         <li>
1097           values: Table of key - value pairs to initialize the section with
1098         </li>
1099         
1100 </ul>
1101
1102
1103
1104
1105
1106
1107 <h3>Return value:</h3>
1108 Name of created section
1109
1110
1111
1112 </dd>
1113
1114
1115
1116
1117 <dt><a name="Cursor.set"></a><strong>Cursor:set</strong>&nbsp;(config, section, option, value)</dt>
1118 <dd>
1119
1120  
1121 Set a value or create a named section. 
1122
1123
1124
1125 <h3>Parameters</h3>
1126 <ul>
1127         
1128         <li>
1129           config: UCI config
1130         </li>
1131         
1132         <li>
1133           section: UCI section name
1134         </li>
1135         
1136         <li>
1137           option: UCI option or UCI section type
1138         </li>
1139         
1140         <li>
1141           value: UCI value or nil if you want to create a section
1142         </li>
1143         
1144 </ul>
1145
1146
1147
1148
1149
1150
1151 <h3>Return value:</h3>
1152 Boolean whether operation succeeded
1153
1154
1155
1156 </dd>
1157
1158
1159
1160
1161 <dt><a name="Cursor.set_confdir"></a><strong>Cursor:set_confdir</strong>&nbsp;(directory)</dt>
1162 <dd>
1163
1164  
1165 Set the configuration directory. 
1166
1167
1168
1169 <h3>Parameters</h3>
1170 <ul>
1171         
1172         <li>
1173           directory: UCI configuration directory
1174         </li>
1175         
1176 </ul>
1177
1178
1179
1180
1181
1182
1183 <h3>Return value:</h3>
1184 Boolean whether operation succeeded
1185
1186
1187
1188 </dd>
1189
1190
1191
1192
1193 <dt><a name="Cursor.set_list"></a><strong>Cursor:set_list</strong>&nbsp;(config, section, option, value)</dt>
1194 <dd>
1195
1196  
1197 Set given values as list. 
1198
1199
1200
1201 <h3>Parameters</h3>
1202 <ul>
1203         
1204         <li>
1205           config: UCI config
1206         </li>
1207         
1208         <li>
1209           section: UCI section name
1210         </li>
1211         
1212         <li>
1213           option: UCI option
1214         </li>
1215         
1216         <li>
1217           value: UCI value
1218         </li>
1219         
1220 </ul>
1221
1222
1223
1224
1225
1226
1227 <h3>Return value:</h3>
1228 Boolean whether operation succeeded
1229
1230
1231
1232 </dd>
1233
1234
1235
1236
1237 <dt><a name="Cursor.set_savedir"></a><strong>Cursor:set_savedir</strong>&nbsp;(directory)</dt>
1238 <dd>
1239
1240  
1241 Set the directory for uncommited changes. 
1242
1243
1244
1245 <h3>Parameters</h3>
1246 <ul>
1247         
1248         <li>
1249           directory: UCI changes directory
1250         </li>
1251         
1252 </ul>
1253
1254
1255
1256
1257
1258
1259 <h3>Return value:</h3>
1260 Boolean whether operation succeeded
1261
1262
1263
1264 </dd>
1265
1266
1267
1268
1269 <dt><a name="Cursor.substate"></a><strong>Cursor:substate</strong>&nbsp;()</dt>
1270 <dd>
1271
1272  
1273 Create a sub-state of this cursor. The sub-state is tied to the parent 
1274  
1275 curser, means it the parent unloads or loads configs, the sub state will 
1276 do so as well.
1277
1278
1279
1280
1281
1282
1283
1284 <h3>Return value:</h3>
1285 UCI state cursor tied to the parent cursor
1286
1287
1288
1289 </dd>
1290
1291
1292
1293
1294 <dt><a name="Cursor.tset"></a><strong>Cursor:tset</strong>&nbsp;(config, section, values)</dt>
1295 <dd>
1296
1297  
1298 Updated the data of a section using data from a table. 
1299
1300
1301
1302 <h3>Parameters</h3>
1303 <ul>
1304         
1305         <li>
1306           config: UCI config
1307         </li>
1308         
1309         <li>
1310           section: UCI section name (optional)
1311         </li>
1312         
1313         <li>
1314           values: Table of key - value pairs to update the section with
1315         </li>
1316         
1317 </ul>
1318
1319
1320
1321
1322
1323
1324
1325
1326 </dd>
1327
1328
1329
1330
1331 <dt><a name="Cursor.unload"></a><strong>Cursor:unload</strong>&nbsp;(config)</dt>
1332 <dd>
1333
1334  
1335 Discard changes made to a config. 
1336
1337
1338
1339 <h3>Parameters</h3>
1340 <ul>
1341         
1342         <li>
1343           config: UCI config
1344         </li>
1345         
1346 </ul>
1347
1348
1349
1350
1351
1352
1353 <h3>Return value:</h3>
1354 Boolean whether operation succeeded
1355
1356
1357
1358 <h3>See also:</h3>
1359 <ul>
1360         
1361         <li><a href="#Cursor.load">
1362                 Cursor:load
1363         </a>
1364         
1365         <li><a href="#Cursor.save">
1366                 Cursor:save
1367         </a>
1368         
1369 </ul>
1370
1371 </dd>
1372
1373
1374
1375
1376 <dt><a name="cursor"></a><strong>cursor</strong>&nbsp;()</dt>
1377 <dd>
1378
1379  
1380 Create a new UCI-Cursor. 
1381
1382
1383
1384
1385
1386
1387
1388
1389 <h3>Return value:</h3>
1390 UCI-Cursor
1391
1392
1393
1394 </dd>
1395
1396
1397
1398
1399 <dt><a name="cursor_state"></a><strong>cursor_state</strong>&nbsp;()</dt>
1400 <dd>
1401
1402  
1403 Create a new Cursor initialized to the state directory. 
1404
1405
1406
1407
1408
1409
1410
1411
1412 <h3>Return value:</h3>
1413 UCI cursor
1414
1415
1416
1417 </dd>
1418
1419
1420 </dl>
1421
1422
1423
1424
1425
1426 </div> <!-- id="content" -->
1427
1428 </div> <!-- id="main" -->
1429
1430 <div id="about">
1431         <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>
1432 </div> <!-- id="about" -->
1433
1434 </div> <!-- id="container" -->
1435 </body>
1436 </html>