2 * Copyright (C) 2004 Jesus Gimenez, Lluis Marquez and Senen Moya
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <sys/times.h>
30 #define CLOCKS_PER_SECOND sysconf(_SC_CLK_TCK)
35 #define LEFT_TO_RIGHT 1
36 #define RIGHT_TO_LEFT 2
44 #define RM_MODEL_FILES 1001
45 #define RM_TEMP_FILES 1002
47 struct nodo_feature_list
54 /* the type of the feature. see marks.h for different types */
56 /* words concerned, eg. (-2, -1, 0) */
61 FILE *openFile(const std::string
& name
, const char mode
[]);
62 void generateFileName(const std::string
& name
, const std::string
& added
, int numModel
, int direction
, int what
, const std::string
& type
, string
& out
);
64 void showProcessDone(int num
,int freq
, int isEnd
, const std::string
& what
);
65 void showProcess(int num
, int isEnd
);
66 //void showTime(char *what, clock_t start,clock_t end, struct tms tbuff1,struct tms tbuff2);
67 void showTime(const std::string
& what
, double real
, double utime
,double stime
);
69 int goToWord(FILE *f
, int offset
);
71 int readString(FILE* f
, string
& out
);
72 int readTo(FILE* f
, char endChar
, char endLine
, string
& out
);
73 //void saltarLinea(FILE *f);
75 void qsort(int a
[], int lo
, int hi
);
77 int ordenarStringPorParejas(const char* szIn
, char* szOut
, int depth
, char* szInicial
);
79 void destroyFeatureList(simpleList
<nodo_feature_list
*> *);
80 void createFeatureList(const std::string
& name
,simpleList
<nodo_feature_list
*> *featureList
);
81 void removeFiles(const std::string
& path
, int type
,int numModel
, int direction
, int verbose
);
82 void Tokenize(const string
& str
, vector
<string
>& tokens
, const string
& delimiters
);