libedit-sys 0.2.0

Low-level FFI bindings to the libedit line-editing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
// Pre-generated libedit bindings (bindgen 0.71.1, libedit 3.1, Debian Linux arm64).
//
// These bindings are the default; they ship with the crate so consumers
// don't need libclang/clang installed. To regenerate (e.g., for a different
// platform or libedit version), enable the `bindgen` feature:
//
//   cargo build --features bindgen
//
// This will run bindgen at build time and use the freshly generated bindings
// instead of this file. To update the pre-generated copy after regeneration:
//
//   cp target/debug/build/libedit-sys-*/out/bindings.rs src/bindings.rs
//
// Then manually re-apply the #[cfg(not(target_os = "macos"))] guard around
// `el_init_fd` (see below) -- this function exists in Linux/netbsd-editline
// but not in Apple's libedit.

/* automatically generated by rust-bindgen 0.71.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FILE { _unused: [u8; 0] }

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
    storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
    #[inline]
    pub const fn new(storage: Storage) -> Self {
        Self { storage }
    }
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    fn extract_bit(byte: u8, index: usize) -> bool {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        Self::extract_bit(byte, index)
    }
    #[inline]
    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
        Self::extract_bit(byte, index)
    }
    #[inline]
    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val {
            byte | mask
        } else {
            byte & !mask
        }
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        *byte = Self::change_bit(*byte, index, val);
    }
    #[inline]
    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte =
            (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
        *byte = Self::change_bit(*byte, index, val);
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if Self::raw_get_bit(this, i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            self.set_bit(index + bit_offset, val_bit_is_set);
        }
    }
    #[inline]
    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
        }
    }
}
pub const CC_NORM: u32 = 0;
pub const CC_NEWLINE: u32 = 1;
pub const CC_EOF: u32 = 2;
pub const CC_ARGHACK: u32 = 3;
pub const CC_REFRESH: u32 = 4;
pub const CC_CURSOR: u32 = 5;
pub const CC_ERROR: u32 = 6;
pub const CC_FATAL: u32 = 7;
pub const CC_REDISPLAY: u32 = 8;
pub const CC_REFRESH_BEEP: u32 = 9;
pub const EL_PROMPT: u32 = 0;
pub const EL_TERMINAL: u32 = 1;
pub const EL_EDITOR: u32 = 2;
pub const EL_SIGNAL: u32 = 3;
pub const EL_BIND: u32 = 4;
pub const EL_TELLTC: u32 = 5;
pub const EL_SETTC: u32 = 6;
pub const EL_ECHOTC: u32 = 7;
pub const EL_SETTY: u32 = 8;
pub const EL_ADDFN: u32 = 9;
pub const EL_HIST: u32 = 10;
pub const EL_EDITMODE: u32 = 11;
pub const EL_RPROMPT: u32 = 12;
pub const EL_GETCFN: u32 = 13;
pub const EL_CLIENTDATA: u32 = 14;
pub const EL_UNBUFFERED: u32 = 15;
pub const EL_PREP_TERM: u32 = 16;
pub const EL_GETTC: u32 = 17;
pub const EL_GETFP: u32 = 18;
pub const EL_SETFP: u32 = 19;
pub const EL_REFRESH: u32 = 20;
pub const EL_PROMPT_ESC: u32 = 21;
pub const EL_RPROMPT_ESC: u32 = 22;
pub const EL_RESIZE: u32 = 23;
pub const EL_ALIAS_TEXT: u32 = 24;
pub const EL_SAFEREAD: u32 = 25;
pub const H_FUNC: u32 = 0;
pub const H_SETSIZE: u32 = 1;
pub const H_GETSIZE: u32 = 2;
pub const H_FIRST: u32 = 3;
pub const H_LAST: u32 = 4;
pub const H_PREV: u32 = 5;
pub const H_NEXT: u32 = 6;
pub const H_CURR: u32 = 8;
pub const H_SET: u32 = 7;
pub const H_ADD: u32 = 9;
pub const H_ENTER: u32 = 10;
pub const H_APPEND: u32 = 11;
pub const H_END: u32 = 12;
pub const H_NEXT_STR: u32 = 13;
pub const H_PREV_STR: u32 = 14;
pub const H_NEXT_EVENT: u32 = 15;
pub const H_PREV_EVENT: u32 = 16;
pub const H_LOAD: u32 = 17;
pub const H_SAVE: u32 = 18;
pub const H_CLEAR: u32 = 19;
pub const H_SETUNIQUE: u32 = 20;
pub const H_GETUNIQUE: u32 = 21;
pub const H_DEL: u32 = 22;
pub const H_NEXT_EVDATA: u32 = 23;
pub const H_DELDATA: u32 = 24;
pub const H_REPLACE: u32 = 25;
pub const H_SAVE_FP: u32 = 26;
pub const H_NSAVE_FP: u32 = 27;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_marker {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_codecvt {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_wide_data {
    _unused: [u8; 0],
}
pub type _IO_lock_t = ::std::os::raw::c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_FILE {
    pub _flags: ::std::os::raw::c_int,
    pub _IO_read_ptr: *mut ::std::os::raw::c_char,
    pub _IO_read_end: *mut ::std::os::raw::c_char,
    pub _IO_read_base: *mut ::std::os::raw::c_char,
    pub _IO_write_base: *mut ::std::os::raw::c_char,
    pub _IO_write_ptr: *mut ::std::os::raw::c_char,
    pub _IO_write_end: *mut ::std::os::raw::c_char,
    pub _IO_buf_base: *mut ::std::os::raw::c_char,
    pub _IO_buf_end: *mut ::std::os::raw::c_char,
    pub _IO_save_base: *mut ::std::os::raw::c_char,
    pub _IO_backup_base: *mut ::std::os::raw::c_char,
    pub _IO_save_end: *mut ::std::os::raw::c_char,
    pub _markers: *mut _IO_marker,
    pub _chain: *mut _IO_FILE,
    pub _fileno: ::std::os::raw::c_int,
    pub _bitfield_align_1: [u32; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
    pub _short_backupbuf: [::std::os::raw::c_char; 1usize],
    pub _old_offset: __off_t,
    pub _cur_column: ::std::os::raw::c_ushort,
    pub _vtable_offset: ::std::os::raw::c_schar,
    pub _shortbuf: [::std::os::raw::c_char; 1usize],
    pub _lock: *mut _IO_lock_t,
    pub _offset: __off64_t,
    pub _codecvt: *mut _IO_codecvt,
    pub _wide_data: *mut _IO_wide_data,
    pub _freeres_list: *mut _IO_FILE,
    pub _freeres_buf: *mut ::std::os::raw::c_void,
    pub _prevchain: *mut *mut _IO_FILE,
    pub _mode: ::std::os::raw::c_int,
    pub _unused2: [::std::os::raw::c_char; 20usize],
}
impl Default for _IO_FILE {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl _IO_FILE {
    #[inline]
    pub fn _flags2(&self) -> ::std::os::raw::c_int {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
    }
    #[inline]
    pub fn set__flags2(&mut self, val: ::std::os::raw::c_int) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(0usize, 24u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn _flags2_raw(this: *const Self) -> ::std::os::raw::c_int {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                24u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set__flags2_raw(this: *mut Self, val: ::std::os::raw::c_int) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                24u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(_flags2: ::std::os::raw::c_int) -> __BindgenBitfieldUnit<[u8; 3usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 24u8, {
            let _flags2: u32 = unsafe { ::std::mem::transmute(_flags2) };
            _flags2 as u64
        });
        __bindgen_bitfield_unit
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct editline {
    _unused: [u8; 0],
}
pub type EditLine = editline;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct lineinfo {
    pub buffer: *const ::std::os::raw::c_char,
    pub cursor: *const ::std::os::raw::c_char,
    pub lastchar: *const ::std::os::raw::c_char,
}
impl Default for lineinfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type LineInfo = lineinfo;
unsafe extern "C" {
    pub fn el_init(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut FILE,
        arg3: *mut FILE,
        arg4: *mut FILE,
    ) -> *mut EditLine;
}
#[cfg(not(target_os = "macos"))]
unsafe extern "C" {
    pub fn el_init_fd(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut FILE,
        arg3: *mut FILE,
        arg4: *mut FILE,
        arg5: ::std::os::raw::c_int,
        arg6: ::std::os::raw::c_int,
        arg7: ::std::os::raw::c_int,
    ) -> *mut EditLine;
}
unsafe extern "C" {
    pub fn el_end(arg1: *mut EditLine);
}
unsafe extern "C" {
    pub fn el_reset(arg1: *mut EditLine);
}
unsafe extern "C" {
    pub fn el_gets(
        arg1: *mut EditLine,
        arg2: *mut ::std::os::raw::c_int,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn el_getc(arg1: *mut EditLine, arg2: *mut ::std::os::raw::c_char)
        -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_push(arg1: *mut EditLine, arg2: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    pub fn el_beep(arg1: *mut EditLine);
}
unsafe extern "C" {
    pub fn el_parse(
        arg1: *mut EditLine,
        arg2: ::std::os::raw::c_int,
        arg3: *mut *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_set(arg1: *mut EditLine, arg2: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_get(arg1: *mut EditLine, arg2: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_source(
        arg1: *mut EditLine,
        arg2: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_resize(arg1: *mut EditLine);
}
unsafe extern "C" {
    pub fn el_line(arg1: *mut EditLine) -> *const LineInfo;
}
unsafe extern "C" {
    pub fn el_insertstr(
        arg1: *mut EditLine,
        arg2: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_deletestr(arg1: *mut EditLine, arg2: ::std::os::raw::c_int);
}
unsafe extern "C" {
    pub fn el_replacestr(
        arg1: *mut EditLine,
        arg2: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_deletestr1(
        arg1: *mut EditLine,
        arg2: ::std::os::raw::c_int,
        arg3: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct history {
    _unused: [u8; 0],
}
pub type History = history;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct HistEvent {
    pub num: ::std::os::raw::c_int,
    pub str_: *const ::std::os::raw::c_char,
}
impl Default for HistEvent {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
unsafe extern "C" {
    pub fn history_init() -> *mut History;
}
unsafe extern "C" {
    pub fn history_end(arg1: *mut History);
}
unsafe extern "C" {
    pub fn history(
        arg1: *mut History,
        arg2: *mut HistEvent,
        arg3: ::std::os::raw::c_int,
        ...
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tokenizer {
    _unused: [u8; 0],
}
pub type Tokenizer = tokenizer;
unsafe extern "C" {
    pub fn tok_init(arg1: *const ::std::os::raw::c_char) -> *mut Tokenizer;
}
unsafe extern "C" {
    pub fn tok_end(arg1: *mut Tokenizer);
}
unsafe extern "C" {
    pub fn tok_reset(arg1: *mut Tokenizer);
}
unsafe extern "C" {
    pub fn tok_line(
        arg1: *mut Tokenizer,
        arg2: *const LineInfo,
        arg3: *mut ::std::os::raw::c_int,
        arg4: *mut *mut *const ::std::os::raw::c_char,
        arg5: *mut ::std::os::raw::c_int,
        arg6: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn tok_str(
        arg1: *mut Tokenizer,
        arg2: *const ::std::os::raw::c_char,
        arg3: *mut ::std::os::raw::c_int,
        arg4: *mut *mut *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
pub type wchar_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct lineinfow {
    pub buffer: *const wchar_t,
    pub cursor: *const wchar_t,
    pub lastchar: *const wchar_t,
}
impl Default for lineinfow {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type LineInfoW = lineinfow;
pub type el_rfunc_t = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut EditLine, arg2: *mut wchar_t) -> ::std::os::raw::c_int,
>;
unsafe extern "C" {
    pub fn el_wgets(arg1: *mut EditLine, arg2: *mut ::std::os::raw::c_int) -> *const wchar_t;
}
unsafe extern "C" {
    pub fn el_wgetc(arg1: *mut EditLine, arg2: *mut wchar_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_wpush(arg1: *mut EditLine, arg2: *const wchar_t);
}
unsafe extern "C" {
    pub fn el_wparse(
        arg1: *mut EditLine,
        arg2: ::std::os::raw::c_int,
        arg3: *mut *const wchar_t,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_wset(arg1: *mut EditLine, arg2: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_wget(arg1: *mut EditLine, arg2: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_cursor(arg1: *mut EditLine, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_wline(arg1: *mut EditLine) -> *const LineInfoW;
}
unsafe extern "C" {
    pub fn el_winsertstr(arg1: *mut EditLine, arg2: *const wchar_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn el_wreplacestr(arg1: *mut EditLine, arg2: *const wchar_t) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct histeventW {
    pub num: ::std::os::raw::c_int,
    pub str_: *const wchar_t,
}
impl Default for histeventW {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type HistEventW = histeventW;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct historyW {
    _unused: [u8; 0],
}
pub type HistoryW = historyW;
unsafe extern "C" {
    pub fn history_winit() -> *mut HistoryW;
}
unsafe extern "C" {
    pub fn history_wend(arg1: *mut HistoryW);
}
unsafe extern "C" {
    pub fn history_w(
        arg1: *mut HistoryW,
        arg2: *mut HistEventW,
        arg3: ::std::os::raw::c_int,
        ...
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tokenizerW {
    _unused: [u8; 0],
}
pub type TokenizerW = tokenizerW;
unsafe extern "C" {
    pub fn tok_winit(arg1: *const wchar_t) -> *mut TokenizerW;
}
unsafe extern "C" {
    pub fn tok_wend(arg1: *mut TokenizerW);
}
unsafe extern "C" {
    pub fn tok_wreset(arg1: *mut TokenizerW);
}
unsafe extern "C" {
    pub fn tok_wline(
        arg1: *mut TokenizerW,
        arg2: *const LineInfoW,
        arg3: *mut ::std::os::raw::c_int,
        arg4: *mut *mut *const wchar_t,
        arg5: *mut ::std::os::raw::c_int,
        arg6: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn tok_wstr(
        arg1: *mut TokenizerW,
        arg2: *const wchar_t,
        arg3: *mut ::std::os::raw::c_int,
        arg4: *mut *mut *const wchar_t,
    ) -> ::std::os::raw::c_int;
}