#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include <assert.h>#include "TMidasFile.h"#include "TMidasEvent.h"
Go to the source code of this file.
Defines | |
| #define | O_LARGEFILE 0 |
Functions | |
| static int | hasSuffix (const char *name, const char *suffix) |
| static int | readpipe (int fd, char *buf, int length) |
| #define O_LARGEFILE 0 |
Referenced by TMidasFile::Open(), and TMidasFile::OutOpen().
| static int hasSuffix | ( | const char * | name, | |
| const char * | suffix | |||
| ) | [static] |
Definition at line 41 of file TMidasFile.cxx.
Referenced by TMidasFile::Open(), and TMidasFile::OutOpen().
00042 { 00043 const char* s = strstr(name,suffix); 00044 if (s == NULL) 00045 return 0; 00046 00047 return (s-name)+strlen(suffix) == strlen(name); 00048 }

| static int readpipe | ( | int | fd, | |
| char * | buf, | |||
| int | length | |||
| ) | [static] |
Definition at line 255 of file TMidasFile.cxx.
Referenced by TMidasFile::Read().
00256 { 00257 int count = 0; 00258 while (length > 0) 00259 { 00260 int rd = read(fd, buf, length); 00261 if (rd > 0) 00262 { 00263 buf += rd; 00264 length -= rd; 00265 count += rd; 00266 } 00267 else if (rd == 0) 00268 { 00269 return count; 00270 } 00271 else 00272 { 00273 return -1; 00274 } 00275 } 00276 return count; 00277 }

1.6.1