summaryrefslogtreecommitdiffstats
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-10-26 15:00:11 (GMT)
committerGuido van Rossum <guido@python.org>1990-10-26 15:00:11 (GMT)
commit0558a205a37a2570cba43acebbe94d50643024d1 (patch)
tree66ea321c3baf9e9e1689ffc07d098a448a3ea838 /Objects/moduleobject.c
parent738d4ddf813d88de6d1c3c1c225857215fe7c13d (diff)
downloadcpython-0558a205a37a2570cba43acebbe94d50643024d1.zip
cpython-0558a205a37a2570cba43acebbe94d50643024d1.tar.gz
cpython-0558a205a37a2570cba43acebbe94d50643024d1.tar.bz2
Added getmodulename() public interface.
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 09bbae9..22a793f 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -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