libscf_sys/
stubs.rs

1/*
2 * Copyright 2024 Oxide Computer Company
3 */
4
5/*
6 * The Service Management Facility (SMF) is available on illumos systems.  This
7 * module contains unimplemented stubs for libscf routines to ease the process
8 * of building higher-level crates on other platforms while using tools like
9 * rust-analyzer.  If a true testing mock for SMF is wanted, that should not
10 * happen at this level.
11 */
12
13#[cfg(not(target_os = "illumos"))]
14mod stubs {
15    #![allow(
16        unused_variables,
17        clippy::missing_safety_doc,
18        clippy::module_inception
19    )]
20
21    use crate::*;
22    use libc::{c_void, size_t, ssize_t};
23
24    pub unsafe fn scf_handle_create(
25        version: scf_version_t,
26    ) -> *mut scf_handle_t {
27        unimplemented!()
28    }
29    pub unsafe fn scf_handle_destroy(handle: *mut scf_handle_t) {
30        unimplemented!()
31    }
32    pub unsafe fn scf_handle_bind(handle: *mut scf_handle_t) -> c_int {
33        unimplemented!()
34    }
35    pub unsafe fn scf_handle_unbind(handle: *mut scf_handle_t) -> c_int {
36        unimplemented!()
37    }
38
39    pub unsafe fn scf_handle_decorate(
40        handle: *mut scf_handle_t,
41        param: *const c_char,
42        value: *mut scf_value_t,
43    ) -> c_int {
44        unimplemented!()
45    }
46
47    pub unsafe fn scf_myname(
48        handle: *mut scf_handle_t,
49        out: *mut c_char,
50        sz: size_t,
51    ) -> ssize_t {
52        unimplemented!()
53    }
54
55    pub unsafe fn scf_error() -> u32 {
56        unimplemented!()
57    }
58    pub unsafe fn scf_strerror(error: scf_error_t) -> *const c_char {
59        unimplemented!()
60    }
61
62    pub unsafe fn scf_limit(name: u32) -> ssize_t {
63        unimplemented!()
64    }
65
66    pub unsafe fn scf_iter_create(
67        handle: *mut scf_handle_t,
68    ) -> *mut scf_iter_t {
69        unimplemented!()
70    }
71    pub unsafe fn scf_iter_destroy(iter: *mut scf_iter_t) {
72        unimplemented!()
73    }
74    pub unsafe fn scf_iter_reset(iter: *mut scf_iter_t) {
75        unimplemented!()
76    }
77
78    pub unsafe fn scf_scope_create(
79        handle: *mut scf_handle_t,
80    ) -> *mut scf_scope_t {
81        unimplemented!()
82    }
83    pub unsafe fn scf_scope_destroy(scope: *mut scf_scope_t) {
84        unimplemented!()
85    }
86    pub unsafe fn scf_scope_get_name(
87        scope: *const scf_scope_t,
88        buf: *mut c_char,
89        size: size_t,
90    ) -> ssize_t {
91        unimplemented!()
92    }
93    pub unsafe fn scf_handle_get_scope(
94        handle: *mut scf_handle_t,
95        name: *const c_char,
96        out: *mut scf_scope_t,
97    ) -> c_int {
98        unimplemented!()
99    }
100
101    pub unsafe fn scf_scope_get_service(
102        scope: *const scf_scope_t,
103        name: *const c_char,
104        out: *mut scf_service_t,
105    ) -> c_int {
106        unimplemented!()
107    }
108    pub unsafe fn scf_scope_add_service(
109        scope: *mut scf_scope_t,
110        name: *const c_char,
111        out: *mut scf_service_t,
112    ) -> c_int {
113        unimplemented!()
114    }
115
116    pub unsafe fn scf_iter_handle_scopes(
117        iter: *mut scf_iter_t,
118        handle: *const scf_handle_t,
119    ) -> c_int {
120        unimplemented!()
121    }
122    pub unsafe fn scf_iter_next_scope(
123        iter: *mut scf_iter_t,
124        out: *mut scf_scope_t,
125    ) -> c_int {
126        unimplemented!()
127    }
128
129    pub unsafe fn scf_service_create(
130        handle: *mut scf_handle_t,
131    ) -> *mut scf_service_t {
132        unimplemented!()
133    }
134    pub unsafe fn scf_service_destroy(service: *mut scf_service_t) {
135        unimplemented!()
136    }
137    pub unsafe fn scf_service_delete(service: *mut scf_service_t) -> c_int {
138        unimplemented!()
139    }
140
141    pub unsafe fn scf_service_get_name(
142        service: *const scf_service_t,
143        buf: *mut c_char,
144        size: size_t,
145    ) -> ssize_t {
146        unimplemented!()
147    }
148    pub unsafe fn scf_service_get_instance(
149        service: *const scf_service_t,
150        name: *const c_char,
151        out: *mut scf_instance_t,
152    ) -> c_int {
153        unimplemented!()
154    }
155    pub unsafe fn scf_service_add_instance(
156        service: *mut scf_service_t,
157        name: *const c_char,
158        out: *mut scf_instance_t,
159    ) -> c_int {
160        unimplemented!()
161    }
162
163    pub unsafe fn scf_iter_scope_services(
164        iter: *mut scf_iter_t,
165        scope: *const scf_scope_t,
166    ) -> c_int {
167        unimplemented!()
168    }
169    pub unsafe fn scf_iter_next_service(
170        iter: *mut scf_iter_t,
171        out: *mut scf_service_t,
172    ) -> c_int {
173        unimplemented!()
174    }
175
176    pub unsafe fn scf_instance_create(
177        handle: *mut scf_handle_t,
178    ) -> *mut scf_instance_t {
179        unimplemented!()
180    }
181    pub unsafe fn scf_instance_destroy(instance: *mut scf_instance_t) {
182        unimplemented!()
183    }
184    pub unsafe fn scf_instance_delete(instance: *mut scf_instance_t) -> c_int {
185        unimplemented!()
186    }
187
188    pub unsafe fn scf_instance_get_name(
189        instance: *const scf_instance_t,
190        buf: *mut c_char,
191        size: size_t,
192    ) -> ssize_t {
193        unimplemented!()
194    }
195    pub unsafe fn scf_instance_get_pg(
196        instance: *const scf_instance_t,
197        name: *const c_char,
198        out: *mut scf_propertygroup_t,
199    ) -> c_int {
200        unimplemented!()
201    }
202    pub unsafe fn scf_instance_add_pg(
203        instance: *mut scf_instance_t,
204        name: *const c_char,
205        pgtype: *const c_char,
206        flags: u32,
207        out: *mut scf_propertygroup_t,
208    ) -> c_int {
209        unimplemented!()
210    }
211    pub unsafe fn scf_instance_get_pg_composed(
212        instance: *const scf_instance_t,
213        snapshot: *const scf_snapshot_t,
214        name: *const c_char,
215        out: *mut scf_propertygroup_t,
216    ) -> c_int {
217        unimplemented!()
218    }
219    pub unsafe fn scf_instance_get_snapshot(
220        instance: *const scf_instance_t,
221        name: *const c_char,
222        out: *mut scf_snapshot_t,
223    ) -> c_int {
224        unimplemented!()
225    }
226    pub unsafe fn scf_instance_to_fmri(
227        instance: *const scf_instance_t,
228        buf: *mut c_char,
229        size: size_t,
230    ) -> ssize_t {
231        unimplemented!()
232    }
233
234    pub unsafe fn scf_iter_service_instances(
235        iter: *mut scf_iter_t,
236        service: *const scf_service_t,
237    ) -> c_int {
238        unimplemented!()
239    }
240    pub unsafe fn scf_iter_next_instance(
241        iter: *mut scf_iter_t,
242        out: *mut scf_instance_t,
243    ) -> c_int {
244        unimplemented!()
245    }
246
247    pub unsafe fn scf_snapshot_create(
248        handle: *mut scf_handle_t,
249    ) -> *mut scf_snapshot_t {
250        unimplemented!()
251    }
252    pub unsafe fn scf_snapshot_destroy(snapshot: *mut scf_snapshot_t) {
253        unimplemented!()
254    }
255
256    pub unsafe fn scf_snapshot_get_name(
257        snapshot: *const scf_snapshot_t,
258        buf: *mut c_char,
259        size: size_t,
260    ) -> ssize_t {
261        unimplemented!()
262    }
263    pub unsafe fn scf_snapshot_get_parent(
264        snapshot: *const scf_snapshot_t,
265        inst: *mut scf_instance_t,
266    ) -> c_int {
267        unimplemented!()
268    }
269
270    pub unsafe fn scf_iter_instance_snapshots(
271        iter: *mut scf_iter_t,
272        instance: *const scf_instance_t,
273    ) -> c_int {
274        unimplemented!()
275    }
276    pub unsafe fn scf_iter_next_snapshot(
277        iter: *mut scf_iter_t,
278        out: *mut scf_snapshot_t,
279    ) -> c_int {
280        unimplemented!()
281    }
282
283    pub unsafe fn scf_iter_instance_pgs(
284        iter: *mut scf_iter_t,
285        instance: *const scf_instance_t,
286    ) -> c_int {
287        unimplemented!()
288    }
289    pub unsafe fn scf_iter_instance_pgs_composed(
290        iter: *mut scf_iter_t,
291        instance: *const scf_instance_t,
292        snapshot: *const scf_snapshot_t,
293    ) -> c_int {
294        unimplemented!()
295    }
296    pub unsafe fn scf_iter_service_pgs(
297        iter: *mut scf_iter_t,
298        service: *const scf_service_t,
299    ) -> c_int {
300        unimplemented!()
301    }
302    pub unsafe fn scf_iter_next_pg(
303        iter: *mut scf_iter_t,
304        out: *mut scf_propertygroup_t,
305    ) -> c_int {
306        unimplemented!()
307    }
308
309    pub unsafe fn scf_pg_create(
310        handle: *mut scf_handle_t,
311    ) -> *mut scf_propertygroup_t {
312        unimplemented!()
313    }
314    pub unsafe fn scf_pg_destroy(pg: *mut scf_propertygroup_t) {
315        unimplemented!()
316    }
317    pub unsafe fn scf_pg_delete(pg: *mut scf_propertygroup_t) -> c_int {
318        unimplemented!()
319    }
320
321    pub unsafe fn scf_pg_get_name(
322        pg: *const scf_propertygroup_t,
323        buf: *mut c_char,
324        size: size_t,
325    ) -> ssize_t {
326        unimplemented!()
327    }
328    pub unsafe fn scf_pg_get_type(
329        pg: *const scf_propertygroup_t,
330        buf: *mut c_char,
331        size: size_t,
332    ) -> ssize_t {
333        unimplemented!()
334    }
335    pub unsafe fn scf_pg_get_flags(
336        pg: *const scf_propertygroup_t,
337        out: *mut u32,
338    ) -> c_int {
339        unimplemented!()
340    }
341    pub unsafe fn scf_pg_update(pg: *mut scf_propertygroup_t) -> c_int {
342        unimplemented!()
343    }
344    pub unsafe fn scf_pg_get_property(
345        pg: *const scf_propertygroup_t,
346        name: *const c_char,
347        out: *mut scf_property_t,
348    ) -> c_int {
349        unimplemented!()
350    }
351
352    pub unsafe fn scf_iter_pg_properties(
353        iter: *mut scf_iter_t,
354        pg: *const scf_propertygroup_t,
355    ) -> c_int {
356        unimplemented!()
357    }
358    pub unsafe fn scf_iter_next_property(
359        iter: *mut scf_iter_t,
360        out: *mut scf_property_t,
361    ) -> c_int {
362        unimplemented!()
363    }
364
365    pub unsafe fn scf_property_create(
366        handle: *mut scf_handle_t,
367    ) -> *mut scf_property_t {
368        unimplemented!()
369    }
370    pub unsafe fn scf_property_destroy(prop: *mut scf_property_t) {
371        unimplemented!()
372    }
373
374    pub unsafe fn scf_property_get_name(
375        prop: *const scf_property_t,
376        buf: *mut c_char,
377        size: size_t,
378    ) -> ssize_t {
379        unimplemented!()
380    }
381    pub unsafe fn scf_property_type(
382        prop: *const scf_property_t,
383        typ: *mut scf_type_t,
384    ) -> ssize_t {
385        unimplemented!()
386    }
387
388    pub unsafe fn scf_iter_property_values(
389        iter: *mut scf_iter_t,
390        prop: *const scf_property_t,
391    ) -> c_int {
392        unimplemented!()
393    }
394    pub unsafe fn scf_iter_next_value(
395        iter: *mut scf_iter_t,
396        out: *mut scf_value_t,
397    ) -> c_int {
398        unimplemented!()
399    }
400
401    pub unsafe fn scf_value_create(
402        handle: *mut scf_handle_t,
403    ) -> *mut scf_value_t {
404        unimplemented!()
405    }
406    pub unsafe fn scf_value_destroy(val: *mut scf_value_t) {
407        unimplemented!()
408    }
409    pub unsafe fn scf_value_reset(val: *mut scf_value_t) {
410        unimplemented!()
411    }
412
413    pub unsafe fn scf_value_type(val: *const scf_value_t) -> c_int {
414        unimplemented!()
415    }
416    pub unsafe fn scf_value_base_type(val: *const scf_value_t) -> c_int {
417        unimplemented!()
418    }
419
420    pub unsafe fn scf_value_get_as_string(
421        val: *const scf_value_t,
422        buf: *mut c_char,
423        size: size_t,
424    ) -> ssize_t {
425        unimplemented!()
426    }
427    pub unsafe fn scf_value_get_as_string_typed(
428        val: *const scf_value_t,
429        type_: scf_type_t,
430        buf: *mut c_char,
431        size: size_t,
432    ) -> ssize_t {
433        unimplemented!()
434    }
435    pub unsafe fn scf_value_set_from_string(
436        val: *mut scf_value_t,
437        valtype: scf_type_t,
438        valstr: *const c_char,
439    ) -> c_int {
440        unimplemented!()
441    }
442
443    pub unsafe fn scf_value_get_boolean(
444        val: *const scf_value_t,
445        out: *mut u8,
446    ) -> c_int {
447        unimplemented!()
448    }
449    pub unsafe fn scf_value_get_count(
450        val: *const scf_value_t,
451        out: *mut u64,
452    ) -> c_int {
453        unimplemented!()
454    }
455    pub unsafe fn scf_value_get_integer(
456        val: *const scf_value_t,
457        out: *mut i64,
458    ) -> c_int {
459        unimplemented!()
460    }
461    pub unsafe fn scf_value_get_time(
462        val: *const scf_value_t,
463        seconds: *mut i64,
464        ns: *mut i32,
465    ) -> c_int {
466        unimplemented!()
467    }
468    pub unsafe fn scf_value_get_astring(
469        val: *const scf_value_t,
470        buf: *mut c_char,
471        size: size_t,
472    ) -> c_int {
473        unimplemented!()
474    }
475    pub unsafe fn scf_value_get_ustring(
476        val: *const scf_value_t,
477        buf: *mut c_char,
478        size: size_t,
479    ) -> c_int {
480        unimplemented!()
481    }
482    pub unsafe fn scf_value_get_opaque(
483        val: *const scf_value_t,
484        buf: *mut c_void,
485        size: size_t,
486    ) -> c_int {
487        unimplemented!()
488    }
489
490    pub unsafe fn scf_value_set_boolean(val: *mut scf_value_t, new: u8) {
491        unimplemented!()
492    }
493    pub unsafe fn scf_value_set_count(val: *mut scf_value_t, new: u64) {
494        unimplemented!()
495    }
496    pub unsafe fn scf_value_set_integer(val: *mut scf_value_t, new: i64) {
497        unimplemented!()
498    }
499    pub unsafe fn scf_value_set_time(
500        val: *mut scf_value_t,
501        seconds: i64,
502        ns: i32,
503    ) -> c_int {
504        unimplemented!()
505    }
506    pub unsafe fn scf_value_set_astring(
507        val: *mut scf_value_t,
508        new: *const c_char,
509        size: size_t,
510    ) -> c_int {
511        unimplemented!()
512    }
513    pub unsafe fn scf_value_set_ustring(
514        val: *mut scf_value_t,
515        new: *const c_char,
516        size: size_t,
517    ) -> c_int {
518        unimplemented!()
519    }
520    pub unsafe fn scf_value_set_opaque(
521        val: *mut scf_value_t,
522        new: *const c_void,
523        size: size_t,
524    ) -> c_int {
525        unimplemented!()
526    }
527
528    pub unsafe fn scf_type_base_type(
529        typ: scf_type_t,
530        out: *mut scf_type_t,
531    ) -> c_int {
532        unimplemented!()
533    }
534
535    pub unsafe fn scf_transaction_create(
536        handle: *mut scf_handle_t,
537    ) -> *mut scf_transaction_t {
538        unimplemented!()
539    }
540    pub unsafe fn scf_transaction_destroy(tran: *mut scf_transaction_t) {
541        unimplemented!()
542    }
543    pub unsafe fn scf_transaction_reset(tran: *mut scf_transaction_t) {
544        unimplemented!()
545    }
546    pub unsafe fn scf_transaction_reset_all(tran: *mut scf_transaction_t) {
547        unimplemented!()
548    }
549
550    pub unsafe fn scf_transaction_start(
551        tran: *mut scf_transaction_t,
552        pg: *mut scf_propertygroup_t,
553    ) -> c_int {
554        unimplemented!()
555    }
556    pub unsafe fn scf_transaction_commit(
557        tran: *mut scf_transaction_t,
558    ) -> c_int {
559        unimplemented!()
560    }
561
562    pub unsafe fn scf_transaction_property_delete(
563        tran: *mut scf_transaction_t,
564        entry: *mut scf_transaction_entry_t,
565        name: *const c_char,
566    ) -> c_int {
567        unimplemented!()
568    }
569    pub unsafe fn scf_transaction_property_new(
570        tran: *mut scf_transaction_t,
571        entry: *mut scf_transaction_entry_t,
572        name: *const c_char,
573        proptype: scf_type_t,
574    ) -> c_int {
575        unimplemented!()
576    }
577    pub unsafe fn scf_transaction_property_change(
578        tran: *mut scf_transaction_t,
579        entry: *mut scf_transaction_entry_t,
580        name: *const c_char,
581        proptype: scf_type_t,
582    ) -> c_int {
583        unimplemented!()
584    }
585    pub unsafe fn scf_transaction_property_change_type(
586        tran: *mut scf_transaction_t,
587        entry: *mut scf_transaction_entry_t,
588        name: *const c_char,
589        proptype: scf_type_t,
590    ) -> c_int {
591        unimplemented!()
592    }
593
594    pub unsafe fn scf_entry_create(
595        handle: *mut scf_handle_t,
596    ) -> *mut scf_transaction_entry_t {
597        unimplemented!()
598    }
599    pub unsafe fn scf_entry_destroy(tran: *mut scf_transaction_entry_t) {
600        unimplemented!()
601    }
602    pub unsafe fn scf_entry_destroy_children(
603        tran: *mut scf_transaction_entry_t,
604    ) {
605        unimplemented!()
606    }
607    pub unsafe fn scf_entry_reset(tran: *mut scf_transaction_entry_t) {
608        unimplemented!()
609    }
610
611    pub unsafe fn scf_entry_add_value(
612        tran: *mut scf_transaction_entry_t,
613        value: *mut scf_value_t,
614    ) -> c_int {
615        unimplemented!()
616    }
617
618    pub unsafe fn smf_disable_instance(
619        instance: *const c_char,
620        flags: c_int,
621    ) -> c_int {
622        unimplemented!()
623    }
624    pub unsafe fn smf_enable_instance(
625        instance: *const c_char,
626        flags: c_int,
627    ) -> c_int {
628        unimplemented!()
629    }
630    pub unsafe fn smf_refresh_instance(instance: *const c_char) -> c_int {
631        unimplemented!()
632    }
633
634    #[allow(clippy::too_many_arguments)]
635    pub unsafe fn scf_handle_decode_fmri(
636        handle: *mut scf_handle_t,
637        fmri: *const c_char,
638        out_scope: *mut scf_scope_t,
639        out_service: *mut scf_service_t,
640        out_instance: *mut scf_instance_t,
641        out_pg: *mut scf_propertygroup_t,
642        out_prop: *mut scf_property_t,
643        flags: c_int,
644    ) -> c_int {
645        unimplemented!()
646    }
647}
648
649pub use stubs::*;