mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 12:16:31 +00:00
new: 在devfs中使用键盘文件(仍存在bug)
This commit is contained in:
@ -138,6 +138,26 @@ static inline void list_del(struct List *entry)
|
||||
entry->prev->next = entry->next;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 将新的链表结点替换掉旧的链表结点,并使得旧的结点的前后指针均为NULL
|
||||
*
|
||||
* @param old 要被替换的结点
|
||||
* @param new 新的要换上去的结点
|
||||
*/
|
||||
static inline void list_replace(struct List* old, struct List * new)
|
||||
{
|
||||
if(old->prev!=NULL)
|
||||
old->prev->next=new;
|
||||
new->prev = old->prev;
|
||||
if(old->next!=NULL)
|
||||
old->next->prev = new;
|
||||
new->next = old->next;
|
||||
|
||||
old->prev = NULL;
|
||||
old->next = NULL;
|
||||
}
|
||||
|
||||
|
||||
static inline bool list_empty(struct List *entry)
|
||||
{
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ long strnlen(const char *src, unsigned long maxlen)
|
||||
FirstPart < SecondPart => -1
|
||||
*/
|
||||
|
||||
int strcmp(char *FirstPart, char *SecondPart)
|
||||
int strcmp(const char *FirstPart, const char *SecondPart)
|
||||
{
|
||||
register int __res;
|
||||
__asm__ __volatile__("cld \n\t"
|
||||
|
@ -38,7 +38,7 @@ long strnlen(const char *src, unsigned long maxlen);
|
||||
FirstPart < SecondPart => -1
|
||||
*/
|
||||
|
||||
int strcmp(char *FirstPart, char *SecondPart);
|
||||
int strcmp(const char *FirstPart, const char *SecondPart);
|
||||
|
||||
char *strncpy(char *dst, const char *src, long count);
|
||||
|
||||
|
Reference in New Issue
Block a user