From 7e145a01a440c15aa3f0c1859cd543f4f7a36d4c Mon Sep 17 00:00:00 2001 From: dacctal Date: Sat, 18 Jul 2026 03:23:44 +0000 Subject: search and list are done!!! --- include/globs.h | 5 +++-- include/search.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 include/search.h (limited to 'include') diff --git a/include/globs.h b/include/globs.h index 9416923..114083e 100644 --- a/include/globs.h +++ b/include/globs.h @@ -68,11 +68,12 @@ panic("allocation of `%s` failed", #ptr); \ } while (0) -#define panic(...) \ +#define panic(...) \ do { \ + char *tmp = strrchr(__FILE__, '/'); \ eprintf(BOLD RED "panic:" COLOR_RESET " line %d, func \"%s\" in file " \ "\"%s\": ", \ - __LINE__, __func__, __FILE_NAME__); \ + __LINE__, __func__, tmp ? tmp + 1 : __FILE__); \ eprintf(__VA_ARGS__); \ eprintf("\n"); \ fflush(stderr); \ diff --git a/include/search.h b/include/search.h new file mode 100644 index 0000000..233537b --- /dev/null +++ b/include/search.h @@ -0,0 +1,27 @@ +/* + + pkgit - package it! + + Copyright (C) 2026 dacctal + 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 2 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 . + +*/ + +#ifndef PKGIT_SEARCH_H +#define PKGIT_SEARCH_H + +void list_installed(void); +void search(char* arg); + +#endif -- cgit v1.2.3