diff --git a/src/info.cpp b/src/info.cpp
index 30c696393fe227d09bf9a29a1932e26bf3b335d0..e1b79951af028783e0c84c5aeb405e8424ed42b0 100644
--- a/src/info.cpp
+++ b/src/info.cpp
@@ -1079,3 +1079,10 @@ bool Info::has_exceptions() const {
   return false;
 #endif
 }
+
+/* ---------------------------------------------------------------------- */
+
+char **Info::get_variable_names(int &num) {
+    num = input->variable->nvar;
+    return input->variable->names;
+}
diff --git a/src/info.h b/src/info.h
index 8e7a96d15a2ded6359b33c121cf370a42c471330..fb7ca58c4711dede0b0475114b59419762dbe880 100644
--- a/src/info.h
+++ b/src/info.h
@@ -39,6 +39,8 @@ class Info : protected Pointers {
   bool has_ffmpeg_support() const;
   bool has_exceptions() const;
 
+  char **get_variable_names(int &num);
+
 private:
   void available_styles(FILE * out, int flags);