diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9a159e1c90..4d01b421df 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +2001-06-10 18:35 GMT+3 Alexander Kresin + * source/pp/pplib.c + + __PP_PATH( cPath, lClear ) added + * This function sets path for following #include's and clears existing + paths if lClear is passed and is TRUE + 2001-06-10 15:06 GMT+2 Maurilio Longo * source/rtl/memoedit.prg ! fixed error in handling of text (EOL delimiters handling was wrong) diff --git a/harbour/source/pp/pplib.c b/harbour/source/pp/pplib.c index d5da052686..65e1ffcb35 100644 --- a/harbour/source/pp/pplib.c +++ b/harbour/source/pp/pplib.c @@ -143,6 +143,35 @@ HB_FUNC( __PP_INIT ) } } +HB_FUNC( __PP_PATH ) +{ + PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext; + + if( ISLOG( 2 ) && hb_parl( 2 ) ) + { + while( pPath ) + { + pPathNext = pPath->pNext; + hb_xfree( pPath->szPath ); + hb_xfree( pPath ); + pPath = pPathNext; + } + } + if( ISCHAR( 1 ) ) + { + char * cDelim; + char * cPath = hb_parc( 1 ); + + while( ( cDelim = strchr( cPath, OS_PATH_LIST_SEPARATOR ) ) != NULL ) + { + *cDelim = '\0'; + AddSearchPath( cPath, &hb_comp_pIncludePath ); + cPath = cDelim + 1; + } + AddSearchPath( cPath, &hb_comp_pIncludePath ); + } +} + HB_FUNC( __PP_FREE ) { PATHNAMES * pPath = hb_comp_pIncludePath, * pPathNext;