xref: /base/startup/hvb/libhvb/include/hvb_sysdeps.h (revision 7310c0d0)
1/*
2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef __HVB_SYSDEPS_H_
16#define __HVB_SYSDEPS_H_
17
18#include <stdlib.h>
19#include <stdio.h>
20#include <stdint.h>
21#include "securec.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#define HVB_ATTR_PACKED __attribute__((packed))
28
29int hvb_memcmp(const void *src1, const void *src2, size_t n);
30int hvb_strcmp(const char *s1, const char *s2);
31int hvb_strncmp(const char *s1, const char *s2, size_t n);
32void *hvb_memcpy(void *dest, const void *src, size_t n);
33int hvb_memcpy_s(void *dest, size_t destMax, const void *src, size_t count);
34void *hvb_memset(void *dest, const int c, size_t n);
35int hvb_memset_s(void *dest, size_t destMax, int c, size_t count);
36void hvb_print(const char *message);
37void hvb_printv(const char *message, ...);
38void *hvb_malloc_(size_t size);
39void hvb_free(void *ptr);
40void hvb_abort(void);
41size_t hvb_strlen(const char *str);
42size_t hvb_strnlen(const char *str, size_t len);
43uint32_t hvb_div_by_10(uint64_t *dividend);
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif /* __HVB_SYSDEPS_H_ */
50