Added getmodulename() public interface.

This commit is contained in:
Guido van Rossum 1990-10-26 15:00:11 +00:00
parent 738d4ddf81
commit 0558a205a3
2 changed files with 12 additions and 0 deletions

View File

@ -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 *));

View File

@ -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