xref: /petsc/src/sys/objects/gcookie.c (revision eca87e8d15a60b86ea90ec43a90a0e7530e65b09)
1 #define PETSC_DLL
2 /*
3      Provides utility routines for manulating any type of PETSc object.
4 */
5 #include "petscsys.h"  /*I   "petscsys.h"    I*/
6 
7 #undef __FUNCT__
8 #define __FUNCT__ "PetscObjectGetCookie"
9 /*@C
10    PetscObjectGetCookie - Gets the cookie for any PetscObject,
11 
12    Not Collective
13 
14    Input Parameter:
15 .  obj - any PETSc object, for example a Vec, Mat or KSP.
16          Thus must be cast with a (PetscObject), for example,
17          PetscObjectGetCookie((PetscObject)mat,&cookie);
18 
19    Output Parameter:
20 .  cookie - the cookie
21 
22    Level: developer
23 
24 @*/
25 PetscErrorCode PETSC_DLLEXPORT PetscObjectGetCookie(PetscObject obj,PetscCookie *cookie)
26 {
27   PetscFunctionBegin;
28   PetscValidHeader(obj,1);
29   *cookie = obj->cookie;
30   PetscFunctionReturn(0);
31 }
32 
33