/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_rasterfile_params_t
 *     enum dt_iop_rasterfile_mode_t
 *       DT_RASTERFILE_MODE_ALL : all RGB channels
 *       DT_RASTERFILE_MODE_RED : only red
 *       DT_RASTERFILE_MODE_GREEN : only green
 *       DT_RASTERFILE_MODE_BLUE : only blue
 *       DT_RASTERFILE_MODE_REDGREEN : red and green
 *       DT_RASTERFILE_MODE_REDBLUE : red and blue
 *       DT_RASTERFILE_MODE_GREENBLUE : green and blue
 *     mode 
 *       description: mode
 *       default: DT_RASTERFILE_MODE_ALL
 * 
 *     char
 *     path [RASTERFILE_MAXFILE]
 *       default: 0
 *       range: CHAR_MIN .. CHAR_MAX
 * 
 *     char
 *     file [RASTERFILE_MAXFILE]
 *       default: 0
 *       range: CHAR_MIN .. CHAR_MAX
 * 
 * dt_iop_rasterfile_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/rasterfile.c"

#ifdef __cplusplus
extern "C"
{
#endif

#include <string.h>
#include "common/introspection.h"

static dt_introspection_field_t introspection_linear[6+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_rasterfile_mode_t", (char*)"mode", (char*)"mode", N_((char*)"mode"), sizeof(((dt_iop_rasterfile_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, mode), NULL },
    /*entries*/ 7, /*values*/ NULL, /*Default*/ DT_RASTERFILE_MODE_ALL
  }
},
{
  .Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"path[0]", (char*)"path[0]", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->path[0]), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, path), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"path", (char*)"path", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->path), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, path), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_rasterfile_params_t*)NULL)->path), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[1]
  }
},
{
  .Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"file[0]", (char*)"file[0]", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->file[0]), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, file), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"file", (char*)"file", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->file), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, file), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_rasterfile_params_t*)NULL)->file), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[3]
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_rasterfile_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_rasterfile_params_t), 0, NULL },
    /*entries*/ 3, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  1,
  "dt_iop_rasterfile_params_t",
  sizeof(dt_iop_rasterfile_params_t),
  &introspection_linear[6-1],
  sizeof(dt_iop_module_t),
  G_STRUCT_OFFSET(dt_iop_module_t, default_params)
};

dt_introspection_field_t* get_introspection_linear()
{
  return introspection_linear;
}

dt_introspection_t* get_introspection()
{
  return &introspection;
}

int introspection_init(struct dt_iop_module_so_t *self, int api_version)
{
  // here we check that the generated code matches the api at compile time and also at runtime
  if(introspection.api_version != DT_INTROSPECTION_VERSION || api_version != DT_INTROSPECTION_VERSION)
    return 1;

#if defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406)
  introspection_linear[0].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_rasterfile_mode_t", (char*)"mode", (char*)"mode", N_((char*)"mode"), sizeof(((dt_iop_rasterfile_params_t*)NULL)->mode), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, mode), NULL },
    /*entries*/ 7, /*values*/ NULL, /*Default*/ DT_RASTERFILE_MODE_ALL
  };
  introspection_linear[1].Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"path[0]", (char*)"path[0]", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->path[0]), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, path), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  };
  introspection_linear[2].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"path", (char*)"path", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->path), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, path), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_rasterfile_params_t*)NULL)->path), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[1]
  };
  introspection_linear[3].Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"file[0]", (char*)"file[0]", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->file[0]), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, file), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  };
  introspection_linear[4].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"file", (char*)"file", (char*)"", sizeof(((dt_iop_rasterfile_params_t*)NULL)->file), G_STRUCT_OFFSET(dt_iop_rasterfile_params_t, file), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_rasterfile_params_t*)NULL)->file), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[3]
  };
  introspection_linear[5].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_rasterfile_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_rasterfile_params_t), 0, NULL },
    /*entries*/ 3, /*fields*/ NULL
  };
  introspection_linear[6].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

  for(int i = 0; i <= 6; i++)
    introspection_linear[i].header.so = self;

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "DT_RASTERFILE_MODE_ALL", DT_RASTERFILE_MODE_ALL, N_((char*)"all RGB channels") },
    { "DT_RASTERFILE_MODE_RED", DT_RASTERFILE_MODE_RED, N_((char*)"only red") },
    { "DT_RASTERFILE_MODE_GREEN", DT_RASTERFILE_MODE_GREEN, N_((char*)"only green") },
    { "DT_RASTERFILE_MODE_BLUE", DT_RASTERFILE_MODE_BLUE, N_((char*)"only blue") },
    { "DT_RASTERFILE_MODE_REDGREEN", DT_RASTERFILE_MODE_REDGREEN, N_((char*)"red and green") },
    { "DT_RASTERFILE_MODE_REDBLUE", DT_RASTERFILE_MODE_REDBLUE, N_((char*)"red and blue") },
    { "DT_RASTERFILE_MODE_GREENBLUE", DT_RASTERFILE_MODE_GREENBLUE, N_((char*)"green and blue") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f5[] = {
    &introspection_linear[0],
    &introspection_linear[2],
    &introspection_linear[4],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[5].Struct.fields = f5;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_rasterfile_params_t * p = (dt_iop_rasterfile_params_t*)param;
  if(!strcmp(name, "mode"))
    return &(p->mode);
  else if(!strcmp(name, "path[0]"))
    return &(p->path[0]);
  else if(!strcmp(name, "path"))
    return &(p->path);
  else if(!strcmp(name, "file[0]"))
    return &(p->file[0]);
  else if(!strcmp(name, "file"))
    return &(p->file);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "mode"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "path[0]"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "path"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "file[0]"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "file"))
    return &(introspection_linear[4]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

