|
35 | 35 | #define PROTECTION (S_POSITIVE | 6) |
36 | 36 | #define EOL (S_POSITIVE | 7) |
37 | 37 | #define ALL (S_POSITIVE | 8) |
| 38 | +#define INODE_LO (S_POSITIVE | 9) |
| 39 | +#define INODE_HI (S_POSITIVE | 10) |
38 | 40 |
|
39 | 41 | #define ToLispTime(x) ((int)(x) + 29969152) |
40 | 42 | /* For getfileinfo. For WDATE&RDATE */ |
@@ -310,178 +312,10 @@ do { \ |
310 | 312 | /* * * * * it gave "Too many characters in a character constant" errors! */ |
311 | 313 | #include "lispver1.h" |
312 | 314 | #else /* DOS */ |
313 | | -/* NON-DOS version of the macro LispVersionToUnixVersion */ |
314 | | -#include "lispver2.h" |
| 315 | +/* NON-DOS version is inline in ufs.c */ |
315 | 316 | #endif /* DOS */ |
316 | 317 |
|
317 | | - |
318 | | -/* |
319 | | - * Name: UnixVersionToLispVersion |
320 | | - * |
321 | | - * Argument: char *pathname |
322 | | - * UNIX syntax pathname. |
323 | | - * int vlessp |
324 | | - * If 0, versionless file is converted to version 1. |
325 | | - * Otherwise, remains as versionless. |
326 | | - * |
327 | | - * Value: On success returns 1, otherwise 0. |
328 | | - * |
329 | | - * Side Effect: The version part of pathname is destructively modified. |
330 | | - * |
331 | | - * Description: |
332 | | - * |
333 | | - * Destructively modifies the version part of pathname which is following the |
334 | | - * UNIX file naming convention to Xerox Lisp one. |
335 | | - * This macro should be called, in the routines which convert the UNIX pathname |
336 | | - * to Lisp one, just before it returns the result to Lisp, because converting |
337 | | - * version field will append a semicolon which may confuse the routine |
338 | | - * The file which does not have a valid version field, that is ".~##~" form, is |
339 | | - * dealt with as version 1. |
340 | | - */ |
341 | | - |
342 | | -#define UnixVersionToLispVersion(pathname, vlessp) do { \ |
343 | | - \ |
344 | | - char *start; \ |
345 | | - char *end; \ |
346 | | - char *lf_cp; \ |
347 | | - int ver_no; \ |
348 | | - size_t len; \ |
349 | | - char ver_buf[VERSIONLEN]; \ |
350 | | - \ |
351 | | - if ((start = strchr(pathname, '~')) != NULL) { \ |
352 | | - /* First of all, find the version field in pathname. */ \ |
353 | | - end = start; \ |
354 | | - lf_cp = start + 1; \ |
355 | | - while (*lf_cp) { \ |
356 | | - if (*lf_cp == '~') { \ |
357 | | - start = end; \ |
358 | | - end = lf_cp; \ |
359 | | - lf_cp++; \ |
360 | | - } else { \ |
361 | | - lf_cp++; \ |
362 | | - } \ |
363 | | - } \ |
364 | | - \ |
365 | | - if (start != end && *(start - 1) == '.' && end == (lf_cp - 1)) { \ |
366 | | - /* \ |
367 | | - * pathname ends in the form ".~###~". But we \ |
368 | | - * check ### is a valid number or not. \ |
369 | | - */ \ |
370 | | - len = (end - start) - 1; \ |
371 | | - strncpy(ver_buf, start + 1, len); \ |
372 | | - ver_buf[len] = '\0'; \ |
373 | | - NumericStringP(ver_buf, YES, NO); \ |
374 | | - YES: \ |
375 | | - *(start - 1) = ';'; \ |
376 | | - *start = '\0'; \ |
377 | | - *end = '\0'; \ |
378 | | - /* call strtoul() to eliminate leading 0s. */ \ |
379 | | - ver_no = strtoul(start + 1, (char **)NULL, 10); \ |
380 | | - sprintf(ver_buf, "%u", ver_no); \ |
381 | | - strcat(pathname, ver_buf); \ |
382 | | - goto CONT; \ |
383 | | - \ |
384 | | - NO: \ |
385 | | - /* Dealt with as version 1 unless vlessp */ \ |
386 | | - if (!(vlessp)) strcat(pathname, ";1"); \ |
387 | | - CONT: \ |
388 | | - lf_cp--; /* Just for label */ \ |
389 | | - } else { \ |
390 | | - /* Dealt with as version 1 unless vlessp. */ \ |
391 | | - if (!(vlessp)) strcat(pathname, ";1"); \ |
392 | | - } \ |
393 | | - } else { \ |
394 | | - /* Dealt with as version 1 unless vlessp. */ \ |
395 | | - if (!(vlessp)) strcat(pathname, ";1"); \ |
396 | | - } \ |
397 | | - } while (0) |
398 | | - |
399 | | -/* |
400 | | - * Name: ConcDirAndName |
401 | | - * |
402 | | - * Argument: char *dir The name of the directory. |
403 | | - * char *name The name of a file. |
404 | | - * char *fname The place where the full file name should be |
405 | | - * stored. |
406 | | - * Value: N/A |
407 | | - * |
408 | | - * Side Effect: fname is replaced with the full file name. |
409 | | - * |
410 | | - * Description: |
411 | | - * |
412 | | - * Concatenate the directory name and root file name. Checks if dir contains |
413 | | - * the trail directory delimiter or not. |
414 | | - * |
415 | | - */ |
416 | | - |
417 | | -#define ConcDirAndName(dir, name, fname) do { \ |
418 | | - \ |
419 | | - char *lf_cp1, *lf_cp2; \ |
420 | | - \ |
421 | | - lf_cp1 = dir; \ |
422 | | - lf_cp2 = dir; \ |
423 | | - \ |
424 | | - while (*lf_cp2 != '\0') { \ |
425 | | - switch (*lf_cp2) { \ |
426 | | - \ |
427 | | - case '/': \ |
428 | | - lf_cp1 = lf_cp2; \ |
429 | | - lf_cp2++; \ |
430 | | - break; \ |
431 | | - \ |
432 | | - default: \ |
433 | | - lf_cp2++; \ |
434 | | - break; \ |
435 | | - } \ |
436 | | - } \ |
437 | | - if (lf_cp1 == (lf_cp2 - 1)) { \ |
438 | | - if (lf_cp1 == (dir)) { \ |
439 | | - /* dir is a root directory. */ \ |
440 | | - strcpy(fname, "/"); \ |
441 | | - strcat(fname, name); \ |
442 | | - } else { \ |
443 | | - /* The trail directory is included. */ \ |
444 | | - strcpy(fname, dir); \ |
445 | | - strcat(fname, name); \ |
446 | | - } \ |
447 | | - } else { \ |
448 | | - /* The trail directory is not included */ \ |
449 | | - strcpy(fname, dir); \ |
450 | | - strcat(fname, "/"); \ |
451 | | - strcat(fname, name); \ |
452 | | - } \ |
453 | | - } while (0) |
454 | | - |
455 | | -/* |
456 | | - * Name: ConcNameAndVersion |
457 | | - * |
458 | | - * Argument: char *name The root file name. |
459 | | - * char *ver The file version. |
460 | | - * char *rname The place where the concatenated file name will be |
461 | | - * stored. |
462 | | - * Value: N/A |
463 | | - * |
464 | | - * Side Effect: rname is replaced with the concatenated file name. |
465 | | - * |
466 | | - * Description: |
467 | | - * |
468 | | - * Concatenate the root file name and its version in UNIX format. |
469 | | - * |
470 | | - */ |
471 | | - |
472 | | -#define ConcNameAndVersion(name, ver, rname) do { \ |
473 | | - if (*(ver) != '\0') { \ |
474 | | - strcpy(rname, name); \ |
475 | | - strcat(rname, ".~"); \ |
476 | | - strcat(rname, ver); \ |
477 | | - strcat(rname, "~"); \ |
478 | | - } else { \ |
479 | | - strcpy(rname, name); \ |
480 | | - } \ |
481 | | -} while (0) |
482 | | - |
483 | | -#define VERSIONLEN 16 |
484 | | - |
| 318 | +#define VERSIONLEN 24 |
485 | 319 | #define MAXVERSION 999999999 |
486 | 320 |
|
487 | 321 | #define LASTVERSIONARRAY ((unsigned) -1) |
|
0 commit comments