Back to home page

darwin3

 
 

    


File indexing completed on 2024-12-17 18:36:48 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
f92135b0e7 Ed H*0001 /*************************************************  -*- mode: C -*-
                0002  */
                0003 
                0004 /*  Here, we get the definition of the FC_NAMEMANGLE() macro. */
                0005 #include "FC_NAMEMANGLE.h"
                0006 
                0007 #include <stdio.h>
                0008 #include <stdlib.h>
                0009 #include <unistd.h>
                0010 #include <sys/stat.h>
                0011 #include <sys/types.h>
                0012 
                0013 void FC_NAMEMANGLE(mncfsize) ( int *nienc, int *ienc, int *nbyte )
                0014 {
                0015     char name[512];
                0016     struct stat astat;
                0017     int i, j, n;
                0018     char * cenc = 
                0019     {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.,+-=/~\0"};
                0020     int ncenc = 70;
                0021 
                0022     n = ((*nienc) > 200) ? 200 : (*nienc);
                0023     for (i=0; i<n; i++) {
                0024     /* printf("ienc = %d, %c\n", ienc[i], cenc[ienc[i] - 1]); */
                0025     name[i] = cenc[ienc[i] - 1];
                0026     }
                0027     name[n] = '\0';
                0028     /* printf("name = \"%s\", n = %d\n", name, n); */
                0029 
                0030     /*  At this point we have the file name and would like to
                0031      *  determine the file size. */
                0032     if (! stat(name, &astat))
                0033     *nbyte = (int)(astat.st_size);
                0034     else
                0035     *nbyte = -1;
                0036 }
                0037 
                0038