From bce54eb4bafcd8866bfd97133caf5fac95784787 Mon Sep 17 00:00:00 2001 From: yangwentong <425822674@qq.com> Date: Wed, 23 Nov 2022 14:53:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9D=83=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- re2/filtered_re2.cc | 17 ++++++++++++++--- re2/re2.cc | 22 ++++++++++++++-------- re2/regex_internal.h | 15 +++++++++++++++ re2/set.cc | 17 ++++++++++++++--- regex-capi/include/rure.h | 15 +++++++++++++++ regex-capi/src/rure.rs | 14 ++++++++++++++ 6 files changed, 86 insertions(+), 14 deletions(-) diff --git a/re2/filtered_re2.cc b/re2/filtered_re2.cc index a025cc5..0f0f35e 100644 --- a/re2/filtered_re2.cc +++ b/re2/filtered_re2.cc @@ -1,6 +1,17 @@ -// Copyright 2009 The RE2 Authors. All Rights Reserved. -// Use of this source code is governed by a BSD-stylePrefilter -// license that can be found in the LICENSE file. +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: Interface implementation in filtered_re2.h. + ******************************************************************************/ #include #include #include diff --git a/re2/re2.cc b/re2/re2.cc index b406a77..4734a3c 100644 --- a/re2/re2.cc +++ b/re2/re2.cc @@ -1,11 +1,17 @@ -// Copyright 2003-2009 The RE2 Authors. All Rights Reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Regular expression interface RE2. -// -// Originally the PCRE C++ wrapper, but adapted to use -// the new automata-based regular expression engines. +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: Interface implementation in re2.h. + ******************************************************************************/ #include "re2/re2.h" #include diff --git a/re2/regex_internal.h b/re2/regex_internal.h index a05c1e6..b79231c 100644 --- a/re2/regex_internal.h +++ b/re2/regex_internal.h @@ -1,3 +1,18 @@ +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: . + ******************************************************************************/ + // #include "re2/sparse_array.h" #include "regex-capi/include/rure.h" namespace re2 { diff --git a/re2/set.cc b/re2/set.cc index a1c30fa..96ad1fc 100644 --- a/re2/set.cc +++ b/re2/set.cc @@ -1,6 +1,17 @@ -// Copyright 2010 The RE2 Authors. All Rights Reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: Interface implementation in set.h. + ******************************************************************************/ #include "re2/set.h" diff --git a/regex-capi/include/rure.h b/regex-capi/include/rure.h index f51df71..286421e 100644 --- a/regex-capi/include/rure.h +++ b/regex-capi/include/rure.h @@ -1,3 +1,18 @@ +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: Rure.h is a C API. + ******************************************************************************/ + #pragma once #include diff --git a/regex-capi/src/rure.rs b/regex-capi/src/rure.rs index 4e81fdf..84f93e9 100644 --- a/regex-capi/src/rure.rs +++ b/regex-capi/src/rure.rs @@ -1,3 +1,17 @@ +/****************************************************************************** + * Copyright (c) USTC(Suzhou) & Huawei Technologies Co., Ltd. 2022. All rights reserved. + * re2-rust licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: mengning, liuzhitao, yangwentong + * Create: 2022-06-21 + * Description: Rure is a C API to Rust's regex library. + ******************************************************************************/ use std::collections::HashMap; use std::ffi::{CStr, CString}; use std::ops::Deref; -- Gitee