test prog
This commit is contained in:
parent
7987819415
commit
fd53714906
@ -38,11 +38,14 @@ AM_CPPFLAGS = -Wall -Wno-unused -std=c++11 \
|
|||||||
$(DEFS)
|
$(DEFS)
|
||||||
|
|
||||||
noinst_PROGRAMS = textsplit utf8iter fstreewalk rclconfig hldata unac mbox \
|
noinst_PROGRAMS = textsplit utf8iter fstreewalk rclconfig hldata unac mbox \
|
||||||
circache wipedir mimetype
|
circache wipedir mimetype pathut
|
||||||
|
|
||||||
textsplit_SOURCES = trtextsplit.cpp
|
textsplit_SOURCES = trtextsplit.cpp
|
||||||
textsplit_LDADD = ../librecoll.la
|
textsplit_LDADD = ../librecoll.la
|
||||||
|
|
||||||
|
pathut_SOURCES = trpathut.cpp
|
||||||
|
pathut_LDADD = ../librecoll.la
|
||||||
|
|
||||||
mimetype_SOURCES = trmimetype.cpp
|
mimetype_SOURCES = trmimetype.cpp
|
||||||
mimetype_LDADD = ../librecoll.la
|
mimetype_LDADD = ../librecoll.la
|
||||||
|
|
||||||
|
|||||||
49
src/testmains/trpathut.cpp
Normal file
49
src/testmains/trpathut.cpp
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#include "pathut.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
static const char *thisprog;
|
||||||
|
|
||||||
|
static int op_flags;
|
||||||
|
#define OPT_MOINS 0x1
|
||||||
|
#define OPT_r 0x2
|
||||||
|
#define OPT_s 0x4
|
||||||
|
static char usage [] =
|
||||||
|
"pathut\n"
|
||||||
|
;
|
||||||
|
static void
|
||||||
|
Usage(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, const char **argv)
|
||||||
|
{
|
||||||
|
thisprog = argv[0];
|
||||||
|
argc--; argv++;
|
||||||
|
|
||||||
|
while (argc > 0 && **argv == '-') {
|
||||||
|
(*argv)++;
|
||||||
|
if (!(**argv))
|
||||||
|
/* Cas du "adb - core" */
|
||||||
|
Usage();
|
||||||
|
while (**argv)
|
||||||
|
switch (*(*argv)++) {
|
||||||
|
default: Usage(); break;
|
||||||
|
}
|
||||||
|
b1: argc--; argv++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc != 0)
|
||||||
|
Usage();
|
||||||
|
|
||||||
|
cout << "path_home() -> [" << path_home() << "]\n";
|
||||||
|
cout << "path_tildexpand(~) -> [" << path_tildexpand("~") << "]\n";
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user