1: /*$Id: pgname.c,v 1.26 2001/03/23 23:20:38 balay Exp $*/
3: #include petsc.h
5: /*@C
6: PetscObjectGetName - Gets a string name associated with a PETSc object.
8: Not Collective
10: Input Parameters:
11: + obj - the Petsc variable
12: Thus must be cast with a (PetscObject), for example,
13: PetscObjectGetName((PetscObject)mat,&name);
14: - name - the name associated with obj
16: Level: intermediate
18: Concepts: object name
20: .seealso: PetscObjectSetName()
21: @*/
22: int PetscObjectGetName(PetscObject obj,char *name[])
23: {
27: if (!obj) SETERRQ(PETSC_ERR_ARG_CORRUPT,"Null object");
28: if (!name) SETERRQ(PETSC_ERR_ARG_BADPTR,"Void location for name");
29: if (!obj->name) {
30: PetscObjectName(obj);
31: }
32: *name = obj->name;
33: return(0);
34: }