From 73f4b2eba70160416dcb3de9b6df2423d6a450f8 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Thu, 15 Jun 2023 16:42:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0alias=20=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E7=BB=93=E6=9E=84=E4=BD=93=E5=92=8C=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash-5.1/builtins_rust/alias/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bash-5.1/builtins_rust/alias/lib.rs b/bash-5.1/builtins_rust/alias/lib.rs index 31c989a3..91e11fc4 100644 --- a/bash-5.1/builtins_rust/alias/lib.rs +++ b/bash-5.1/builtins_rust/alias/lib.rs @@ -33,3 +33,31 @@ extern "C" { fn find_function (name:* const libc::c_char)-> *mut SHELL_VAR; fn reset_internal_getopt(); } +pub type SizeT = libc::c_ulong; +#[derive(Copy, Clone)] +#[repr(C)] +pub struct bucket_contents { + pub next: *mut bucket_contents, + pub key: *mut libc::c_char, + pub data: *mut libc::c_void, + pub khash: libc::c_uint, + pub times_found: libc::c_int, +} +pub type BucketContents = bucket_contents; +#[derive(Copy, Clone)] +#[repr(C)] +pub struct hash_table { + pub bucket_array: *mut *mut BucketContents, + pub nbuckets: libc::c_int, + pub nentries: libc::c_int, +} +pub type HashTable = hash_table; +#[derive(Copy, Clone)] +#[repr(C)] +pub struct alias { + pub name: *mut libc::c_char, + pub value: *mut libc::c_char, + pub flags: libc::c_char, +} +pub type AliasT = alias; +pub static AL_REUSABLE:i32 = 0x01; -- Gitee