📄 sos_cam.h
字号:
#ifndef SOS_CAM_H
#define SOS_CAM_H
#include "sos_types.h"
#include "pid.h"
typedef uint16_t sos_cam_t;
/**
* bind a new key to a new value
*
* @param sos_com_t key
* @param void* value
* @return SOS_OK for success, negative for failure (when key already exists)
*/
extern int8_t ker_cam_add(sos_cam_t key, void *value);
/**
* bind an old key to a new value
*
* @param sos_com_t key
* @param void* new_value
* @return void* the old value if exists, NULL if not
*/
extern void* ker_cam_reassign(sos_cam_t key, void *new_value);
/**
* unbind a key from a vlaue and remove it from the key set
*
* @param sos_com_t key
* @return the value that was mapped to the key
*/
extern void* ker_cam_remove(sos_cam_t key);
/**
* find the value (if any) that is bound to a key
*
* @param sos_com_t key
* @return the value mapped to the key
*/
extern void* ker_cam_lookup(sos_cam_t key);
static inline sos_cam_t ker_cam_key( sos_pid_t pid, uint8_t id )
{
return (((sos_cam_t) pid) << 8) | id;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -