X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=third-party%2Fdtl-1.18%2Fexamples%2Fcommon.cpp;fp=third-party%2Fdtl-1.18%2Fexamples%2Fcommon.cpp;h=cd2a9b695a0b72358cee40351ce719ade8360a91;hb=8c946a9012a93ff39534a8cc13a18d441296598f;hp=0000000000000000000000000000000000000000;hpb=5761a96f7859d86c7e2b27e521fa51a8e54c911d;p=wordring-tm%2Fwordring-tm.git diff --git a/third-party/dtl-1.18/examples/common.cpp b/third-party/dtl-1.18/examples/common.cpp new file mode 100644 index 0000000..cd2a9b6 --- /dev/null +++ b/third-party/dtl-1.18/examples/common.cpp @@ -0,0 +1,20 @@ + +#include "common.hpp" + +bool isFileExist (string& fs) { + FILE *fp; + if ((fp = fopen(fs.c_str(), "r")) == NULL) { + return false; + } + fclose(fp); + return true; +} + +bool isFewArgs (int argc, int limit) { + bool ret = false; + if (argc < limit) { + ret = true; + } + return ret; +} +