Add chef.h

This commit is contained in:
Aoran Zeng 2025-07-14 13:36:31 +08:00
parent f6d78d0399
commit 06067d35b4
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 22 additions and 9 deletions

20
src/framework/chef.h Normal file
View File

@ -0,0 +1,20 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Name : chef.h
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Peng Gao <gn3po4g@outlook.com>
* Created On : <2025-07-14>
* Last Modified : <2025-07-14>
*
* For chefs (recipe makers) and sometimes framewoker
* ------------------------------------------------------------*/
#pragma once
bool
is_url (const char *str)
{
return (xy_str_start_with (str, "http://") || xy_str_start_with (str, "https://"));
}

View File

@ -9,7 +9,7 @@
* | Yangmoooo <yangmoooo@outlook.com>
* |
* Created On : <2023-08-29>
* Last Modified : <2025-07-12>
* Last Modified : <2025-07-14>
*
* chsrc framework
* ------------------------------------------------------------*/
@ -25,6 +25,7 @@
#include "xy.h"
#include "struct.h"
#include "mirror.c"
#include "chef.h"
#define App_Name "chsrc"
@ -279,14 +280,6 @@ log_cmd_result (bool result, int exit_status)
bool
is_url (const char *str)
{
return (xy_str_start_with (str, "http://") || xy_str_start_with (str, "https://"));
}
#define Quiet_When_Exist 0x00
#define Noisy_When_Exist 0x01
#define Quiet_When_NonExist 0x00