fix: move the new utils into utils.h/c

This commit is contained in:
2024-08-25 15:04:04 +02:00
parent faf362c607
commit e442800779
8 changed files with 98 additions and 188 deletions

View File

@ -1,24 +0,0 @@
/**
* sci - a simple ci system
Copyright (C) 2024 Asger Gitz-Johansen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SCI_ARGV_SPLIT_H
#define SCI_ARGV_SPLIT_H
char** create_argv_shell(const char* str, int* argc_out);
void argv_free(char** argv);
#endif

View File

@ -41,4 +41,11 @@ void per_line(const char* file, line_handler handler);
char* join(const char* a, const char* b);
const char* skip_arg(const char* cp);
char* skip_spaces(const char* str);
int count_argc(const char* str);
char** argv_split(const char* str, int* argc_out);
void argv_free(char** argv);
int which(const char* program_name, char* out_full_program, int max_path);
#endif

View File

@ -1,23 +0,0 @@
/**
* sci - a simple ci system
Copyright (C) 2024 Asger Gitz-Johansen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SCI_WHICH_H
#define SCI_WHICH_H
int which(const char* program_name, char* out_full_program, int max_path);
#endif