Lines Matching full:cs
22 static void comm_strs__remove_if_last(struct comm_str *cs);
41 static refcount_t *comm_str__refcnt(struct comm_str *cs) in comm_str__refcnt() argument
43 return &RC_CHK_ACCESS(cs)->refcnt; in comm_str__refcnt()
46 static const char *comm_str__str(const struct comm_str *cs) in comm_str__str() argument
48 return &RC_CHK_ACCESS(cs)->str[0]; in comm_str__str()
51 static struct comm_str *comm_str__get(struct comm_str *cs) in comm_str__get() argument
55 if (RC_CHK_GET(result, cs)) in comm_str__get()
56 refcount_inc_not_zero(comm_str__refcnt(cs)); in comm_str__get()
61 static void comm_str__put(struct comm_str *cs) in comm_str__put() argument
63 if (!cs) in comm_str__put()
66 if (refcount_dec_and_test(comm_str__refcnt(cs))) { in comm_str__put()
67 RC_CHK_FREE(cs); in comm_str__put()
69 if (refcount_read(comm_str__refcnt(cs)) == 1) in comm_str__put()
70 comm_strs__remove_if_last(cs); in comm_str__put()
72 RC_CHK_PUT(cs); in comm_str__put()
79 RC_STRUCT(comm_str) *cs; in comm_str__new()
81 cs = malloc(sizeof(*cs) + strlen(str) + 1); in comm_str__new()
82 if (ADD_RC_CHK(result, cs)) { in comm_str__new()
84 strcpy(&cs->str[0], str); in comm_str__new()
97 static void comm_strs__remove_if_last(struct comm_str *cs) in comm_strs__remove_if_last() argument
106 if (refcount_read(comm_str__refcnt(cs)) == 1) { in comm_strs__remove_if_last()
109 entry = bsearch(comm_str__str(cs), comm_strs->strs, comm_strs->num_strs, in comm_strs__remove_if_last()