Skip to content

Commit

Permalink
Added getmodulename() public interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Oct 26, 1990
1 parent 738d4dd commit 0558a20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ extern typeobject Moduletype;
extern object *newmoduleobject PROTO((char *));
extern object *getmoduledict PROTO((object *));
extern int setmoduledict PROTO((object *, object *));
extern char *getmodulename PROTO((object *));
11 changes: 11 additions & 0 deletions Objects/moduleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ setmoduledict(m, v)
return 0;
}

char *
getmodulename(m)
object *m;
{
if (!is_moduleobject(m)) {
err_badarg();
return NULL;
}
return getstringvalue(((moduleobject *)m) -> md_name);
}

/* Methods */

static void
Expand Down

0 comments on commit 0558a20

Please sign in to comment.