Actual source code: dlregisrand.c

  1: #define PETSC_DLL

 3:  #include src/sys/utils/random/randomimpl.h
  4: #if defined (PETSC_HAVE_STDLIB_H)
  5: #include <stdlib.h>
  6: #endif

 10: /*@C
 11:   PetscRandomInitializePackage - This function initializes everything in the PetscRandom package. It is called
 12:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PetscRandomCreate()
 13:   when using static libraries.

 15:   Input Parameter:
 16:   path - The dynamic library path, or PETSC_NULL

 18:   Level: developer

 20: .keywords: PetscRandom, initialize, package
 21: .seealso: PetscInitialize()
 22: @*/
 23: PetscErrorCode  PetscRandomInitializePackage(char *path)
 24: {
 25:   static PetscTruth initialized = PETSC_FALSE;
 26:   PetscErrorCode    ierr;

 29:   if (initialized) return(0);
 30:   initialized = PETSC_TRUE;
 31:   /* Register Classes */
 32:   PetscLogClassRegister(&PETSC_RANDOM_COOKIE,"PetscRandom");
 33:   /* PetscLogClassRegister(&PF_COOKIE,          "PointFunction"); */
 34:   PetscRandomRegisterAll(path);
 35:   /* PFRegisterAll(path); */
 36:   return(0);
 37: }

 39: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 43: /*
 44:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 46:   This one registers all the methods that are in the basic PETSc library.

 48:   Input Parameter:
 49:   path - library path
 50:  */
 51: PetscErrorCode  PetscDLLibraryRegister_petscrandom(char *path)
 52: {

 55:   PetscInitializeNoArguments(); if (ierr) return 1;

 58:   /*
 59:       If we got here then PETSc was properly loaded
 60:   */
 61:   PetscRandomInitializePackage(path);
 62:   return(0);
 63: }

 66: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */