added gen-zstd-manual.sh
This commit is contained in:
parent
1fd5b45c6d
commit
f882e132cf
9
contrib/gen_html/gen-zstd-manual.sh
Executable file
9
contrib/gen_html/gen-zstd-manual.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LIBVER_MAJOR_SCRIPT=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ../../lib/zstd.h`
|
||||||
|
LIBVER_MINOR_SCRIPT=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ../../lib/zstd.h`
|
||||||
|
LIBVER_PATCH_SCRIPT=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ../../lib/zstd.h`
|
||||||
|
LIBVER_SCRIPT=$LIBVER_MAJOR_SCRIPT.$LIBVER_MINOR_SCRIPT.$LIBVER_PATCH_SCRIPT
|
||||||
|
|
||||||
|
echo ZSTD_VERSION=$LIBVER_SCRIPT
|
||||||
|
./gen_html $LIBVER_SCRIPT ../../lib/zstd.h ./zstd_manual.html
|
@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (argc < 4) {
|
if (argc < 4) {
|
||||||
cout << "usage: " << argv[0] << " [zstd_version] [input_file] [output_html]" << endl;
|
cout << "usage: " << argv[0] << " [zstd_version] [input_file] [output_html]" << endl;
|
||||||
exit(0);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "zstd " + string(argv[1]) + " Manual";
|
version = "zstd " + string(argv[1]) + " Manual";
|
||||||
@ -98,13 +98,13 @@ int main(int argc, char *argv[]) {
|
|||||||
istream.open(argv[2], ifstream::in);
|
istream.open(argv[2], ifstream::in);
|
||||||
if (!istream.is_open()) {
|
if (!istream.is_open()) {
|
||||||
cout << "Error opening file " << argv[2] << endl;
|
cout << "Error opening file " << argv[2] << endl;
|
||||||
exit(0);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ostream.open(argv[3], ifstream::out);
|
ostream.open(argv[3], ifstream::out);
|
||||||
if (!ostream.is_open()) {
|
if (!ostream.is_open()) {
|
||||||
cout << "Error opening file " << argv[3] << endl;
|
cout << "Error opening file " << argv[3] << endl;
|
||||||
exit(0);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (getline(istream, line)) {
|
while (getline(istream, line)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user