Closed nbes4 closed 2 weeks ago
Thanks for the interest! Your proposed changes to the services infrastructure is logical and I like how it can simplify adding new services. I need a little more time to review, in the mean time I have created a new branch called services-refactor, can you modify your PR to target that branch? I will merge in your code so we have a sandbox before pulling into main. Thanks again for using the project!
Thanks for your reply @mcknly. I changed the base branch of the PR from main
to services-refactor
. No stress about the review π
Awesome, let me know if you find any bugs or discuss the changes.
@nbes4 I've updated the services-refactor
branch with some additional documentation - can you pull the latest and have a look? Start with services.h
, read through all the comments, and see if it all makes sense from a new user perspective.
Also, I put a file header in services.c
, with your github username as author. If you want it to show anything different feel free to change and submit another PR to the branch.
If all is good I will pull it into main. Thanks again for the contribution!
Here's the direct link if it's easier...
@mcknly Looks good! I added some comments to your commit, don't know if GitHub notifies you of them
Hello! Congratulations on such a cool project π, immediately had to play around with it upon reading about it. After reading into the code to start defining my own services, I noticed that the service arrays could be unified into an array containing simple structs to improve a bunch of things (see below).
Instead of maintaining three different arrays, everything goes into an array of simple structs (see
services.c
), like:service_functions
andservice_strings
to have the same orderstartup_services
, just a simple boolean(sizeof(service_strings)/sizeof(service_strings[0]))
just accessservice_descriptors_length
strcmp
to find startup services intaskman_service
just check thestartup
boolextern
in the header file)