[beast: 9/10] SFI: remove describe_proc from glue layer



commit d502552088b199fc61e9598be70685c4c1dc7e68
Author: Tim Janik <timj gnu org>
Date:   Sun Oct 8 01:09:38 2017 +0200

    SFI: remove describe_proc from glue layer
    
    Signed-off-by: Tim Janik <timj gnu org>

 sfi/sfiglue.cc      |   19 -------------
 sfi/sfiglue.hh      |    4 +--
 sfi/sfigluecodec.cc |   73 +--------------------------------------------------
 sfi/sfigluecodec.hh |    2 +-
 4 files changed, 3 insertions(+), 95 deletions(-)
---
diff --git a/sfi/sfiglue.cc b/sfi/sfiglue.cc
index 37c60ce..71b4aff 100644
--- a/sfi/sfiglue.cc
+++ b/sfi/sfiglue.cc
@@ -176,25 +176,6 @@ upper_power2 (gulong number)
   return number ? 1 << g_bit_storage (number - 1) : 0;
 }
 
-SfiGlueProc*
-sfi_glue_describe_proc (const gchar *proc_name)
-{
-  SfiGlueContext *context = sfi_glue_fetch_context (G_STRLOC);
-  SfiGlueProc *proc;
-
-  assert_return (proc_name != NULL, NULL);
-
-  proc = context->table.describe_proc (context, proc_name);
-  if (proc && !proc->name)
-    {
-      sfi_glue_proc_unref (proc);
-      proc = NULL;
-    }
-  else if (proc)
-    sfi_glue_gc_add (proc, SfiGlueGcFreeFunc (sfi_glue_proc_unref));
-  return proc;
-}
-
 const gchar**
 sfi_glue_list_proc_names (void)
 {
diff --git a/sfi/sfiglue.hh b/sfi/sfiglue.hh
index f5a9dfc..3fb20e2 100644
--- a/sfi/sfiglue.hh
+++ b/sfi/sfiglue.hh
@@ -39,7 +39,6 @@ typedef struct {
   GParamSpec **params;
 } SfiGlueProc;
 
-SfiGlueProc*   sfi_glue_describe_proc          (const gchar    *proc_name);
 SfiGlueProc*   sfi_glue_proc_ref               (SfiGlueProc    *proc);
 void           sfi_glue_proc_unref             (SfiGlueProc    *proc);
 const gchar**  sfi_glue_list_proc_names        (void);
@@ -55,8 +54,7 @@ typedef struct {
   /* core functions */
   SfiGlueIFace*         (*describe_iface)               (SfiGlueContext *context,
                                                          const gchar    *iface);
-  SfiGlueProc*          (*describe_proc)                (SfiGlueContext *context,
-                                                         const gchar    *proc_name);
+  void                   *describe_proc;
   gchar**               (*list_proc_names)              (SfiGlueContext *context);
   gchar**               (*list_method_names)            (SfiGlueContext *context,
                                                          const gchar    *iface_name);
diff --git a/sfi/sfigluecodec.cc b/sfi/sfigluecodec.cc
index 4ee1950..b0fa591 100644
--- a/sfi/sfigluecodec.cc
+++ b/sfi/sfigluecodec.cc
@@ -8,8 +8,6 @@
 /* --- prototypes --- */
 static SfiGlueIFace*  encoder_describe_iface           (SfiGlueContext *context,
                                                         const gchar    *iface);
-static SfiGlueProc*   encoder_describe_proc            (SfiGlueContext *context,
-                                                        const gchar    *proc_name);
 static gchar**       encoder_list_proc_names           (SfiGlueContext *context);
 static gchar**       encoder_list_method_names         (SfiGlueContext *context,
                                                         const gchar    *iface_name);
@@ -60,7 +58,7 @@ sfi_glue_encoder_context (SfiComPort *port)
 {
   static const SfiGlueContextTable encoder_vtable = {
     encoder_describe_iface,
-    encoder_describe_proc,
+    NULL /*describe_proc*/,
     encoder_list_proc_names,
     encoder_list_method_names,
     encoder_base_iface,
@@ -240,73 +238,6 @@ decoder_describe_iface (SfiGlueDecoder *decoder,
   return rvalue;
 }
 
-static SfiGlueProc*
-encoder_describe_proc (SfiGlueContext *context,
-                      const gchar    *proc_name)
-{
-  SfiGlueProc *proc = NULL;
-  SfiRec *rec;
-  SfiSeq *seq = sfi_seq_new ();
-  sfi_seq_append_int (seq, SFI_GLUE_CODEC_DESCRIBE_PROC);
-  sfi_seq_append_string (seq, proc_name);
-
-  seq = encoder_exec_round_trip (context, seq);
-
-  rec = sfi_seq_get_rec (seq, 0);
-  if (rec)
-    {
-      SfiSeq *pseq;
-      GParamSpec *pspec;
-      proc = sfi_glue_proc_new (sfi_rec_get_string (rec, "name"));
-      proc->help = g_strdup (sfi_rec_get_string (rec, "help"));
-      proc->authors = g_strdup (sfi_rec_get_string (rec, "authors"));
-      proc->license = g_strdup (sfi_rec_get_string (rec, "license"));
-      pseq = sfi_rec_get_seq (rec, "params");
-      if (pseq)
-       {
-         guint i;
-         for (i = 0; i < pseq->n_elements; i++)
-           sfi_glue_proc_add_param (proc, sfi_seq_get_pspec (pseq, i));
-       }
-      pspec = sfi_rec_get_pspec (rec, "ret_param");
-      if (pspec)
-       sfi_glue_proc_add_ret_param (proc, pspec);
-    }
-  sfi_seq_unref (seq);
-  return proc;
-}
-
-static GValue*
-decoder_describe_proc (SfiGlueDecoder *decoder,
-                      SfiSeq         *seq)
-{
-  SfiGlueProc *proc = sfi_glue_describe_proc (sfi_seq_get_string (seq, 1));
-  GValue *rvalue = NULL;
-  SfiRec *rec = NULL;
-  if (proc)
-    {
-      rec = sfi_rec_new ();
-      sfi_rec_set_string (rec, "name", proc->name);
-      sfi_rec_set_string (rec, "help", proc->help);
-      sfi_rec_set_string (rec, "authors", proc->authors);
-      sfi_rec_set_string (rec, "license", proc->license);
-      if (proc->ret_param)
-       sfi_rec_set_pspec (rec, "ret_param", proc->ret_param);
-      if (proc->params)
-       {
-         SfiSeq *seq = sfi_seq_new ();
-         guint i;
-         for (i = 0; i < proc->n_params; i++)
-           sfi_seq_append_pspec (seq, proc->params[i]);
-         sfi_rec_set_seq (rec, "params", seq);
-         sfi_seq_unref (seq);
-       }
-    }
-  rvalue = sfi_value_rec (rec);
-  sfi_glue_gc_free_now (proc, SfiGlueGcFreeFunc (sfi_glue_proc_unref));
-  return rvalue;
-}
-
 static inline GValue*
 seq_value_from_strv (const gchar **strv)
 {
@@ -807,8 +738,6 @@ decoder_process_request (SfiGlueDecoder *decoder,
     {
     case SFI_GLUE_CODEC_DESCRIBE_IFACE:
       return decoder_describe_iface (decoder, seq);
-    case SFI_GLUE_CODEC_DESCRIBE_PROC:
-      return decoder_describe_proc (decoder, seq);
     case SFI_GLUE_CODEC_LIST_PROC_NAMES:
       return decoder_list_proc_names (decoder, seq);
     case SFI_GLUE_CODEC_LIST_METHOD_NAMES:
diff --git a/sfi/sfigluecodec.hh b/sfi/sfigluecodec.hh
index f4a2c85..17c5652 100644
--- a/sfi/sfigluecodec.hh
+++ b/sfi/sfigluecodec.hh
@@ -57,7 +57,7 @@ typedef enum /*< skip >*/
   SFI_GLUE_CODEC_ASYNC_MESSAGE,
   SFI_GLUE_CODEC_ASYNC_EVENT,
   SFI_GLUE_CODEC_DESCRIBE_IFACE                        = 129,
-  SFI_GLUE_CODEC_DESCRIBE_PROC,
+  SFI_GLUE_CODEC_UNUSED_2,
   SFI_GLUE_CODEC_LIST_PROC_NAMES,
   SFI_GLUE_CODEC_LIST_METHOD_NAMES,
   SFI_GLUE_CODEC_BASE_IFACE,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]