[Openvas-commits] r2893 - in trunk/openvas-client: . nessus nessus/prefs_dialog

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 25 09:09:09 CET 2009


Author: felix
Date: 2009-03-25 09:09:06 +0100 (Wed, 25 Mar 2009)
New Revision: 2893

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c
   trunk/openvas-client/nessus/report.c
Log:
In report module fixed minor issue (use of char* instead of gchar*),
cosmetics in report and prefs_dialog module.

* nessus/report.c: Cosmetics, reformatting, doc.

* nessus/report.c (open_report): Local variable that is freed with
g_free is indeed a gchar*, changed type of local var.

* nessus/prefs_dialog/prefs_dialog.c: Reformatted doc.


Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-03-25 08:07:21 UTC (rev 2892)
+++ trunk/openvas-client/ChangeLog	2009-03-25 08:09:06 UTC (rev 2893)
@@ -1,5 +1,17 @@
 2009-03-25  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
+	In report module fixed minor issue (use of char* instead of gchar*),
+	cosmetics in report and prefs_dialog module.
+
+	* nessus/report.c: Cosmetics, reformatting, doc.
+	
+	* nessus/report.c (open_report): Local variable that is freed with
+	g_free is indeed a gchar*, changed type of local var.
+	
+	* nessus/prefs_dialog/prefs_dialog.c: Reformatted doc.
+
+2009-03-25  Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
 	* nessus/preferences.c (preferences_yes_or_one): Use GLibs pointer to
 	int conversion macro e.g. for 64-Bit compatibility.
 

Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c
===================================================================
--- trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c	2009-03-25 08:07:21 UTC (rev 2892)
+++ trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c	2009-03-25 08:09:06 UTC (rev 2893)
@@ -288,7 +288,7 @@
   }
 
   gtk_icon_factory_add(factory, stock_id, iconset);
-}  
+}
 
 /**
  * @brief Create some openvas specific stock icons.
@@ -870,9 +870,9 @@
 }
 
 /**
- * Sets a ARG_STRING value "yes" or "no" in a preference arglist, if the same
- * key existed as ARG_INT before.
- * 
+ * @brief Sets a ARG_STRING value "yes" or "no" in a preference arglist, if the same
+ * @brief key existed as ARG_INT before.
+ *
  * @param preferences    Preferences arglist.
  * @param prefrence_name Key to look for and eventually set to "yes" or no.
  */
@@ -891,7 +891,7 @@
 }
 
 /**
- * Sets default values to the GTK Widgets hooked in ctrls.
+ * @brief Sets default values to the GTK Widgets hooked in ctrls.
  */
 void
 prefs_dialog_set_defaults (struct context *context, struct arglist *ctrls)
@@ -1164,8 +1164,8 @@
 }
 
 /**
- * Sets a string in a preference arglist as either "yes" or "no",
- * depending on the state (active -> "yes") of a togglebutton.
+ * @brief Sets a string in a preference arglist as either "yes" or "no",
+ * @brief depending on the state (active -> "yes") of a togglebutton.
  * 
  * @param preferences  Servers preference arglist.
  * @param togglebutton A gtk_toggle_button, of which the state will decide the
@@ -1194,7 +1194,7 @@
 }
 
 /**
- * Applies user choices to a context (and its preferences etc.).
+ * @brief Applies user choices to a context (and its preferences etc.).
  * 
  * @param context The context to manipulate
  * @param ctrls   Arglist with all the GTK widgets hooked in.
@@ -1392,7 +1392,7 @@
 }
 
 /**
- * Creates a string from plugin preference radiobuttons.
+ * @brief Creates a string from plugin preference radiobuttons.
  * 
  * @param list Value of arg_get_value(pref->value, "RADIOBUTTONS)
  * @param pref The plugin preference
@@ -1435,7 +1435,8 @@
 
 
 /**
- * Applies the input from the plugins preferences widgets to the arglists.
+ * @brief Applies the input from the plugins preferences widgets to the arglists.
+ * 
  * Is currently called when an attack is started and when the user deselects
  * a scope (e.g. by selecting a different one).
  * XXX Warning:
@@ -1510,7 +1511,8 @@
 
 
 /**
- * To execute, first all preferences (user choices) are applied.
+ * @brief To execute, first all preferences (user choices) are applied.
+ * 
  * Function acts as a callback for menu items and button.
  * 
  * @return Always 0.

Modified: trunk/openvas-client/nessus/report.c
===================================================================
--- trunk/openvas-client/nessus/report.c	2009-03-25 08:07:21 UTC (rev 2892)
+++ trunk/openvas-client/nessus/report.c	2009-03-25 08:09:06 UTC (rev 2893)
@@ -40,13 +40,14 @@
 #include "preferences.h"
 
 /**
- * Get the report filename (report_ctx_dir/report.nbe).
+ * @brief Get the report filename (report_ctx_dir/report.nbe).
+ * 
  * @param context The report- context.
+ * 
  * @return Filename of report (must be freed) or NULL.
  */
 char *
-report_get_filename(context)
-  struct context *context;
+report_get_filename (struct context *context)
 {
   char *report = NULL;
 
@@ -59,11 +60,15 @@
 }
 
 /**
- * Get the filename for a reports certificate cache (report_ctx_dir/certificates).
+ * @brief Get the filename for a reports certificate cache
+ * @brief (report_ctx_dir/certificates).
+ * 
  * @param context The report- context.
+ * 
  * @return Filename for reports certificate cache (must be freed) or NULL.
  */
-char* report_get_certificates_filename(struct context* context)
+char*
+report_get_certificates_filename (struct context* context)
 {
   char* report = NULL;
   if(context->type == CONTEXT_REPORT && context->dir)
@@ -76,8 +81,8 @@
 
 
 /* reports back the highest number */
-int is_there_any_hole(arglist)
- struct arglist * arglist;
+int
+is_there_any_hole (struct arglist * arglist)
 {
  int ret = 0;
  /* Pluto 25.6.00: with three level of return, real sort */
@@ -108,29 +113,33 @@
 #ifdef USE_GTK
 
 /**
- * Copy plugin information
+ * @brief Copy plugin information.
+ * 
  * @param context Context to which duplicates of the plugins will be added.
+ * 
  * @param plugin Plugin-list.
  */
 static void
-copy_plugins(struct context *context, struct nessus_plugin *plugin)
+copy_plugins (struct context *context, struct nessus_plugin *plugin)
 {
   while (plugin)
   {
-    context_add_plugin(context, nessus_plugin_duplicate(plugin));
+    context_add_plugin (context, nessus_plugin_duplicate(plugin));
     plugin = plugin->next;
   }
 }
 
 
 /**
- * Saves report contents.
+ * @brief Saves report contents.
+ * 
  * @param context The context to use (a child context will be created).
  * @param backend The backend index.
+ * 
  * @param name A name for the report (a naming scheme is applied if NULL).
  */
 void
-report_save(struct context* context, int backend, const char* name)
+report_save (struct context* context, int backend, const char* name)
 {
   struct context *report_context;
   char *report_filename;
@@ -215,13 +224,13 @@
 }
 
 
-/*
- * Opens the report
+/**
+ * @brief Opens the report.
  */
 void
-open_report(GtkWidget * dontcare, GtkWidget *nsr)
+open_report (GtkWidget * dontcare, GtkWidget *nsr)
 {
-  const char *filename =
+  const gchar *filename =
     gtk_file_selection_get_filename(GTK_FILE_SELECTION(nsr));
   int be = backend_import_report((char *)filename);
 
@@ -230,23 +239,22 @@
     char *report_name = g_path_get_basename(filename);
 
     report_save(Context, be, report_name);
-    g_free(report_name);
+    g_free (report_name);
   }
 }
 
 
 
 
-/*
- * Menu selection to open the report
+/**
+ * @brief Menu selection to open a report from file, pops up a file selector.
  */
-void open_report_selectfile()
+void
+open_report_selectfile ()
 {
  GtkWidget * nsr;
  nsr = gtk_file_selection_new (_("Load file"));
- /*
-  * CWD
-  */
+
  gtk_file_selection_set_filename (GTK_FILE_SELECTION(nsr), "");
  g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (nsr)->ok_button),
                                "clicked", (GtkSignalFunc) open_report,(void *) nsr );



More information about the Openvas-commits mailing list