#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 260 of file TMidasFile.cxx.
Referenced by TMidasFile::Read().
00261 { 00262 int count = 0; 00263 while (length > 0) 00264 { 00265 int rd = read(fd, buf, length); 00266 if (rd > 0) 00267 { 00268 buf += rd; 00269 length -= rd; 00270 count += rd; 00271 } 00272 else if (rd == 0) 00273 { 00274 return count; 00275 } 00276 else 00277 { 00278 return -1; 00279 } 00280 } 00281 return count; 00282 }

1.6.1