]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Mon, 22 May 2000 11:49:00 +0000 (11:49 +0000)
committerhades <hades>
Mon, 22 May 2000 11:49:00 +0000 (11:49 +0000)
hadaq/ansiTape.c
hadaq/ansiTape.h
hadaq/ansiTapeLabel.c

index 23e6b6bee90108b1e6da04e081e398e1144b0c8a..c82ff84f74d2b5a35def87e7ddd15bb9fb68e946 100644 (file)
 #include "ansiTape.h"
 
 AnsiTape *openAnsiTape(const char* filename) {
+#if defined(MTIOCTOP)
        int tape;
        int fileSeqNum = 0;
        int stat;
        int i = 0;
-
        char *vol;
        char *label;
 
@@ -43,7 +43,13 @@ AnsiTape *openAnsiTape(const char* filename) {
                exit(-2);
        }
 
+#if defined(MTEOM)
+       mtoper->mt_op = MTEOM;
+#elif defined(MTSEOD)
        mtoper->mt_op = MTSEOD;
+#else
+#error Unknown ioctl operation
+#endif
        mtoper->mt_count = 1;
        stat = ioctl(tape, MTIOCTOP, mtoper);
        if (stat == -1) {
@@ -138,9 +144,14 @@ AnsiTape *openAnsiTape(const char* filename) {
        thisAnsiTape->fileSeqNum = fileSeqNum;
 
        return thisAnsiTape;
+#else
+       return NULL;
+#endif
 }
 
-int writeAnsiTape(AnsiTape *openTape, const char *src, size_t size) {
+int writeAnsiTape(AnsiTape *openTape, const char *src, size_t size)
+{
+#if defined(MTIOCTOP)
        int returnValue = 0;
        while(size >= BLOCKSIZE - openTape->bufferFull) {
                if (openTape->bufferFull < BLOCKSIZE) {
@@ -160,9 +171,13 @@ int writeAnsiTape(AnsiTape *openTape, const char *src, size_t size) {
                returnValue += size;
        }
        return returnValue;
+#else
+       return -1;
+#endif
 }
 
 int closeAnsiTape(AnsiTape *openTape) {
+#if defined(MTIOCTOP)
        int stat;
        struct mtop mtoperS, *mtoper = &mtoperS;
        if(openTape->bufferFull != 0) {
@@ -197,5 +212,8 @@ int closeAnsiTape(AnsiTape *openTape) {
        }
 
        return 0;
+#else
+       return -1;
+#endif
 }
 
index 28b29acfa6a4c9938293aab13653c75cda401d74..444259376a5188fe3dd4a503b7a2d1c51edb426b 100644 (file)
@@ -3,10 +3,6 @@
 
 #define BLOCKSIZE 8192
 
-#ifdef UNIX
-  #define MTEOM MTSEOD
-#endif
-
 typedef struct AnsiTapeS {
        int fd;
 
index bd037bf35fa95a26ba3895127957c733ab7c1d6c..c9cd1cd859e358ac752adc37878e77a2332c4ca2 100644 (file)
@@ -55,12 +55,7 @@ int writeNewVolumeLabel(const char *volId, const char *ownerId, int tape) {
        char *vol, *oid;
        int stat;
 
-#ifidef LINUX
-       const char *impId = "LINUXHADAQ023";
-#endif
-#ifdef UNIX
-       const char *impId = "UNIXHADAQ0023";
-#endif
+       const char *impId = "    HADAQ0023";
 
        vol = allocMem(80*sizeof(char));
 
@@ -91,17 +86,9 @@ int writeLabel(const char *hdreof, int tape, int fileSeqNum, int bytes, const ch
        char *creaCent;
        char label[81];
        char fn[37];
-#ifdef LINUX
-       const char *impId = "LINUXHADAQ023";
-#endif
-#ifdef UNIX
-       const char *impId = "UNIXHADAQ0023";
-#endif
-#ifndef LINUX
-  #ifndef UNIX
+
        const char *impId = "    HADAQ0023";
-  #endif
-#endif
+
        uid_t uid;
        char *user;
        time_t tim;