Merge branch 'ansi' into actubent

FossilOrigin-Name: 20178a7975a1b870ab4ab894df61fc934796613cf8ab6d994f230ebe36e879d9
This commit is contained in:
7u83@mail.ru
2018-03-02 12:40:43 +00:00
23 changed files with 1036 additions and 760 deletions

View File

@ -581,40 +581,15 @@ extern struct cw_strlist_elem mbag_item_strings[];
#define cw_strerror(rc) cw_strrc(rc)
*/
static inline const char * cw_strerror(int rc) {
if (rc<0){
if (errno==EAGAIN)
return "Timed out";
return strerror(errno);
}
return cw_strresult(rc);
}
const char * cw_strerror(int rc);
int cw_rcok(int rc);
const char *cw_strelemp_(cw_strheap_t h, int msg_id);
#define cw_strrc cw_strerror
static inline int cw_rcok(int rc)
{
if (rc==0 || rc==2){
return 1;
}
return 0;
}
/**
*@defgroup CW CW
*@{
*/
static inline const char *cw_strelemp_(cw_strheap_t h, int msg_id)
{
const char *rc = cw_strheap_get(h, msg_id);
if (rc)
return rc;
return cw_strheap_get(h, CW_STR_STOP);
}
/**@}*/
#define cw_strelemp(p,id) cw_strelemp_((p)->strelem,id)