Added modifiers. These are modules that add additional functionality to the main module.
I can give you an example of another implementation of a string for C in the chars folder. In the first version, there were many variable fields in the chars structure. This turns out to make the module's functions complex. Then I remembered the basic principle of the new programming language C³ is maximum simplicity. So I left only one field in the chars structure, which is a pointer to char. In this way, the structure can be directly converted to a char pointer. The structure has functions to support working with arrays.
You may wonder where the other fields are, such as buffer size and write and read positions? I decided to make them in the form of separate structures, iter, and iter_read. These are modificators. They are added as header files and add functions. You can use many iterators for a single chars structure.
These three structures are combined in a common char_array control structure, which is responsible for automatic control of pointers. It has one pointer each to chars, iter, iter_read.
Iterator modules are modifiers. They add independent fields to the main structure, and additional functions for working with them. Thus, they adopt the prefix of the main structure. The names are chars, chars_iter for writing, chars_iter_read for reading. For now, nesting is one. I plan to increase the number of modifiers.
I'm currently making a parser for the C programming language, and this architecture allows you to use a lot of reading iterators. Thus, part of the structure is passed by reference and by value.
When I pass some structs by the value of *p, then inside the function I get my own instance of the struct that I can modify. For example, for parsing. And if successful, I can apply the changes to the original structure.
In this project, I'm interested in new architectural possibilities, so I can change structures frequently for improvements.
Version 1 is available at https://azhibaev.com/c3.zip
Stay tuned !
Wait, I have a question: Will I be able to use my browser to use Web4? Answer: Yes.
You can also use a text editor to access Web4.
You can use any device to access Web4. Your coffee maker gets access to the Web4 Internet. And your refrigerator too? Yes, your refrigerator can write comments about products on the store's website and can order delivery of products from the store for you when needed. Even your car can move inside Web4 and do everything itself, can find the websites of the nearest stores and gas stations and pay for purchases.
How long does it take to create a website in Web4? Answer: seconds. You just thought that you need a website, and it is already created and launched!
You can read more in my article "Introduction to Web4": https://azhibaev.com/web4.html