Whois: Now uses auto-import.

git-svn-id: svn://kolibrios.org@9658 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2022-01-18 19:50:12 +00:00
parent 22a11dad2b
commit 23e31695bd
2 changed files with 11 additions and 15 deletions

View File

@ -1,11 +1,10 @@
if tup.getconfig("NO_TCC") ~= "" then return end
TCC="kos32-tcc"
CFLAGS = "-I../../develop/ktcc/trunk/libc.obj/include"
LDFAGS = "-nostdlib -L../../develop/ktcc/trunk/bin/lib ../../develop/ktcc/trunk/bin/lib/crt0.o"
LIBS = "-ltcc -lnetwork -lc.obj"
COMMAND=string.format("%s %s %s %s %s", TCC, CFLAGS, LDFAGS, "%f -o %o", LIBS)
tup.rule("whois.c", COMMAND .. tup.getconfig("KPACK_CMD"), "whois")
if tup.getconfig("NO_TCC") ~= "" then return end
if tup.getconfig("HELPERDIR") == ""
then
HELPERDIR = "../../../programs"
end
tup.include(HELPERDIR .. "/use_tcc.lua")
LIBS = "-lnetwork"
link_tcc("whois.c", "whois");

View File

@ -5,8 +5,6 @@ https://www.binarytides.com/whois-client-code-in-c-with-linux-sockets/
*/
#include <errno.h>
int errno;
#include <sys/ksys.h>
#include <stdio.h>
#include <string.h>
@ -41,7 +39,6 @@ char* str_copy(char*);
int main(int argc , char *argv[])
{
networklib_init();
char *domain , *data = NULL;
int f_flag=0;
@ -60,7 +57,7 @@ int main(int argc , char *argv[])
exit(0);
}
if(out==stdout){
con_init_opt(-1,-1,-1,-1, "Whois");
(*con_init_opt)(-1,-1,-1,-1, "Whois");
}
get_whois_data(domain , &data);
exit(0);