Lines Matching refs:str

21  *	      Returns NULL in val.str and XK_STR for no match.  
138 XmapStr(CStr *str)
141 xm.str.len = str->len;
142 xm.str.buf = str->buf;
205 val->str.buf = NULL;
206 val->str.len = 0;
239 TryNode(XmapNode *ptr, CStr *str, XmapVal *val, int ntype)
244 if (ptr->ch != *(str->buf)) {
248 if (xm->sibling->ch == *(str->buf))
251 xm->sibling = GetFreeNode(str); /* setup new node */
255 str->buf++;
256 str->len--;
257 if (str->len == 0) {
269 xfree(ptr->val.str.buf);
270 ptr->val.str.len = 0;
286 ptr->val.str.len = val->str.len;
287 len = (val->str.len + 1) * sizeof(*ptr->val.str.buf);
288 ptr->val.str.buf = xmalloc(len);
289 (void) memcpy(ptr->val.str.buf, val->str.buf, len);
299 ptr->next = GetFreeNode(str); /* setup new node */
300 (void) TryNode(ptr->next, str, val, ntype);
334 /* Destroys str */
336 TryDeleteNode(XmapNode **inptr, CStr *str)
344 if (ptr->ch != *(str->buf)) {
348 if (xm->sibling->ch == *(str->buf))
356 str->buf++;
357 str->len--;
359 if (str->len == 0) {
366 else if (ptr->next != NULL && TryDeleteNode(&ptr->next, str) == 1) {
401 xfree(ptr->val.str.buf);
422 ptr->val.str.buf = NULL;
423 ptr->val.str.len = 0;
465 Lookup(struct Strbuf *buf, const CStr *str, const XmapNode *ptr)
470 if (str->len == 0) {
477 if (ptr->ch == *(str->buf)) {
483 tstr.buf = str->buf + 1;
484 tstr.len = str->len - 1;
489 if (str->len == 1) {
502 return (Lookup(buf, str, ptr->sibling));
557 p = unparsestring(&val->str, ntype == XK_STR ? STRQQ : STRBB);
712 unparsestring(const CStr *str, const Char *sep)
718 /* Worst-case is "\uuu" or result of wctomb() for each char from str */
719 buf = xmalloc((str->len + 1) * max(4, MB_LEN_MAX));
728 for (l = 0; l < str->len; l++) {
729 p = str->buf[l];