lib: Add API to set program name and version
[cascardo/ovs.git] / lib / util.c
index f4d0f8d..453ade6 100644 (file)
@@ -448,12 +448,12 @@ ovs_strerror(int error)
  *
  * The 'date' and 'time' arguments should likely be called with
  * "__DATE__" and "__TIME__" to use the time the binary was built.
- * Alternatively, the "set_program_name" macro may be called to do this
+ * Alternatively, the "ovs_set_program_name" macro may be called to do this
  * automatically.
  */
 void
-set_program_name__(const char *argv0, const char *version, const char *date,
-                   const char *time)
+ovs_set_program_name__(const char *argv0, const char *version, const char *date,
+                       const char *time)
 {
     char *basename;
 #ifdef _WIN32
@@ -533,11 +533,20 @@ set_subprogram_name(const char *format, ...)
  * caller must not modify or free the returned string.
  */
 const char *
-get_program_version(void)
+ovs_get_program_version(void)
 {
     return program_version;
 }
 
+/* Returns a pointer to a string describing the program name.  The
+ * caller must not modify or free the returned string.
+ */
+const char *
+ovs_get_program_name(void)
+{
+    return program_name;
+}
+
 /* Print the version information for the program.  */
 void
 ovs_print_version(uint8_t min_ofp, uint8_t max_ofp)