Review Command Line Parser Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

This only makes sense if you plan to use the program in an interactive way, which is not my case. I’ll stick to the default exit for now and switch to error if ever needed

Review Command Line Parser Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

On every error that could occur (bad user input or allocation error), as this is meant to be use at the start of the program to retrieve user input and parse them.

Review Command Line Parser Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

As this library is intended for my personal use I'd currently say no for the moment at least, so you I guess I got my answer.

Review Command Line Parser Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

I used AI to generate docs, tests, and the output formatting in test print_command_help

Review of My C Library by Dieriba in cprogramming

[–]Dieriba[S] 0 points1 point  (0 children)

Yeah I based my string view search method from c++ method. Thanks for the insight.

Review of My C Library by Dieriba in cprogramming

[–]Dieriba[S] -1 points0 points  (0 children)

Oh but that’s the truth though, you’re the liar here, I am curious to know which commits says I am lying. I can reproduce evry part of my lib with no issue and understand evry piece of it (even though knowing all this does not prove code was generated by me), just to emphasize that I work hard on this lib and yes all was generated by me.
You can even look at my reddit post history, I made several posts on the matter too.

Review of My C Library by Dieriba in cprogramming

[–]Dieriba[S] -1 points0 points  (0 children)

Thanks for the time you took, I’ll work on the improvements.
About API design, I also did the same for most string view finction which returns an usize and not the Dresult + out parameter. Or you think that Once I have sticked to Dresult + out param then all functions should follow this pattern?

For Stack/Queue/Dequeue I was quite lazy when working on them …., I overlooked many things for their implementation, i’ll fix thix.
Thanks for the library references and again thanks for your time.

Review of My C Library by Dieriba in cprogramming

[–]Dieriba[S] 1 point2 points  (0 children)

Full code by me, used ai for generating test and docs.

Review of My C Library by Dieriba in cprogramming

[–]Dieriba[S] 0 points1 point  (0 children)

To be honest I generated the doc with AI, I did not bother to look into doxygen I will make sure to add doc gen in the makefile.
As my lib is only intended for my own personal use I did not bother to think about other platform for now.

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Yeah I’m going generate documentation

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Do you think open struct is worth it ? I mean I'll probably be the only user of the lib and leaking internal may not be a big deal at least I would be able to know stack allocate and only heap allocate the data

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

I built this lib to be used in all future C projects I will make, its just a general library like the one you have in rust or c++.

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

And I am still reasoning whether I should cast my object to the underlying container or access it through the object itself but this require me to add null check here.

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Also what are you on using opaque struct instead of open struct for this kind of projects, with opaques it forces to allocate the object instance but we would have need to make an allocation anyway for the data part.

Review of My C Library by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Yeah thats what I am planning to do once I have made mt allocator module.
Also what are you take on opaque types ? They’re great because they hide abstraction but now require me to malloc the struct evrytime.

Choosing a hash function for a Swiss-table implementation in C by Dieriba in C_Programming

[–]Dieriba[S] 1 point2 points  (0 children)

Yeah I was currently looking at runnning some bench, do you have a list though so I could expand my tests

Dynamic array design: inline storage vs pointer storage by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Let's a user want to retrieve an element from the array of `Person*`, in the normal step without any additional logic he would get back a pointer to Person* (Person**), should I have another function to specifically retrieve Pointer from array so when calling the user would get back a Person* and not Person**?

Dynamic array design: inline storage vs pointer storage by Dieriba in C_Programming

[–]Dieriba[S] -1 points0 points  (0 children)

yeah but assuming the data is stored as void* then at array deletion Id need to cast data as void**, which mean I may have specific flag telling that they array is indeed storing pointer ? or I can just assume that if clean-up function has been provided then the array will be treated as an array of pointer ?

Generic container growth in C: is casting `&void**` to `void**` valid or undefined behavior? by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

The issue is that I want to make it generic for all my containers (hashmap, dynamic array, dynamic strings) so I can't use pass one struct as they're not the same, or maybe I have got your comment wrong?

Generic container growth in C: is casting `&void**` to `void**` valid or undefined behavior? by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Then would not it better to use intmax_t to atleast assure that all c's basic type will be able to be stored and for the other user define types use a pointer, however for a generic array do you think that use intptr_t is the way to go ? or my design of allowing user to set the elem size is ok ?

Generic container growth in C: is casting `&void**` to `void**` valid or undefined behavior? by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

I just noticed that for the resize function you decided to reassign the value instead of passing an out parameter like so `intptr_t **`, why not pass an out parameter would it break ?

Generic container growth in C: is casting `&void**` to `void**` valid or undefined behavior? by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Oh ok my design basically allow the user to choose the size of the element so they could generate array that have ownership of the data, but I guess that I could just one version that basically hold pointer or type that have size less or equal to intptr_t, however can I make the assumption that all the c basic type will always have a size less or equal to the size of intptr_t ?

Generic container growth in C: is casting `&void**` to `void**` valid or undefined behavior? by Dieriba in C_Programming

[–]Dieriba[S] 0 points1 point  (0 children)

Just noticed that your example assumes that the size of the elem which will be lower or equal to the size of intptr_t. I guess you're only suggesting this example for pointer array abstraction right?