/* Generated by G-Wrap: an experimental C->Guile wrapper engine */

#include <guile/gh.h>
#include <libguile.h>
#include <string.h>
#include <g-wrap-compatibility.h>

#include "gw-kvp.h"
#include <glib.h>
#include <guid.h>
#include <Query.h>
#include <Backend.h>
#include <Group.h>
#include <gnc-book.h>
#include <gnc-session.h>
#include <gnc-session-scm.h>
#include <gnc-engine-util.h>
#include <gnc-event.h>
#include <gnc-lot.h>
#include <date.h>
#include <engine-helpers.h>
#include <gnc-engine.h>
#include <gnc-commodity.h>
#include <gnc-numeric.h>
#include <g-wrap-wct.h>
#include <glib.h>
#include <g-wrap-glib.h>
#include <g-wrap-wct.h>
#include <kvp_frame.h>
#include <kvp-scm.h>
#include <Transaction.h>
#include <gnc-book.h>
#include <g-wrap-wct.h>
static SCM gw__tmp26_wct_info_for__gnc_Transaction__ = SCM_BOOL_F;
static SCM gw__tmp22_wct_info_for__gnc_Book__ = SCM_BOOL_F;
static SCM gw__tmp558_wct_info_for__gnc_kvp_frame__ = SCM_BOOL_F;
enum GW__ErrorStatus
{
  GW__ERR_NONE,
  GW__ERR_MISC,
  GW__ERR_MEMORY,
  GW__ERR_RANGE,
  GW__ERR_TYPE,
  GW__ERR_ARGC,
  GW__ERR_ARG_RANGE,
  GW__ERR_ARG_TYPE
};
 
static void
gw__handle_wrapper_error(enum GW__ErrorStatus status,
                         const char *func_name,
                         unsigned int arg_pos,
                         const char *misc_msg,
                         SCM scm_data) __attribute__ ((noreturn));

static void
gw__handle_wrapper_error(enum GW__ErrorStatus status,
                         const char *func_name,
                         unsigned int arg_pos,
                         const char *misc_msg,
                         SCM scm_data)
{
  static SCM out_of_range_key = SCM_BOOL_F;
  static SCM wrong_type_key = SCM_BOOL_F;

  if(SCM_FALSEP(out_of_range_key))
    out_of_range_key = scm_permanent_object(scm_c_make_keyword("out-of-range"));
  if(SCM_FALSEP(wrong_type_key))
    wrong_type_key = scm_permanent_object(scm_c_make_keyword("wrong-type"));

  switch(status) {
  case GW__ERR_NONE:
    scm_misc_error(func_name,
                   "asked to handle error when there wasn't one",
                   SCM_EOL);
    break;
  case GW__ERR_MISC:
    /* scm_data is a list of format args for misc_msg */
    scm_misc_error(func_name, misc_msg, scm_data); break;
  case GW__ERR_MEMORY:
    scm_memory_error(func_name); break;
  case GW__ERR_RANGE:
    scm_error (out_of_range_key,
	       func_name,
	       "Out of range: ~S",
               scm_cons (scm_data, SCM_EOL),
	       SCM_BOOL_F);
    break;
  case GW__ERR_TYPE:
    scm_error(wrong_type_key,
              func_name,
              "Wrong type: ",
              scm_cons (scm_data, SCM_EOL),
              SCM_BOOL_F);
    break;
  case GW__ERR_ARGC:
    scm_wrong_num_args(scm_makfrom0str(func_name)); break;
  case GW__ERR_ARG_RANGE:
    /* scm_data is the bad arg */
    scm_out_of_range(func_name, scm_data); break;
  case GW__ERR_ARG_TYPE:
    /* scm_data is the bad arg */
    scm_wrong_type_arg(func_name, arg_pos, scm_data); break;
  default:
    scm_misc_error(func_name,
                   "asked to handle nonexistent gw:error type: ~S",
                   scm_cons(scm_long2num(status), SCM_EOL));    
    break;
  };
  exit(1);
}
static char * gw__tmp560_gnc_kvp_frame_delete_at_path_namestr = "gnc:kvp-frame-delete-at-path";
static SCM gw__tmp559_gnc_kvp_frame_delete_at_path_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;

kvp_frame* gw__c_arg0;
GSList* gw__c_arg1;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp558_wct_info_for__gnc_kvp_frame__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
/* ARG 1 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;

{
{
  SCM gw__tmp573_scm_rest = gw__scm_arg1;
  gw__c_arg1= NULL;
  while(!SCM_NULLP(gw__tmp573_scm_rest)
        && (! (gw__error_status != GW__ERR_NONE)))
  {
    const char * gw__tmp574_c_item;
    SCM gw__tmp575_scm_item = SCM_CAR(gw__tmp573_scm_rest);

gw__tmp574_c_item = NULL;

if(SCM_FALSEP(gw__tmp575_scm_item))
  gw__tmp574_c_item = NULL;
else if(SCM_STRINGP(gw__tmp575_scm_item))
  gw__tmp574_c_item = gh_scm2newstr(gw__tmp575_scm_item, NULL);
else
{
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__tmp575_scm_item;
   goto gw__post_call_arg_1;
}

    if(! (gw__error_status != GW__ERR_NONE) )
    {
       gw__c_arg1 = g_slist_prepend (gw__c_arg1, (gpointer)gw__tmp574_c_item);
    }
    gw__tmp573_scm_rest = SCM_CDR (gw__tmp573_scm_rest);
  }
  if(!(gw__error_status != GW__ERR_NONE))
  {
    gw__c_arg1 = g_slist_reverse(gw__c_arg1);
  }
  else
  {
    GSList * gw__tmp576_cursor = gw__c_arg1;
    while(gw__tmp576_cursor)
    {
      const char * gw__tmp574_c_item;
      gw__tmp574_c_item = ( const char *) gw__tmp576_cursor->data;
if(gw__tmp574_c_item) free((void *) gw__tmp574_c_item);
gw__tmp576_cursor = gw__tmp576_cursor->next;
    }
    g_slist_free(gw__c_arg1);
    gw__c_arg1 = NULL;
  }
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_1;
SCM_DEFER_INTS;
gnc_kvp_frame_delete_at_path (gw__c_arg0, gw__c_arg1);
SCM_ALLOW_INTS;
{
gw__scm_result = SCM_UNSPECIFIED;
}
}
  gw__post_call_arg_1:
{
{
  GSList * gw__tmp578_cursor = gw__c_arg1;
  while(gw__tmp578_cursor)
  {
    const char * gw__tmp577_c_item;
    gw__tmp577_c_item = ( const char *) gw__tmp578_cursor->data;
if(gw__tmp577_c_item) free((void *) gw__tmp577_c_item);
gw__tmp578_cursor = gw__tmp578_cursor->next;
  }
  if(gw__c_arg1)
  {
    g_slist_free(gw__c_arg1);
    gw__c_arg1 = NULL;
  }
}
}
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp560_gnc_kvp_frame_delete_at_path_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp562_kvp_frame_set_slot_namestr = "gnc:kvp-frame-set-slot";
static SCM gw__tmp561_kvp_frame_set_slot_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1, SCM gw__scm_arg2 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;

kvp_frame* gw__c_arg0;
const char * gw__c_arg1;
kvp_value* gw__c_arg2;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp558_wct_info_for__gnc_kvp_frame__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
/* ARG 1 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;

{
gw__c_arg1 = NULL;

if(SCM_FALSEP(gw__scm_arg1))
  gw__c_arg1 = NULL;
else if(SCM_STRINGP(gw__scm_arg1))
  gw__c_arg1 = gh_scm2newstr(gw__scm_arg1, NULL);
else
{
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
/* ARG 2 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_1;

{
if (!(gnc_kvp_value_ptr_p(gw__scm_arg2))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg2;
   goto gw__post_call_arg_2;
}
else {gw__c_arg2 = gnc_scm_to_kvp_value_ptr(gw__scm_arg2);
}if ((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg2;
   goto gw__post_call_arg_2;
}
else if ((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg2;
   goto gw__post_call_arg_2;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_2;
SCM_DEFER_INTS;
kvp_frame_set_slot (gw__c_arg0, gw__c_arg1, gw__c_arg2);
SCM_ALLOW_INTS;
{
gw__scm_result = SCM_UNSPECIFIED;
}
}
  gw__post_call_arg_2:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_1:
{
if(gw__c_arg1) free((void *) gw__c_arg1);
}
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp562_kvp_frame_set_slot_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp564_kvp_frame_get_slot_namestr = "gnc:kvp-frame-get-slot";
static SCM gw__tmp563_kvp_frame_get_slot_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;
kvp_value* gw__c_result;

kvp_frame* gw__c_arg0;
const char * gw__c_arg1;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp558_wct_info_for__gnc_kvp_frame__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
/* ARG 1 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;

{
gw__c_arg1 = NULL;

if(SCM_FALSEP(gw__scm_arg1))
  gw__c_arg1 = NULL;
else if(SCM_STRINGP(gw__scm_arg1))
  gw__c_arg1 = gh_scm2newstr(gw__scm_arg1, NULL);
else
{
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_1;
SCM_DEFER_INTS;
gw__c_result = kvp_frame_get_slot (gw__c_arg0, gw__c_arg1);
SCM_ALLOW_INTS;
{
gw__scm_result = gnc_kvp_value_ptr_to_scm(gw__c_result);
}
}
  gw__post_call_arg_1:
{
if(gw__c_arg1) free((void *) gw__c_arg1);
}
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp564_kvp_frame_get_slot_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp566_kvp_frame_set_slot_path_gslist_namestr = "gnc:kvp-frame-set-slot-path";
static SCM gw__tmp565_kvp_frame_set_slot_path_gslist_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1, SCM gw__scm_arg2 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;

kvp_frame* gw__c_arg0;
kvp_value* gw__c_arg1;
GSList* gw__c_arg2;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp558_wct_info_for__gnc_kvp_frame__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
/* ARG 1 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;

{
if (!(gnc_kvp_value_ptr_p(gw__scm_arg1))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else {gw__c_arg1 = gnc_scm_to_kvp_value_ptr(gw__scm_arg1);
}if ((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else if ((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
/* ARG 2 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_1;

{
{
  SCM gw__tmp579_scm_rest = gw__scm_arg2;
  gw__c_arg2= NULL;
  while(!SCM_NULLP(gw__tmp579_scm_rest)
        && (! (gw__error_status != GW__ERR_NONE)))
  {
    const char * gw__tmp580_c_item;
    SCM gw__tmp581_scm_item = SCM_CAR(gw__tmp579_scm_rest);

gw__tmp580_c_item = NULL;

if(SCM_FALSEP(gw__tmp581_scm_item))
  gw__tmp580_c_item = NULL;
else if(SCM_STRINGP(gw__tmp581_scm_item))
  gw__tmp580_c_item = gh_scm2newstr(gw__tmp581_scm_item, NULL);
else
{
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__tmp581_scm_item;
   goto gw__post_call_arg_2;
}

    if(! (gw__error_status != GW__ERR_NONE) )
    {
       gw__c_arg2 = g_slist_prepend (gw__c_arg2, (gpointer)gw__tmp580_c_item);
    }
    gw__tmp579_scm_rest = SCM_CDR (gw__tmp579_scm_rest);
  }
  if(!(gw__error_status != GW__ERR_NONE))
  {
    gw__c_arg2 = g_slist_reverse(gw__c_arg2);
  }
  else
  {
    GSList * gw__tmp582_cursor = gw__c_arg2;
    while(gw__tmp582_cursor)
    {
      const char * gw__tmp580_c_item;
      gw__tmp580_c_item = ( const char *) gw__tmp582_cursor->data;
if(gw__tmp580_c_item) free((void *) gw__tmp580_c_item);
gw__tmp582_cursor = gw__tmp582_cursor->next;
    }
    g_slist_free(gw__c_arg2);
    gw__c_arg2 = NULL;
  }
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg2;
   goto gw__post_call_arg_2;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg2;
   goto gw__post_call_arg_2;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_2;
SCM_DEFER_INTS;
kvp_frame_set_slot_path_gslist (gw__c_arg0, gw__c_arg1, gw__c_arg2);
SCM_ALLOW_INTS;
{
gw__scm_result = SCM_UNSPECIFIED;
}
}
  gw__post_call_arg_2:
{
{
  GSList * gw__tmp584_cursor = gw__c_arg2;
  while(gw__tmp584_cursor)
  {
    const char * gw__tmp583_c_item;
    gw__tmp583_c_item = ( const char *) gw__tmp584_cursor->data;
if(gw__tmp583_c_item) free((void *) gw__tmp583_c_item);
gw__tmp584_cursor = gw__tmp584_cursor->next;
  }
  if(gw__c_arg2)
  {
    g_slist_free(gw__c_arg2);
    gw__c_arg2 = NULL;
  }
}
}
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_1:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp566_kvp_frame_set_slot_path_gslist_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp568_kvp_frame_get_slot_path_gslist_namestr = "gnc:kvp-frame-get-slot-path";
static SCM gw__tmp567_kvp_frame_get_slot_path_gslist_wrapper  (SCM gw__scm_arg0, SCM gw__scm_arg1 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;
kvp_value* gw__c_result;

kvp_frame* gw__c_arg0;
GSList* gw__c_arg1;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp558_wct_info_for__gnc_kvp_frame__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
/* ARG 1 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;

{
{
  SCM gw__tmp585_scm_rest = gw__scm_arg1;
  gw__c_arg1= NULL;
  while(!SCM_NULLP(gw__tmp585_scm_rest)
        && (! (gw__error_status != GW__ERR_NONE)))
  {
    const char * gw__tmp586_c_item;
    SCM gw__tmp587_scm_item = SCM_CAR(gw__tmp585_scm_rest);

gw__tmp586_c_item = NULL;

if(SCM_FALSEP(gw__tmp587_scm_item))
  gw__tmp586_c_item = NULL;
else if(SCM_STRINGP(gw__tmp587_scm_item))
  gw__tmp586_c_item = gh_scm2newstr(gw__tmp587_scm_item, NULL);
else
{
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__tmp587_scm_item;
   goto gw__post_call_arg_1;
}

    if(! (gw__error_status != GW__ERR_NONE) )
    {
       gw__c_arg1 = g_slist_prepend (gw__c_arg1, (gpointer)gw__tmp586_c_item);
    }
    gw__tmp585_scm_rest = SCM_CDR (gw__tmp585_scm_rest);
  }
  if(!(gw__error_status != GW__ERR_NONE))
  {
    gw__c_arg1 = g_slist_reverse(gw__c_arg1);
  }
  else
  {
    GSList * gw__tmp588_cursor = gw__c_arg1;
    while(gw__tmp588_cursor)
    {
      const char * gw__tmp586_c_item;
      gw__tmp586_c_item = ( const char *) gw__tmp588_cursor->data;
if(gw__tmp586_c_item) free((void *) gw__tmp586_c_item);
gw__tmp588_cursor = gw__tmp588_cursor->next;
    }
    g_slist_free(gw__c_arg1);
    gw__c_arg1 = NULL;
  }
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg1;
   goto gw__post_call_arg_1;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_1;
SCM_DEFER_INTS;
gw__c_result = kvp_frame_get_slot_path_gslist (gw__c_arg0, gw__c_arg1);
SCM_ALLOW_INTS;
{
gw__scm_result = gnc_kvp_value_ptr_to_scm(gw__c_result);
}
}
  gw__post_call_arg_1:
{
{
  GSList * gw__tmp590_cursor = gw__c_arg1;
  while(gw__tmp590_cursor)
  {
    const char * gw__tmp589_c_item;
    gw__tmp589_c_item = ( const char *) gw__tmp590_cursor->data;
if(gw__tmp589_c_item) free((void *) gw__tmp589_c_item);
gw__tmp590_cursor = gw__tmp590_cursor->next;
  }
  if(gw__c_arg1)
  {
    g_slist_free(gw__c_arg1);
    gw__c_arg1 = NULL;
  }
}
}
  { /* shut up warnings if no code */ int x = x; }
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp568_kvp_frame_get_slot_path_gslist_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp570_xaccTransGetSlots_namestr = "gnc:transaction-get-slots";
static SCM gw__tmp569_xaccTransGetSlots_wrapper  (SCM gw__scm_arg0 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;
kvp_frame* gw__c_result;

Transaction* gw__c_arg0;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp26_wct_info_for__gnc_Transaction__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;
SCM_DEFER_INTS;
gw__c_result = xaccTransGetSlots (gw__c_arg0);
SCM_ALLOW_INTS;
{
if(gw__c_result == NULL) gw__scm_result = SCM_BOOL_F;
else gw__scm_result = gw_wcp_assimilate_ptr((void *) gw__c_result, gw__tmp558_wct_info_for__gnc_kvp_frame__);
}
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp570_xaccTransGetSlots_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
static char * gw__tmp572_gnc_book_get_slots_namestr = "gnc:book-get-slots";
static SCM gw__tmp571_gnc_book_get_slots_wrapper  (SCM gw__scm_arg0 ) {
  SCM gw__scm_result = SCM_UNSPECIFIED;
  enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
  SCM gw__error_data = SCM_UNSPECIFIED;
  unsigned int gw__arg_pos = 0;
  const char *gw__error_misc_msg = NULL;
kvp_frame* gw__c_result;

GNCBook* gw__c_arg0;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;

{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp22_wct_info_for__gnc_Book__, gw__scm_arg0))){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
if((gw__error_status == GW__ERR_TYPE)){
   gw__error_status = GW__ERR_ARG_TYPE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
else if((gw__error_status == GW__ERR_RANGE)){
   gw__error_status = GW__ERR_ARG_RANGE;
    gw__error_data = gw__scm_arg0;
   goto gw__post_call_arg_0;
}
if (gw__error_status == GW__ERR_NONE)
{
  /* no pre-call result code requested! */
if (gw__error_status != GW__ERR_NONE) goto gw__post_call_arg_0;
SCM_DEFER_INTS;
gw__c_result = gnc_book_get_slots (gw__c_arg0);
SCM_ALLOW_INTS;
{
if(gw__c_result == NULL) gw__scm_result = SCM_BOOL_F;
else gw__scm_result = gw_wcp_assimilate_ptr((void *) gw__c_result, gw__tmp558_wct_info_for__gnc_kvp_frame__);
}
}
  gw__post_call_arg_0:
  /* no post-call arg code requested! */
  { /* shut up warnings if no code */ int x = x; }
}
 gw__wrapper_exit:
  if(gw__error_status != GW__ERR_NONE)
    gw__handle_wrapper_error(gw__error_status,
                             gw__tmp572_gnc_book_get_slots_namestr,
                             gw__arg_pos,
                             gw__error_misc_msg,
                             gw__error_data);
  return gw__scm_result;
}
void
gw_init_wrapset_gw_kvp() {
  static int gw_wrapset_initialized = 0;

  if(!gw_wrapset_initialized)
  {
    gh_eval_str("(use-modules (g-wrap runtime))");
    gh_eval_str("(gw:wrapset-register-runtime \"gw-kvp\")");

gh_eval_str("(use-modules (g-wrapped gw-engine))");
gh_eval_str("(use-modules (g-wrap gw-glib))");
gh_eval_str("(use-modules (g-wrap gw-wct))");
gh_eval_str("(use-modules (g-wrap gw-standard))");
{
   enum GW__ErrorStatus gw__tmp591_status_var = GW__ERR_NONE;
   SCM gw__tmp593_err_data = SCM_UNSPECIFIED;
   char *gw__tmp592_err_misc_msg = NULL;
   (void) gw__tmp591_status_var;
   (void) gw__tmp593_err_data;
   (void) gw__tmp592_err_misc_msg;
}
{
   enum GW__ErrorStatus gw__tmp594_err_status = GW__ERR_NONE;
   SCM gw__tmp596_err_data = SCM_UNSPECIFIED;
   char *gw__tmp595_err_misc_msg = NULL;
   (void) gw__tmp594_err_status;
   (void) gw__tmp596_err_data;
   (void) gw__tmp595_err_misc_msg;
    gw__tmp26_wct_info_for__gnc_Transaction__ = gh_eval_str("<gnc:Transaction*>");
if (gw__tmp594_err_status != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp594_err_status,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp595_err_misc_msg,
                            gw__tmp596_err_data);
    gw__tmp22_wct_info_for__gnc_Book__ = gh_eval_str("<gnc:Book*>");
if (gw__tmp594_err_status != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp594_err_status,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp595_err_misc_msg,
                            gw__tmp596_err_data);
if (gw__tmp594_err_status != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp594_err_status,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp595_err_misc_msg,
                            gw__tmp596_err_data);
    gw__tmp558_wct_info_for__gnc_kvp_frame__ = gw_wct_create("<gnc:kvp-frame*>", NULL, NULL, NULL, NULL);
  gh_define("<gnc:kvp-frame*>", gw__tmp558_wct_info_for__gnc_kvp_frame__);
if (gw__tmp594_err_status != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp594_err_status,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp595_err_misc_msg,
                            gw__tmp596_err_data);
}
{
   enum GW__ErrorStatus gw__tmp597_status_var = GW__ERR_NONE;
   SCM gw__tmp599_err_data = SCM_UNSPECIFIED;
   char *gw__tmp598_err_misc_msg = NULL;
   (void) gw__tmp597_status_var;
   (void) gw__tmp599_err_data;
   (void) gw__tmp598_err_misc_msg;
    gh_new_procedure(gw__tmp560_gnc_kvp_frame_delete_at_path_namestr,
                     (SCM (*) ()) gw__tmp559_gnc_kvp_frame_delete_at_path_wrapper,
                     2,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp562_kvp_frame_set_slot_namestr,
                     (SCM (*) ()) gw__tmp561_kvp_frame_set_slot_wrapper,
                     3,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp564_kvp_frame_get_slot_namestr,
                     (SCM (*) ()) gw__tmp563_kvp_frame_get_slot_wrapper,
                     2,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp566_kvp_frame_set_slot_path_gslist_namestr,
                     (SCM (*) ()) gw__tmp565_kvp_frame_set_slot_path_gslist_wrapper,
                     3,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp568_kvp_frame_get_slot_path_gslist_namestr,
                     (SCM (*) ()) gw__tmp567_kvp_frame_get_slot_path_gslist_wrapper,
                     2,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp570_xaccTransGetSlots_namestr,
                     (SCM (*) ()) gw__tmp569_xaccTransGetSlots_wrapper,
                     1,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
    gh_new_procedure(gw__tmp572_gnc_book_get_slots_namestr,
                     (SCM (*) ()) gw__tmp571_gnc_book_get_slots_wrapper,
                     1,
                     0,
                     0);

if (gw__tmp597_status_var != GW__ERR_NONE)  gw__handle_wrapper_error (gw__tmp597_status_var,
                            "gw_init_wrapset_gw_kvp",
                            0,
                            gw__tmp598_err_misc_msg,
                            gw__tmp599_err_data);
}
    gw_wrapset_initialized = 1;
    (void) gw__handle_wrapper_error;
  }
}
