intpathname.c File Reference

#include "gw_wintools.h"
#include "MALLOC.h"

Include dependency graph for intpathname.c:

Go to the source code of this file.

Functions

int C2F (sci_getlongpathname)
int C2F (sci_getshortpathname)


Function Documentation

int C2F ( sci_getshortpathname   ) 

Definition at line 69 of file intpathname.c.

References C2F, CheckLhs, CheckRhs, CreateVarFromPtr, cstk, FALSE, FREE, GetRhsVar, GetType, Lhs, LhsVar, m1, MALLOC, n1, NULL, putlhsvar(), sci_strings, and TRUE.

00070 {
00071         static int l1,n1,m1;
00072         int bOK=FALSE;
00073 
00074         CheckRhs(0,1);
00075         CheckLhs(1,2);
00076 
00077         if (GetType(1) == sci_strings)
00078         {
00079                 char *LongName=NULL;
00080                 char *ShortName=NULL;
00081                 
00082                 GetRhsVar(1,"c",&m1,&n1,&l1);
00083                 LongName=cstk(l1);
00084 
00085                 ShortName=(char*)MALLOC((strlen(LongName)+1)*sizeof(char));
00086 
00087                 #ifdef _MSC_VER
00088                   if (GetShortPathName(LongName,ShortName,(DWORD)strlen(LongName)+1))
00089                   {
00090                           bOK=TRUE;
00091                   }
00092                   else
00093                   {
00094                           strcpy(ShortName,LongName);
00095                           bOK=FALSE;
00096                   }
00097                 #else
00098                   strcpy(ShortName,LongName);
00099                   bOK=FALSE;
00100                 #endif
00101 
00102                 n1=1;
00103                 CreateVarFromPtr( 2, "c",(m1=(int)strlen(ShortName), &m1),&n1,&ShortName);
00104                 LhsVar(1)=2;
00105 
00106                 if (ShortName) {FREE(ShortName);ShortName=NULL;}
00107 
00108                 if (Lhs != 1) /* Lhs == 2 */
00109                 {
00110                         int *bOkOutINT=(int*)MALLOC(sizeof(int));
00111 
00112                         *bOkOutINT=bOK;
00113                         n1=1;
00114                         CreateVarFromPtr(3, "b", &n1, &n1, &bOkOutINT);
00115                         LhsVar(2)=3;
00116                         if (bOkOutINT) {FREE(bOkOutINT);bOkOutINT=NULL;}
00117                 }
00118 
00119                 C2F(putlhsvar)();
00120         
00121         }
00122         else 
00123         {
00124                 Scierror(999,"Not a path string");
00125                 return 0;
00126         }
00127         return 0;
00128         
00129 }

Here is the call graph for this function:

int C2F ( sci_getlongpathname   ) 

Definition at line 8 of file intpathname.c.

References C2F, CheckLhs, CheckRhs, CreateVarFromPtr, cstk, FALSE, FREE, GetRhsVar, GetType, Lhs, LhsVar, m1, MALLOC, MAX_PATH_LONG, n1, NULL, putlhsvar(), sci_strings, and TRUE.

00009 {
00010         static int l1,n1,m1;
00011         int bOK=FALSE;
00012 
00013         CheckRhs(0,1);
00014         CheckLhs(1,2);
00015 
00016         if (GetType(1) == sci_strings)
00017         {
00018                 char *LongName=NULL;
00019                 char *ShortName=NULL;
00020                 
00021                 GetRhsVar(1,"c",&m1,&n1,&l1);
00022                 ShortName=cstk(l1);
00023 
00024                 LongName=(char*)MALLOC(MAX_PATH_LONG*sizeof(char));
00025 
00026                 #ifdef _MSC_VER
00027                   if (GetLongPathName(ShortName,LongName,MAX_PATH_LONG))
00028                   {
00029                           bOK=TRUE;
00030                   }
00031                   else
00032                   {
00033                           strcpy(LongName,ShortName);
00034                           bOK=FALSE;
00035                   }
00036                 #else
00037                   strcpy(LongName,ShortName);
00038                   bOK=FALSE;
00039                 #endif
00040 
00041                 n1=1;
00042                 CreateVarFromPtr( 2, "c",(m1=(int)strlen(LongName), &m1),&n1,&LongName);
00043                 LhsVar(1)=2;
00044 
00045                 if (LongName) {FREE(LongName);LongName=NULL;}
00046 
00047                 if (Lhs != 1) /* Lhs == 2 */
00048                 {
00049                         int *bOkOutINT=(int*)MALLOC(sizeof(int));
00050 
00051                         *bOkOutINT=bOK;
00052                         n1=1;
00053                         CreateVarFromPtr(3, "b", &n1, &n1, &bOkOutINT);
00054                         LhsVar(2)=3;
00055                         if (bOkOutINT) {FREE(bOkOutINT);bOkOutINT=NULL;}
00056                 }
00057 
00058                 C2F(putlhsvar)();
00059         
00060         }
00061         else 
00062         {
00063                 Scierror(999,"Not a path string");
00064                 return 0;
00065         }
00066         return 0;
00067 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:14:03 2007 for Scilab [trunk] by  doxygen 1.5.1