]>
Commit | Line | Data |
---|---|---|
e10815f1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | ////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // c interface to AliMDC // | |
21 | // // | |
22 | ////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "mdc.h" | |
25 | #include "AliMDC.h" | |
f2cc4e98 | 26 | #include "AliLog.h" |
e10815f1 | 27 | |
28 | void* alimdcCreate(int compress, int filterMode, | |
5d315e4d | 29 | double maxSizeTagDB, const char* fileNameTagDB, |
30 | const char* guidFileFolder) | |
e10815f1 | 31 | { |
32 | // create an AliMDC object | |
33 | ||
34 | return new AliMDC(compress, kFALSE, AliMDC::EFilterMode(filterMode), | |
5d315e4d | 35 | maxSizeTagDB, fileNameTagDB, |
36 | guidFileFolder); | |
e10815f1 | 37 | |
38 | } | |
39 | ||
40 | int alimdcOpen(void* alimdc, int mode, const char* fileName) | |
41 | { | |
42 | // open a new raw DB | |
43 | ||
44 | return ((AliMDC*)alimdc)->Open(AliMDC::EWriteMode(mode), fileName); | |
45 | } | |
46 | ||
47 | int alimdcProcessEvent(void* alimdc, void* event, int isIovecArray) | |
48 | { | |
49 | // process one event | |
50 | ||
51 | return ((AliMDC*)alimdc)->ProcessEvent(event, isIovecArray); | |
52 | } | |
53 | ||
d21e9888 | 54 | int alimdcGetTotalFileSize(void* alimdc) |
55 | { | |
56 | // return the total current file size | |
57 | ||
58 | return ((AliMDC*)alimdc)->GetTotalSize(); | |
59 | } | |
60 | ||
e10815f1 | 61 | int alimdcClose(void* alimdc) |
62 | { | |
63 | // close the raw DB | |
64 | ||
65 | return ((AliMDC*)alimdc)->Close(); | |
66 | } | |
67 | ||
68 | void alimdcDelete(void* alimdc) | |
69 | { | |
70 | // delete the AliMDC object | |
71 | ||
72 | delete (AliMDC*)alimdc; | |
73 | } | |
f2cc4e98 | 74 | |
75 | void alimdcEnableDebug() | |
76 | { | |
77 | // enable debug and log messages | |
78 | ||
79 | AliLog::EnableDebug(kTRUE); | |
80 | AliLog::SetGlobalLogLevel(AliLog::kMaxType); | |
81 | AliLog::SetGlobalDebugLevel(AliLog::kMaxType); | |
82 | AliLog::SetPrintRepetitions(kFALSE); | |
f07ec911 | 83 | AliLog::SetHandleRootMessages(kTRUE); |
f2cc4e98 | 84 | } |