More code cleanup
[svmtool++.git] / src / common.h
blob66cb205a9a8261467704622de304a5ca4f6404cf
1 /*
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
19 #ifndef SVMT_COMMON_H
21 #include <time.h>
22 #include <sys/times.h>
23 #include "list.h"
25 #define CLOCKS_PER_SECOND sysconf(_SC_CLK_TCK)
26 #define TRUE 1
27 #define FALSE 0
28 #define KNOWN 11
29 #define UNKNOWN 22
30 #define LEFT_TO_RIGHT 1
31 #define RIGHT_TO_LEFT 2
32 #define LR_AND_RL 3
34 #define TAM_MARK 10
35 #define TAM_POS 10
36 #define TAM_WORD 100
37 #define TAM_LINE 200
39 #define RM_MODEL_FILES 1001
40 #define RM_TEMP_FILES 1002
42 struct nodo_feature_list
44 char mark[TAM_MARK];
45 int n;
46 char *feature;
47 simpleList l;
50 FILE *openFile(const char *name, const char mode[]);
51 void generateFileName(const char *name, const char *added, int numModel, int direction, int what, const char * type, char *out);
53 void showProcessDone(int num,int freq, int isEnd, const char *what);
54 void showProcess(int num, int isEnd);
55 void showTime(const char *what, double real, double utime,double stime);
57 int goToWord(FILE *f, int offset);
59 int readString(FILE *f, char *out);
60 int readTo(FILE *f, char endChar,char endLine,char *out);
61 //void saltarLinea(FILE *f);
63 void qsort(int a[], int lo, int hi);
65 int ordenarStringPorParejas(char *szIn, char *szOut, int depth, char *szInicial);
67 void destroyFeatureList(simpleList *, int);
68 void createFeatureList(char *, simpleList *);
69 void removeFiles(char *, int ,int , int, int);
71 #define SVMT_COMMON_H
72 #endif