Lines Matching refs:self

1264   trio_string_t *self;
1266 self = (trio_string_t *)TRIO_MALLOC(sizeof(trio_string_t));
1267 if (self)
1269 self->content = NULL;
1270 self->length = 0;
1271 self->allocated = 0;
1273 return self;
1285 TRIO_ARGS2((self, delta),
1286 trio_string_t *self,
1294 ? ( (self->allocated == 0) ? 1 : self->allocated * 2 )
1295 : self->allocated + delta;
1297 new_content = (char *)TRIO_REALLOC(self->content, new_size);
1300 self->content = new_content;
1301 self->allocated = new_size;
1318 TRIO_ARGS2((self, length),
1319 trio_string_t *self,
1323 return (self->allocated < length)
1324 ? TrioStringGrow(self, length - self->allocated)
1342 trio_string_t *self;
1344 self = TrioStringAlloc();
1345 if (self)
1347 if (TrioStringGrow(self,
1350 self->content[0] = (char)0;
1351 self->allocated = initial_size;
1355 trio_string_destroy(self);
1356 self = NULL;
1359 return self;
1367 @param self Dynamic string
1371 TRIO_ARGS1((self),
1372 trio_string_t *self)
1374 assert(self);
1376 if (self)
1378 trio_destroy(self->content);
1379 TRIO_FREE(self);
1388 @param self Dynamic string.
1401 TRIO_ARGS2((self, offset),
1402 trio_string_t *self,
1407 assert(self);
1409 if (self->content != NULL)
1411 if (self->length == 0)
1413 (void)trio_string_length(self);
1417 if (offset > (int)self->length)
1419 offset = self->length;
1424 offset += self->length + 1;
1430 result = &(self->content[offset]);
1440 @param self Dynamic String
1448 TRIO_ARGS1((self),
1449 trio_string_t *self)
1453 assert(self);
1455 result = self->content;
1457 self->content = NULL;
1458 self->length = self->allocated = 0;
1467 @param self Dynamic String
1479 TRIO_ARGS2((self, buffer),
1480 trio_string_t *self,
1483 assert(self);
1485 trio_destroy(self->content);
1486 self->content = trio_duplicate(buffer);
1496 TRIO_ARGS1((self),
1497 trio_string_t *self)
1499 assert(self);
1501 return self->allocated;
1510 TRIO_ARGS1((self),
1511 trio_string_t *self)
1513 trio_xstring_append_char(self, 0);
1521 @param self Dynamic string to be modified.
1527 TRIO_ARGS2((self, other),
1528 trio_string_t *self,
1533 assert(self);
1536 length = self->length + other->length;
1537 if (!TrioStringGrowTo(self, length))
1539 trio_copy(&self->content[self->length], other->content);
1540 self->length = length;
1555 TRIO_ARGS2((self, other),
1556 trio_string_t *self,
1561 assert(self);
1564 length = self->length + trio_length(other);
1565 if (!TrioStringGrowTo(self, length))
1567 trio_copy(&self->content[self->length], other);
1568 self->length = length;
1582 TRIO_ARGS2((self, character),
1583 trio_string_t *self,
1586 assert(self);
1588 if ((int)self->length >= trio_string_size(self))
1590 if (!TrioStringGrow(self, 0))
1593 self->content[self->length] = character;
1594 self->length++;
1606 @param self Dynamic string to be modified.
1612 TRIO_ARGS2((self, other),
1613 trio_string_t *self,
1616 assert(self);
1619 return trio_contains(self->content, other->content);
1630 TRIO_ARGS2((self, other),
1631 trio_string_t *self,
1634 assert(self);
1637 return trio_contains(self->content, other);
1648 TRIO_ARGS2((self, other),
1649 trio_string_t *self,
1652 assert(self);
1655 self->length = 0;
1656 return trio_string_append(self, other);
1667 TRIO_ARGS2((self, other),
1668 trio_string_t *self,
1671 assert(self);
1674 self->length = 0;
1675 return trio_xstring_append(self, other);
1689 trio_string_t *self;
1693 self = TrioStringAlloc();
1694 if (self)
1696 self->content = TrioDuplicateMax(other->content, other->length);
1697 if (self->content)
1699 self->length = other->length;
1700 self->allocated = self->length + 1;
1704 self->length = self->allocated = 0;
1707 return self;
1720 trio_string_t *self;
1724 self = TrioStringAlloc();
1725 if (self)
1727 self->content = TrioDuplicateMax(other, trio_length(other));
1728 if (self->content)
1730 self->length = trio_length(self->content);
1731 self->allocated = self->length + 1;
1735 self->length = self->allocated = 0;
1738 return self;
1748 TRIO_ARGS2((self, other),
1749 trio_string_t *self,
1752 assert(self);
1755 return trio_equal(self->content, other->content);
1766 TRIO_ARGS2((self, other),
1767 trio_string_t *self,
1770 assert(self);
1773 return trio_equal(self->content, other);
1784 TRIO_ARGS3((self, max, other),
1785 trio_string_t *self,
1789 assert(self);
1792 return trio_equal_max(self->content, max, other->content);
1803 TRIO_ARGS3((self, max, other),
1804 trio_string_t *self,
1808 assert(self);
1811 return trio_equal_max(self->content, max, other);
1822 TRIO_ARGS2((self, other),
1823 trio_string_t *self,
1826 assert(self);
1829 return trio_equal_case(self->content, other->content);
1840 TRIO_ARGS2((self, other),
1841 trio_string_t *self,
1844 assert(self);
1847 return trio_equal_case(self->content, other);
1858 TRIO_ARGS3((self, max, other),
1859 trio_string_t *self,
1863 assert(self);
1866 return trio_equal_case_max(self->content, max, other->content);
1877 TRIO_ARGS3((self, max, other),
1878 trio_string_t *self,
1882 assert(self);
1885 return trio_equal_case_max(self->content, max, other);
1896 TRIO_ARGS4((self, max, format, datetime),
1897 trio_string_t *self,
1902 assert(self);
1904 return trio_format_date_max(self->content, max, format, datetime);
1915 TRIO_ARGS2((self, character),
1916 trio_string_t *self,
1919 assert(self);
1921 return trio_index(self->content, character);
1932 TRIO_ARGS2((self, character),
1933 trio_string_t *self,
1936 assert(self);
1938 return trio_index_last(self->content, character);
1949 TRIO_ARGS1((self),
1950 trio_string_t *self)
1952 assert(self);
1954 if (self->length == 0)
1956 self->length = trio_length(self->content);
1958 return self->length;
1969 TRIO_ARGS1((self),
1970 trio_string_t *self)
1972 assert(self);
1974 return trio_lower(self->content);
1985 TRIO_ARGS2((self, other),
1986 trio_string_t *self,
1989 assert(self);
1992 return trio_match(self->content, other->content);
2003 TRIO_ARGS2((self, other),
2004 trio_string_t *self,
2007 assert(self);
2010 return trio_match(self->content, other);
2021 TRIO_ARGS2((self, other),
2022 trio_string_t *self,
2025 assert(self);
2028 return trio_match_case(self->content, other->content);
2039 TRIO_ARGS2((self, other),
2040 trio_string_t *self,
2043 assert(self);
2046 return trio_match_case(self->content, other);
2057 TRIO_ARGS2((self, other),
2058 trio_string_t *self,
2061 assert(self);
2064 return trio_substring(self->content, other->content);
2075 TRIO_ARGS2((self, other),
2076 trio_string_t *self,
2079 assert(self);
2082 return trio_substring(self->content, other);
2093 TRIO_ARGS1((self),
2094 trio_string_t *self)
2096 assert(self);
2098 return trio_upper(self->content);