Function

Cogmodules_add_directory

Declaration [src]

void
cog_modules_add_directory (
  const char* directory_path
)

Description [src]

Scans a directory for loadable modules and registers them with the extension points they implement.

Since version 0.20 the directory_path parameter may be NULL, which results in the default module directory chosen at build time to be scanned. Normally this function does not need to be done manually, because the default module directory will be scanned automatically the first time cog_modules_get_preferred() or cog_modules_foreach() is used.

Note that in versions 0.20 and newer this function will skip modules with the same file base name as the ones previously scanned. If two directories contain a module with the same file base name, the one scanned first will be the one used. In particular, this means that calling this function with the same path more than once is allowed.

Parameters

directory_path const char*
 

Directory to scan for loadable modules.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.