]>
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, | |
e10815f1 | 29 | double maxSizeTagDB, const char* fileNameTagDB) |
30 | { | |
31 | // create an AliMDC object | |
32 | ||
33 | return new AliMDC(compress, kFALSE, AliMDC::EFilterMode(filterMode), | |
e10815f1 | 34 | maxSizeTagDB, fileNameTagDB); |
35 | ||
36 | } | |
37 | ||
38 | int alimdcOpen(void* alimdc, int mode, const char* fileName) | |
39 | { | |
40 | // open a new raw DB | |
41 | ||
42 | return ((AliMDC*)alimdc)->Open(AliMDC::EWriteMode(mode), fileName); | |
43 | } | |
44 | ||
45 | int alimdcProcessEvent(void* alimdc, void* event, int isIovecArray) | |
46 | { | |
47 | // process one event | |
48 | ||
49 | return ((AliMDC*)alimdc)->ProcessEvent(event, isIovecArray); | |
50 | } | |
51 | ||
d21e9888 | 52 | int alimdcGetTotalFileSize(void* alimdc) |
53 | { | |
54 | // return the total current file size | |
55 | ||
56 | return ((AliMDC*)alimdc)->GetTotalSize(); | |
57 | } | |
58 | ||
e10815f1 | 59 | int alimdcClose(void* alimdc) |
60 | { | |
61 | // close the raw DB | |
62 | ||
63 | return ((AliMDC*)alimdc)->Close(); | |
64 | } | |
65 | ||
66 | void alimdcDelete(void* alimdc) | |
67 | { | |
68 | // delete the AliMDC object | |
69 | ||
70 | delete (AliMDC*)alimdc; | |
71 | } | |
f2cc4e98 | 72 | |
73 | void alimdcEnableDebug() | |
74 | { | |
75 | // enable debug and log messages | |
76 | ||
77 | AliLog::EnableDebug(kTRUE); | |
78 | AliLog::SetGlobalLogLevel(AliLog::kMaxType); | |
79 | AliLog::SetGlobalDebugLevel(AliLog::kMaxType); | |
80 | AliLog::SetPrintRepetitions(kFALSE); | |
f07ec911 | 81 | AliLog::SetHandleRootMessages(kTRUE); |
f2cc4e98 | 82 | } |