File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ void initImporter(Importer *importer);
2929bool loadModule (Importer * importer , const char * moduleName , void * * result );
3030
3131// Add a directory to the module search path
32- void addSearchPath (Importer * importer , const char * path );
32+ bool addSearchPath (Importer * importer , const char * path );
3333
3434// Free importer resources
3535void freeImporter (Importer * importer );
Original file line number Diff line number Diff line change @@ -27,18 +27,19 @@ void initImporter(Importer *importer) {
2727 addSearchPath (importer , "." );
2828}
2929
30- void addSearchPath (Importer * importer , const char * path ) {
30+ bool addSearchPath (Importer * importer , const char * path ) {
3131 char * * newPaths = (char * * )realloc (importer -> searchPaths , sizeof (char * ) * (importer -> pathCount + 1 ));
32- if (!newPaths ) return ;
32+ if (!newPaths ) return false ;
3333 importer -> searchPaths = newPaths ;
3434
3535 // Duplicate string
3636 size_t len = strlen (path );
3737 char * pathCopy = (char * )malloc (len + 1 );
38- if (!pathCopy ) return ;
38+ if (!pathCopy ) return false ;
3939 strcpy (pathCopy , path );
4040
4141 importer -> searchPaths [importer -> pathCount ++ ] = pathCopy ;
42+ return true;
4243}
4344
4445bool loadModule (Importer * importer , const char * moduleName , void * * result ) {
You can’t perform that action at this time.
0 commit comments