diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-17 21:15:12 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-17 21:15:12 +0000 |
| commit | 8df9466ada46e4b07990b9cb7e8b1cd61b96844a (patch) | |
| tree | 2cb652e5839bed672133ffa90e7ad477f55cfb6b /PICA_common.h | |
| download | pica-pica-8df9466ada46e4b07990b9cb7e8b1cd61b96844a.tar.gz pica-pica-8df9466ada46e4b07990b9cb7e8b1cd61b96844a.zip | |
todo list update
git-svn-id: svn://localhost/project_picapica/trunk@128 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'PICA_common.h')
| -rw-r--r-- | PICA_common.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/PICA_common.h b/PICA_common.h new file mode 100644 index 0000000..bc95be1 --- /dev/null +++ b/PICA_common.h @@ -0,0 +1,41 @@ +#ifndef PICA_COMMON_H +#define PICA_COMMON_H + +#ifdef WIN32 +#define CLOSE closesocket +#define SHUTDOWN(s) shutdown(s,SD_BOTH) +#else +#define CLOSE close +#define SHUTDOWN(s) shutdown(s,SHUT_RDWR) +#endif + +#ifdef WIN32 +#define MSG_NOSIGNAL 0 +#endif + + +//call func for each linked list item +#define LISTMAP(listname,type,func,arg) \ +{struct type *p;\ +p= listname ## _list_head;\ +while(p)\ +{func(p,arg);p=p->next;}\ +} + +#define LISTSEARCH(listname,type, item, value,itemptr) \ +{\ +struct type *p;\ +p= listname ## _list_head;\ +while(p)\ + {\ + if (p-> item == value)\ + {\ + itemptr=p;\ + break;\ + }\ + p=p->next;\ + }\ +} + + +#endif |
