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 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 #define HVB_ATTR_PACKED __attribute__((packed)) 27 28 int hvb_memcmp(const void *src1, const void *src2, size_t n); 29 int hvb_strcmp(const char *s1, const char *s2); 30 int hvb_strncmp(const char *s1, const char *s2, size_t n); 31 void *hvb_memcpy(void *dest, const void *src, size_t n); 32 void *hvb_memset(void *dest, const int c, size_t n); 33 void hvb_print(const char *message); 34 void hvb_printv(const char *message, ...); 35 void *hvb_malloc_(size_t size); 36 void hvb_free(void *ptr); 37 void hvb_abort(void); 38 size_t hvb_strlen(const char *str); 39 uint32_t hvb_div_by_10(uint64_t *dividend); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* __HVB_SYSDEPS_H_ */ 46