Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: System freeze - scanning recordings ...
Am Montag, 22. September 2003 21:26 schrieben Sie:
> The funcion readline() needs to be defined, it's no standard function
> found in the headers you include. I assume VDR has an own function called
> readline() hidden somewhere, try looking there for an example.
I have included the function from tools.c PLUS the constant missing. Now the
error message gets even stranger. This is just not my day. Any help welcome.
#include "stdlib.h"
#include <stdio.h>
#define FINDCMD "/usr/bin/find %s -follow -type d -name '%s' 2>
/dev/null;echo"
#define MAXPARSEBUFFER KILOBYTE(10)
char *readline(FILE *f)
{
static char buffer[MAXPARSEBUFFER];
if (fgets(buffer, sizeof(buffer), f) > 0) {
int l = strlen(buffer) - 1;
if (l >= 0 && buffer[l] == '\n')
buffer[l] = 0;
return buffer;
}
return NULL;
}
int main(){
char *cmd = NULL;
asprintf(&cmd, FINDCMD, "/video", "*.rec");
FILE *p = popen(cmd, "r");
char *s;
while ((s = readline(p)) != NULL) {
sprintf(stderr, "%s", *s);
}
pclose(p);
// system(cmd);
return 0;
}
coruscant root # gcc -I /usr/include/ bla.c
bla.c: In function `readline':
bla.c:10: error: storage size of `buffer' isn't constant
bla.c:10: error: size of variable `buffer' is too large
bla.c: In function `main':
bla.c:29: warning: passing arg 1 of `sprintf' from incompatible pointer type
> --
> "It would seem that you have no useful skill or talent whatsoever," he
> said. "Have you thought of going into teaching?"
> -- Terry Pratchett,
> Mort
Really a great book. ;)
--
Thorsten
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.
Home |
Main Index |
Thread Index