source: ether_eccad/trunk/API_EXTRACT/src/eccad.h @ 68

Last change on this file since 68 was 68, checked in by cbipsl, 14 years ago

commit v1 eccad

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.7 KB
RevLine 
[68]1#ifndef ECCAD_H_
2#define ECCAD_H_
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <unistd.h>
6
7#include "grid.h"
8#include "cmap.h"
9#include "list.h"
10#include <gd.h>
11#include <libpq-fe.h>
12#include <libpq/libpq-fs.h>
13               
14typedef PGconn* EccadDB;
15
16/** Cet Objet est l'objet principal gérant la connection à la base de donnée ECCAD
17 * ainsi que la récupération de données et métadonées de cette base.
18 */
19 
20//      =======================Constructors/Destructors=======================
21
22/** Constructor, connect to the ECCAD database
23 * @param server The server name
24 * @param dbName The database name
25 * @param user The user name used to connect to the database
26 * @param pass The user's password
27 * @param port The database server's port
28 * @return EccadDB The object containing the connection, NULL if a probleme occurs
29 */
30EccadDB connectEccadDB(const char* server, const char* dbName, const char* user, const char* pass, const char* port);
31                       
32                       
33/** Constructor, connect to the ECCAD database
34 * @param server The server name
35 * @param dbName The database name
36 * @param user The user name used to connect to the database
37 * @param pass The user's password
38 * @return EccadDB The object containing the connection, NULL if a problem occurs
39 */
40EccadDB connectEccadDB_a(char const* server, char const* dbName, char const* user, char const* pass);
41                       
42                       
43/** Constructor, connect to the ECCAD database
44 * @param server The server name
45 * @param dbName The database name
46 * @return EccadDB The object containing the connection, NULL if a problem occurs
47 */
48EccadDB connectEccadDB_b(const char* server, const char* dbName);
49                       
50/** Destructor, closes the connection to the ECCAD database
51 * @param conn The object containing the connection
52 */
53void closeEccadDB(EccadDB conn);
54               
55//      ============================ Functions =====================================
56
57int checkConnectionStatus(EccadDB conn);
58int checkSQLErrors(PGresult* res);
59
60
61
62LIST mapOfParamById(EccadDB conn, int idMap, double mini, double maxi);
63LIST mapOfParam(EccadDB conn, ptrParam p);
64
65void colorAllocate(gdImagePtr im, LIST cmap);
66char * getRaster(const char * dbHost, const char * dbName, 
67                 const char * dbUser, int idGrille, int idMap);
68LIST getGrids(EccadDB db, int idProduct, ptrParam p, ptrZone z,
69                      const char* dateBegin, const char* dateEnd);
70                     
71ptrGrid getGrid(EccadDB db, int idGrille, ptrZone z);
72
73LIST initParams(EccadDB conn);
74
75ptrGridGL extractGridFromDb(EccadDB db, int idGrille, ptrZone z);
76gdImagePtr grid2img(EccadDB db, ptrGrid g, ptrParam p, int idMap);
77
78double* getMaxParam(int idGrid, EccadDB conn);
79double* getMinParam(int idGrid, EccadDB conn);
80
81
82#endif /*ECCAD_H_*/
Note: See TracBrowser for help on using the repository browser.