62 Commits
Author SHA1 Message Date
Patrick Pelissier e65abed8a9 Fix issue with C++ 2017-12-30 12:05:25 +01:00
Patrick Pelissier 57ec4514d4 Fix bug detected by scan-build 2017-12-30 10:30:49 +01:00
Patrick Pelissier c08504863c Simplify fgets to avoid using strchr (faster & simpler)
Simplify fgets to avoid using strchr (faster & simpler)
Simplify fgets to avoid using strchr (faster & simpler)
2017-12-23 00:39:11 +01:00
Patrick Pelissier 48828f085b Add comment 2017-12-13 21:43:27 +01:00
Patrick Pelissier df73de9e10 Add comments. 2017-12-13 21:41:42 +01:00
Patrick Pelissier a24464cfed Return size of the encoding (in case of) 2017-12-09 18:11:58 +01:00
Patrick Pelissier ca5263b488 Update comments 2017-12-09 16:57:55 +01:00
Patrick Pelissier 5cbae75ed0 Update 2017-12-09 16:54:04 +01:00
Patrick Pelissier d0ecc03abe Add some more assertions 2017-12-09 16:39:58 +01:00
Patrick Pelissier 417571755e Add assertions 2017-12-09 16:39:28 +01:00
Patrick Pelissier f1ed954dd0 Add functions 2017-12-09 16:38:59 +01:00
Patrick Pelissier 5f98cc1eb6 Factorisation 2017-12-09 16:36:46 +01:00
Patrick Pelissier ccb6fd6fb2 Add new function. 2017-12-09 16:35:27 +01:00
Patrick Pelissier b5a0d3dd0f Reformat 2017-12-09 15:58:46 +01:00
Patrick Pelissier c751686640 Update comments 2017-12-09 15:58:24 +01:00
Patrick Pelissier f3efaf951f Add first functions to handle UTF8 strings. 2017-12-09 15:57:32 +01:00
Patrick Pelissier 2e564088b0 Simplify the inclusion of headers. 2017-09-16 10:14:45 +02:00
Patrick Pelissier ea60cd2ae6 Fix issue of write after allocated buffer. 2017-09-14 23:00:40 +02:00
Patrick Pelissier 4c688c1004 Register global oplist for string_t. 2017-09-14 22:56:35 +02:00
Patrick Pelissier fc7b1516e2 Replace getc by fgetc 2017-09-09 23:43:26 +02:00
Patrick Pelissier d008494215 Move from 32 bits alignement constraint to 64 bits alignement constraint. 2017-08-22 23:30:20 +02:00
Patrick Pelissier 44cdfa0c77 Remove use of feof and ferror as it is not needed as the return of fgetc
is sufficent.
2017-08-19 21:05:55 +02:00
Patrick Pelissier f981bc990d Port to new helper function. 2017-08-16 08:17:27 +02:00
Patrick Pelissier 84e7f4ccaf Fix #11
Rename string_pbrk into string_search_pbrk for consistency
2017-08-15 09:23:21 +02:00
Patrick Pelissier d3c139e195 Add assertion 2017-08-14 23:33:08 +02:00
Patrick Pelissier 866e1e0b7a Add new function string_set_n to extract a sub-string from a string. 2017-08-14 23:30:20 +02:00
Patrick Pelissier 010f397349 Rename string_get_length into string_size
<== Uniformisation with the other containers.
2017-08-09 23:44:27 +02:00
Patrick Pelissier 31c6459201 Fix overflow issue. 2017-08-06 23:12:29 +02:00
Patrick Pelissier f0c03853f8 Do not activate strlen assume for debug mode.
This will make debug mode faster.

It also fixes a problem with GCC7 which makes
**release**mode slower (since it called strlen!)
2017-08-06 18:29:09 +02:00
Patrick Pelissier a780a7d144 Add string_pbrk 2017-08-02 22:24:12 +02:00
Patrick Pelissier 7165740af3 Add function string_replace_at
(Compatible with C++ interface)
2017-08-02 22:02:49 +02:00
Patrick Pelissier 3fe97a02a8 Add new function string_capacity
Update string_reserve to free memory if string is null and it has to
reserve 0 or 1 bytes.
2017-07-11 09:28:01 +02:00
Patrick Pelissier e0aa57b845 Replace string_shrink2fit by string_reserve (More generic). 2017-07-11 09:21:03 +02:00
Patrick Pelissier ee22399bab Add new assertion. 2017-07-09 19:28:57 +02:00
Patrick Pelissier ac79b462fb Add missing contracts. 2017-07-06 11:48:52 +02:00
Patrick Pelissier 9e5e0a8a51 Add string_fget_word function. 2017-07-06 11:48:02 +02:00
Patrick Pelissier ffe164c09e Comment 2017-07-06 11:00:07 +02:00
Patrick Pelissier 987d50eba6 Improve prototype of fgets so that it handles better EOL.
Return true in case of something has been read.
2017-07-06 10:57:34 +02:00
Patrick Pelissier 5fae797e41 Do not increase size in _fgets if we reach the EOF. 2017-07-05 23:31:33 +02:00
Patrick Pelissier 38413f2452 Fix #10 2017-07-04 23:36:18 +02:00
Patrick Pelissier 78de4bcfe3 Replace cast by assign cast. 2017-05-28 20:56:50 +02:00
Patrick Pelissier 2d34932563 Replace a classic cast by an assign cast. 2017-05-28 20:55:31 +02:00
Patrick Pelissier 63eed93a43 Add missing assertions
Add comments.
2017-05-28 20:50:55 +02:00
Patrick Pelissier ddf0203ad5 Add 'join' method for string 2017-05-03 22:51:22 +02:00
Patrick Pelissier f715cac6cf Fix bug reported by valgrind:
if s1==s2, memcpy call is illegal
 (but unlikely to fail).
2017-05-02 14:52:42 +02:00
Patrick Pelissier 0f6b99c03a Update comments. 2017-05-01 09:08:39 +02:00
Patrick Pelissier d57bae7198 Fix bug. 2017-04-29 22:33:25 +02:00
Patrick Pelissier 58a4135d31 Minor update. 2017-04-29 22:27:38 +02:00
Patrick Pelissier 8d26ff5c00 Add comment 2017-04-08 11:03:38 +02:00
Patrick Pelissier 7b543fb53a Add note. 2017-04-07 17:52:51 +02:00