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