ubinos
ubiclib.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Sung Ho Park
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef UBICLIB_H_
8 #define UBICLIB_H_
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
23 #include <ubinos_config.h>
24 #include <ubinos/type.h>
25 
26 #if !defined(__cplusplus)
27 
28 #ifndef min
29 #define min(a,b) \
30  ({ __typeof__ (a) _a = (a); \
31  __typeof__ (b) _b = (b); \
32  _a < _b ? _a : _b; })
33 #endif
34 #ifndef max
35 #define max(a,b) \
36  ({ __typeof__ (a) _a = (a); \
37  __typeof__ (b) _b = (b); \
38  _a > _b ? _a : _b; })
39 #endif
40 
41 #endif /* !defined(__cplusplus) */
42 
52 unsigned int uipow(unsigned int x, unsigned int y);
53 
64 unsigned int uidiv_ceil(register unsigned int x, register unsigned int d);
65 
74 unsigned int uilzc(register unsigned int x);
75 
84 unsigned int uilsb(register unsigned int x);
85 
94 unsigned int uilog2_ceil(register unsigned int x);
95 
104 unsigned int uilog2_floor(register unsigned int x);
105 
114 unsigned int uinlp2(register unsigned int x);
115 
124 unsigned int uienlp2(register unsigned int x);
125 
134 unsigned int uimsb(register unsigned int x);
135 
144 unsigned int uiones(register unsigned int x);
145 
146 #include <ubinos/ubiclib/logm.h>
147 #include <ubinos/ubiclib/bitmap.h>
148 #include <ubinos/ubiclib/cirbuf.h>
149 #include <ubinos/ubiclib/cbuf.h>
150 #include <ubinos/ubiclib/dlist.h>
151 #include <ubinos/ubiclib/edlist.h>
152 #include <ubinos/ubiclib/heap.h>
153 #include <ubinos/ubiclib/list.h>
154 #include <ubinos/ubiclib/stdlib.h>
155 #include <ubinos/ubiclib/cli.h>
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* UBICLIB_H_ */
ubiclib bitmap API
ubiclib simple circular buffer API
ubiclib circular buffer API
ubiclib command line interface API
ubiclib double linked list API
ubiclib embedded double linked list API
ubiclib heap API
ubiclib list API
ubiclib (Ubinos C Library) 컴포넌트 로그 메세지 인터페이스
stdlib (Standard Library) API
ubinos basic data type
unsigned int uilzc(register unsigned int x)
unsigned int uilog2_ceil(register unsigned int x)
unsigned int uiones(register unsigned int x)
unsigned int uipow(unsigned int x, unsigned int y)
unsigned int uilsb(register unsigned int x)
unsigned int uimsb(register unsigned int x)
unsigned int uilog2_floor(register unsigned int x)
unsigned int uinlp2(register unsigned int x)
unsigned int uienlp2(register unsigned int x)
unsigned int uidiv_ceil(register unsigned int x, register unsigned int d)