source: PSPA/madxPSPA/tools/numdiff/src/ndiff.h @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.4 KB
Line 
1#ifndef NDIFF_H
2#define NDIFF_H
3
4/*
5 o---------------------------------------------------------------------o
6 |
7 | Numdiff
8 |
9 | Copyright (c) 2012+ laurent.deniau@cern.ch
10 | Gnu General Public License
11 |
12 o---------------------------------------------------------------------o
13 
14   Purpose:
15     numerical diff of files
16     provides the main numdiff loop
17 
18 o---------------------------------------------------------------------o
19*/
20
21#include <stdio.h>
22#include "types.h"
23
24// ----- types
25
26struct utest;
27struct ndiff;
28struct context;
29struct constraint;
30
31// ----- interface
32
33#define T struct ndiff
34
35T*    ndiff_alloc    (FILE *lhs, FILE *rhs, struct context*, int n_);
36void  ndiff_clear    (T*);
37void  ndiff_free     (T*);
38void  ndiff_option   (T*, const int *keep_, const int *blank_, const int *check_);
39
40// high level API
41void  ndiff_loop     (T*);
42
43// low level API
44int   ndiff_skipLine (T*);
45int   ndiff_readLine (T*);
46int   ndiff_gotoLine (T*, const char *tag);
47int   ndiff_fillLine (T*, const char *lhs, const char *rhs);
48
49void  ndiff_diffLine (T*);
50int   ndiff_nextNum  (T*, const struct constraint*); // return 0 if no number is found
51int   ndiff_testNum  (T*, const struct constraint*);
52
53void  ndiff_getInfo  (const T*, int *row_, int *col_, int *cnt_, long *num_);
54int   ndiff_feof     (const T*, int both);
55int   ndiff_isempty  (const T*);
56
57#undef T
58
59// ----- testsuite
60
61#ifndef NTEST
62
63void ndiff_utest (struct utest*);
64
65#endif // NTEST
66#endif
Note: See TracBrowser for help on using the repository browser.