• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/netatalk-2.2.0/bin/megatron/

Lines Matching defs:single

54 } 		single;
61 * to contain a AppleSingle file. an single struct will be allocated and
71 single.filed = fileno( stdin );
72 } else if (( single.filed = open( singlefile, flags )) < 0 ) {
76 strncpy( single.path, singlefile, MAXPATHLEN );
78 fprintf( stderr, "opened %s for read\n", single.path );
99 return( close( single.filed ));
101 if (( strcmp( single.path, STDIN ) != 0 ) &&
102 ( unlink( single.path ) < 0 )) {
103 perror ( single.path );
138 single.entry[ n ].ade_off = 0;
139 single.entry[ n ].ade_len = 0;
147 if ( read( single.filed, (char *)entry_buf, AD_ENTRY_LEN )
154 memcpy(&single.entry[ entry_id ].ade_off,
156 sizeof( single.entry[ entry_id ].ade_off ));
157 single.entry[ entry_id ].ade_off =
158 ntohl( single.entry[ entry_id ].ade_off );
159 memcpy(&single.entry[ entry_id ].ade_len,
161 sizeof( single.entry[ entry_id ].ade_len ));
162 single.entry[ entry_id ].ade_len =
163 ntohl( single.entry[ entry_id ].ade_len );
166 fprintf( stderr, "\toffset\t\t%d\n", single.entry[ entry_id ].ade_off );
167 fprintf( stderr, "\tlength\t\t%d\n", single.entry[ entry_id ].ade_len );
177 if ( single.entry[ ADEID_FILEI ].ade_len > 0 )
180 if ( single.entry[ ADEID_FILEDATESI ].ade_len > 0 )
194 if ( single.entry[ ADEID_NAME ].ade_off == 0 ) {
195 fprintf( stderr, "%s has no name for the mac file.\n", single.path );
198 pos = lseek( single.filed, single.entry[ ADEID_NAME ].ade_off,
200 readlen = single.entry[ ADEID_NAME ].ade_len > ADEDLEN_NAME ?
201 ADEDLEN_NAME : single.entry[ ADEID_NAME ].ade_len;
202 if ( read( single.filed, (char *)fh->name, readlen ) != readlen ) {
207 if (( single.entry[ ADEID_FINDERI ].ade_len < ADEDLEN_FINDERI ) ||
208 ( single.entry[ ADEID_FINDERI ].ade_off <= AD_HEADER_LEN )) {
209 fprintf( stderr, "%s has bogus FinderInfo.\n", single.path );
212 pos = lseek( single.filed,
213 single.entry[ ADEID_FINDERI ].ade_off, SEEK_SET );
214 if ( read( single.filed, (char *)entry_buf, ADEDLEN_FINDERI) != ADEDLEN_FINDERI) {
244 if (( single.entry[ ADEID_COMMENT ].ade_len == 0 ) ||
245 ( single.entry[ ADEID_COMMENT ].ade_off <= AD_HEADER_LEN )) {
248 pos = lseek( single.filed, single.entry[ ADEID_COMMENT ].ade_off,
250 readlen = single.entry[ ADEID_COMMENT ].ade_len > ADEDLEN_COMMENT
251 ? ADEDLEN_COMMENT : single.entry[ ADEID_COMMENT ].ade_len;
252 if ( read( single.filed, (char *)fh->comment, readlen ) != readlen ) {
272 } else if ( single.entry[ date_entry ].ade_len != 16 ) {
274 single.path );
277 pos = lseek( single.filed,
278 single.entry[ date_entry ].ade_off, SEEK_SET );
279 if ( read( single.filed, (char *)entry_buf, sizeof( entry_buf )) !=
291 pos = lseek( single.filed,
292 single.entry[ date_entry ].ade_off, SEEK_SET );
293 if ( read( single.filed, (char *)entry_buf, sizeof( entry_buf )) !=
305 if ( single.entry[ ADEID_RFORK ].ade_off == 0 ) {
309 htonl( single.entry[ ADEID_RFORK ].ade_len );
311 if ( single.entry[ ADEID_DFORK ].ade_off == 0 ) {
314 fh->forklen[ DATA ] = htonl( single.entry[ ADEID_DFORK ].ade_len );
315 pos = lseek( single.filed, single.entry[ ADEID_DFORK ].ade_off, SEEK_SET );
343 cc = read( single.filed, (char *)header_buf, sizeof( header_buf ));
351 fprintf( stderr, "%s is not an AppleSingle file.\n", single.path );
362 single.path );
371 single.path );
376 single.path );
411 if (single.entry[entry_id].ade_len > 0x7FFFFFFF) {
412 fprintf(stderr, "single_read: Trying to read past end of fork!, ade_len == %u\n", single.entry[entry_id].ade_len);
415 if ( single.entry[ entry_id ].ade_len == 0 ) {
417 pos = lseek( single.filed,
418 single.entry[ ADEID_RFORK ].ade_off, SEEK_SET );
423 if ( single.entry[ entry_id ].ade_len < length ) {
424 readlen = single.entry[ entry_id ].ade_len;
431 if (( cc = read( single.filed, buf_ptr, readlen )) > 0 ) {
438 single.entry[ entry_id ].ade_len -= cc;