#######################################################################
## generic include for XXX. Do not use directly.
##
## $Id: mfd-interactive-setup.m2c,v 1.6.2.1 2004/12/24 14:05:09 rstory Exp $
########################################################################
@if $m2c_mark_boundary == 1@
/** START code generated by $RCSfile: mfd-interactive-setup.m2c,v $ $Revision: 1.6.2.1 $ */
@end@
########################################################################

@eval $m2c_temp_writable = table_is_writable($context)@
@eval $m2c_temp_create = table_has_create($context)@
@eval $m2c_temp_dependencies = $m2c_temp_writable@
@eval $m2c_temp_context_reg = "$mfd_default_context_reg"@
@eval $m2c_temp_data_context = "$mfd_default_data_context"@
@eval $m2c_temp_data_allocate = 0@
@eval $m2c_temp_undo_embed = 0@
@eval $m2c_temp_data_init = 0@
@eval $m2c_temp_table_access = "$mfd_default_table_access"@
@eval $m2c_temp_data_transient = $mfd_default_data_transient + 1@
@eval $m2c_temp_include_examples = $mfd_default_include_examples@
@eval $m2c_conf_maybe_comment = "##"@
##
@if $mfd_interactive_setup != 0@
@open -@
@   if $mfd_interactive_setup != -1@
There are no defaults for ${context}. Would you like to

  1) Accept hard-coded defaults
  2) Set defaults now [DEFAULT]

@     eval $ans = 2@
@     prompt $ans Select your choice : @
@   else@
@      eval $ans = 2@
@   end@
@   print ans = $ans@
@   if $ans == 1@
@   else@
@     eval $m2c_conf_maybe_comment = ""@


## ---------------------------------------------------
@    if $m2c_temp_writable == 1@
This table has writable columns. Do you want to generate
code for writeable columns, or restrict the table to read-only?

  1) generate code with writeable columns [DEFAULT]
  2) generate code with read-only columns

@      prompt $ans Select your choice : @
@      if $ans == 2@
@        eval $m2c_temp_writable = 0@
@        eval $m2c_temp_create = 0@
@        eval $m2c_temp_dependencies = 0@
@      end@


@    end@ # writable
## ---------------------------------------------------
@    if $m2c_temp_dependencies == 1@
Writable tables sometimes have dependencies beteen columns
or with other tables. If there are no dependencies in this table, you
probably do not want the extra code.

  1) do not generate dependency code [DEFAULT]
  2) generate dependency code

@      prompt $ans Select your choice : @
@      if $ans == 2@
@        eval $m2c_temp_dependencies = 1@
@      end@


@    end@ # dependencies
## ---------------------------------------------------
@    if $m2c_temp_create == 1@
This table has read-create columns. Do you want to generate
code for dynamic row creation?

  1) generate code for row creation [DEFAULT]
  2) do not generate code for row creation

@      prompt $ans Select your choice : @
@      if $ans == 2@
@        eval $m2c_temp_create = 0@
@      end@


@    end@ # create
## ---------------------------------------------------
Do you want to use an existing data structure for the USER context?
This would be a structure used to track data for the entire table,
(similar to a global variable) not individual rows.

  1) No, use $m2c_temp_context_reg [DEFAULT]
  2) Yes, use my own structure

@      prompt $ans Select your choice : @
@      if $ans == 2@
@        prompt $m2c_temp_context_reg   Enter your USER context : @
@      end@


## ---------------------------------------------------
Do you want to use an existing data structure for the DATA context?
The DATA context holds the data for each MIB column. By default, a new
data structure will be created with an element for each column.

  1) No, use $m2c_temp_data_context [DEFAULT]
  2) Yes, use my own structure

@      prompt $ans Select your choice : @
@      if $ans == 2@


Note: Do not enter a pointer type. Use the base structure name. For
example, use 'struct widget', not 'struct widget *'. If you will be
using pointer to the structure, select dynamic allocation in the
next question.

@        prompt $m2c_temp_data_context   Enter your DATA context : @
@      end@


## ---------------------------------------------------
@      if "x$m2c_temp_data_context" ne "x$mfd_default_data_context"@
Do you want to allocate your '$m2c_temp_data_context' DATA context, or
embed it directly? If your data is INTERNAL (controlled by the agent), you
probably want embedded. If your data is EXTERNAL (controlled by another
process) and you have pointers to the data, you probably want allocated.

  1) directly embed structure [DEFAULT]
  2) dynamically allocate structure

@        prompt $ans Select your choice : @
@        if $ans == 2@
@          eval $m2c_temp_data_allocate = 1@
@        end@


## ---------------------------------------------------
Do you need to initialize elements in your '$m2c_temp_data_context'
when a new instance is created, or do you plan on adding other
structures that might need initialization to the row request context?
@      else@ #
Do you plan on adding any items to the default row request context
that will require initialization/cleanup?
@      end@ # ! default (generated)
(The most common reason you might need to do this is if you want to keep
some non-MIB data for every row.)

  1) no, no initialization needed [DEFAULT]
  2) yes, initilization is needed

@        prompt $ans Select your choice : @
@        if $ans == 2@
@          eval $m2c_temp_data_init = 1@
@        end@


## ---------------------------------------------------
Which method would you like to use to gather data about available rows? 

  1) container-cached : [DEFAULT]  This access method uses a
     netsnmp_container to keep track of the indexes (and data, usually)
     for each row. Thi method is best for:
         - Internal data (maintained by the agent)
         - External data (maintained by another process)
         - Access speed is important
         - Sufficient memory exists to cache all indexes
     
  2) unsorted-external : This access method iterates over all of your data
     to find the row with the appropriate index. This method is best for
         - External data (maintained by another process)
         - Using less memory is more important than access speed
     
@      prompt $ans Select your choice : @
@      if $ans == 2@
@        eval $m2c_temp_table_access = "unsorted-external"@
@      else@
@        eval $m2c_temp_table_access = "container-cached"@
@      end@


## ---------------------------------------------------
When accessing your data, is your data TRANSIENT?

  1) Yes. My data is TRANSIENT (e.g. a pointer to a static buffer that
     my be overwritten during a request) and needs to be copied during
     processing.

  2) Yes. My data is SEMI-TRANSIENT (e.g. an allocated pointer to a
     copy of the data).

  3) No, my data is PERSISTENT (e.g. an allocated pointer to the actual
     data, which is under the agent's control)
## '
  
@      prompt $ans Select your choice [DEFAULT=1] : @
@      if $ans == 3@
@        eval $m2c_temp_data_transient = 0@
@      elsif $ans == 2@
@        eval $m2c_temp_data_transient = 1@
@      else@
@        eval $m2c_temp_data_transient = 2@
@      end@


## ---------------------------------------------------
Do you want example code to be generated?

  1) generate example code [DEFAULT]
  2) do not generate example code

@      prompt $ans Select your choice : @
@      if $ans == 2@
@        eval $m2c_temp_include_examples = 0@
@      else@
@        eval $m2c_temp_include_examples = 1@
@      end@

@   end@ # do not use hardcoded
@end@ # $mfd_interactive_setup == 1
##################################
@open default-table-${context}.m2d@
@eval $m2c_conf_comment = "##"@
@eval $m2c_conf_comment_divider = "########################################################################"@
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment mib2c Table setting for $context
$m2c_conf_comment
$m2c_conf_comment Remove the '##' comment delimeter to change settings
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_table_settable = $m2c_temp_writable@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_table_dependencies = $m2c_temp_dependencies@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_table_row_creation = $m2c_temp_create@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_context_reg = "$m2c_temp_context_reg"@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_data_context = "$m2c_temp_data_context"@ [generated|NAME]
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_data_allocate = $m2c_temp_data_allocate@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_data_init = $m2c_temp_data_init@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_table_access = "$m2c_temp_table_access"@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment // 0:persistent, 1:semi-transient, 2:transient
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_data_transient = $m2c_temp_data_transient@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_table_skip_mapping = $m2c_table_skip_mapping@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_include_examples = $m2c_temp_include_examples@
$m2c_conf_comment
$m2c_conf_comment_divider
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_comment
$m2c_conf_maybe_comment @eval $@m2c_irreversible_commit = $m2c_irreversible_commit@
$m2c_conf_comment
@close default-table-${context}.m2d@
##
########################################################################
@if $m2c_mark_boundary == 1@
/** END code generated by $RCSfile: mfd-interactive-setup.m2c,v $ $Revision: 1.6.2.1 $ */
@end@
