cÁ´±íʾÀý
CºêʵÀý
Õª×ÔLinuxÄÚºË2.6.21.5Ô´Âë(²¿·Ö)£¬Õ¹Ê¾ÁËÁ´±íµÄÁíÒ»ÖÖʵÏÖ˼·
δ²ÉÓÃANSI C±ê×¼£¬²ÉÓÃGNU C±ê×¼£¬×ñ´ÓGPL°æÈ¨Ðí¿É¡£
struct list_head {
struct list_head *next, *prev;
};
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
static inline void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
static inline void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
entry->next = NULL;
entry->prev = NULL;
}
#define __list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
prefetch(pos->member.next), &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
c´úÂëʵÀý
·¶Àý´úÂëÊÇË«Ïò»·ÐÎÁ´±íµÄ»ù±¾²Ù×÷²¿·ÖµÄʵÀý£¨Î´°üº¬Ḭ̈߳²È«»úÖÆ£©È«²¿×ñ´ÓANSI C±ê×¼
//½Ó¿ÚÉùÃ÷
#ifndef LLIST_H
#define LLIST_H
typedef void node_proc_fun_t(void*);
typedef int node_comp_fun_t(const void*, const void*);
typedef void LLIST_T;
LLIST_T *llist_new(int elmsize);
int llist_delete(LLIST_T*);
int l
Ïà¹ØÎĵµ£º
1¡¢´íÎó(err_return)µÄºê¶¨Òå
#define err_return(num,fmt,args) \
do
{
printf("[%s:%d]"fmt"\n",__FILE__,__LINE__,##args);return(num);
} while(0)
-1 ÊÇreturnµÄ·µ»ØÖµ£¬±íʾÓдíÎó£»
fmt Ê ......
²ÉÓÃ×¢Èëµ½ÆäËû½ø³ÌµÄ·½·¨À´Òþ²Ø×Ô¼ºµÄ½ø³Ì¡£¾ÍÊÇ˵£¬°ÑÄãÏë×öµÄÊÂÇé¼ÄÉúµ½±ðÈ˵Ľø³ÌÀïÃæ¡£±ÈÈçIEʲôµÄ¡£¹ØÓÚ×¢ÈëµÄ·½·¨ºÜ¶à£¬ÏÂÃæÎÒ¸øÄãÒ»¸öDLL×¢ÈëµÄ·½·¨£¬Õâ¸öÊÇÎÒ×öijÍâ¹ÒʱÓùýµÄ´úÂ룬Äã²Î¿¼Ò»Ï°ѡ£
int APIENTRY _tWinMain( HINSTANCE hInstance,
  ......
http://www.cppreference.com/wiki/cn/stl/algorithm/remove
Óï·¨:
#include <algorithm>
forward_iterator remove( forward_iterator start, forward_iterator end, const TYPE& val );
remove Ëã·¨ÒÆ³ý [start,end) ·¶Î§Ö®ÄÚµÄËùÓÐÓë val ÏàµÈµÄÔªËØ¡£
´Ëº¯ÊýµÄ·µ»ØÖµÊÇÒ»¸öµ ......
/*±àд³ÌÐò£¬ÊäÈë2¸öÊýÒÔ¼°¼Ó¼õ³Ë³ýÖеÄijÔËËã·ûºÅ£¬²¢µ÷ÓÃ×Ô¼º±àдµÄº¯Êý¼ÆËãÏàÓ¦µÄ½á¹û*/
#include<stdio.h>
#include<conio.h>
float cal(int a,char sym,int b);
main()
{
int a=0,b=0;
char sym='\0';
float c=0.0;
scanf("%d%c%d",&a,&sym,&b);
c=c ......
#include "mex.h"
#define DWORD long
#define NUMBER_OF_STRUCTS (sizeof(friends)/sizeof(struct phonebook))
#define NUMBER_OF_FIELDS (sizeof(field_names)/sizeof(*field_names))
void mexFunction(int nlhs,
mxArray * plhs[] , int nrhs,const mxArray * pahs[])
{
typedef struc ......