33 " <meta charset=\"utf-8\"> <title>rlHtmlDir</title>\n" 34 " <link rel=\"stylesheet\" type=\"text/css\" href=\"rlhtml.css\">\n" 36 "<body id=\"rlhtmlbody\">\n";
48 rlStat(filename, &statbuf);
51 int maxlen =
sizeof(tmp);
54 if(fl.
load(filename) < 0)
return -1;
56 sprintf(tmp,
"<p>File=%s Size=%ldByte, %ldkByte</p><hr>\n", filename, statbuf.st_size, statbuf.st_size/(1024));
58 text +=
"<pre id=\"rlTextFile\">\n";
62 const char *source = line;
65 while(*source !=
'\0' && i<maxlen)
76 else if(*source ==
'>')
103 int maxlen =
sizeof(tmp);
107 cmd.
printf(
"od -A x -t x1z -v \"%s\"", filename);
111 text +=
"<pre id=\"rlHexdumpFile\">\n";
113 while((line = sp.
readLine()) != NULL)
115 const char *source = line;
116 char *dest = &tmp[0];
118 while(*source !=
'\0' && i<maxlen)
129 else if(*source ==
'>')
const char * htmlTrailer()
int load(const char *filename)
const char * htmlHeader()
int hexdumpFile(const char *filename, rlString &text)
int textFile(const char *filename, rlString &text)
int printf(const char *format,...)
int rlStat(const char *filepath, struct stat *buf)
int spawn(const char *command)