Portál AbcLinuxu, 11. května 2025 04:33
char buf[50] = {0}; FILE * f = fopen("lincardemu.dat", "r"); fread(buf, 1, 49, f); caid = atoi(buf); fclose(f);
int caid = 0;
root@orangepipc:~/test_lce# ./lincardemu -r
4: caid
** lincardemu.dat: syntax error in assignment value
There were 1 errors reading lincardemu.dat
..syntax error(s) in config file lincardemu.dat
...
int caid ;
char buf[50] = {0};
FILE * f = fopen("lincardemu.dat", "r");
fread(buf, 1, 49, f);
caid = atoi(buf);
printf ("caid %d.\n",caid);
fclose(f);
newcamd_decode_ecm((int)caid, cwsbuf, (int)cwsbuf_len, ins_reply_ok+14, NULL);
...
do lincardemu.dat:
[Irdeto]
caid = 0x609
debug:
caid 0.
skúšam, modifikujem, ale zatial 0 bodov:
int test(){
int test;
char buf[50] = {0};
FILE * f = fopen("caid_ird.dat", "r");
fread(buf, 1, 49, f);
test = strtol(buf, NULL, 16);
printf ("caid %x.\n",test);
fclose(f);
}
hhhhhhhhhhhhhhhhhhhmmmmmmmmmm co ji třeba strčit do statický proměný?? hele
nebo by ji šlo taky strkat jako argument do tý funkce doiredo takže držet si ji někde tam odkaď je ta funkce doiredo jako volaná ;D
static int test = 0;
test = caid();
int caid(){
char buf[50] = {0};
FILE * f = fopen("caid_ird.dat", "r");
fread(buf, 1, 49, f);
test = strtol(buf, NULL, 16);
printf ("caid %x.\n",test);
fclose(f);
}
mi vyhodí chybu:root@orangepipc:~/test_lce# make
OSTARGET='UNIX' uname='Linux' date: 20200122
gcc -Wall -O2 -g -DUNIX -DVERS=\"0.21a\" -c -o irdeto.o irdeto.c
irdeto.c:26:1: warning: data definition has no type or storage class
test = caid();
^
irdeto.c:26:1: warning: type defaults to ‘int’ in declaration of ‘test’ [-Wimplicit-int]
irdeto.c:26:1: error: redefinition of ‘test’
irdeto.c:25:12: note: previous definition of ‘test’ was here
static int test = 0;
^
irdeto.c:26:1: warning: implicit declaration of function ‘caid’ [-Wimplicit-function-declaration]
test = caid();
^
irdeto.c:26:1: error: initializer element is not constant
irdeto.c:25:12: warning: ‘test’ defined but not used [-Wunused-variable]
static int test = 0;
^
irdeto.c: In function ‘caid’:
irdeto.c:35:33: warning: control reaches end of non-void function [-Wreturn-type]
}
^
builtin: recipe for target 'irdeto.o' failed
make: *** [irdeto.o] Error 1
koukni jak tam voni používaj statickou proměnou tps_crypt_type v tom souboru irdeto.c ;D
ten zdrojáček mi nejde stáhnout :'(
wget http://www.streamboard.tv/oscam/attachment/ticket/369/lincardemu-0.21a.tar.gz --2020-01-21 20:21:05-- http://www.streamboard.tv/oscam/attachment/ticket/369/lincardemu-0.21a.tar.gz Překládám www.streamboard.tv (www.streamboard.tv)… 185.165.169.49 Navazuje se spojení s www.streamboard.tv (www.streamboard.tv)|185.165.169.49|:80… spojeno. HTTP požadavek odeslán, program čeká na odpověď… 500 Internal Server Error 2020-01-21 20:21:09 CHYBA 500: Internal Server Error.
int test
definovala len jeden_krát. Teraz ju musím definovať ako v main.c, tak aj v irdeto.c, kde si ju vyžaduje funkcia newcamd_decode_ecm
.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.