Eliminate the "strcpy_nooverlap(s, h);" ?

'line' is reused when
- result == 4
- result == 4 and then result == 1/3/4/5
- result == 5 (via crappa:)
- result == 1
- result == 3 and there's an error in read_next_line (either script was killed or EOF)
'line' is ignored when
- result == 0 [skip to next line]
- result == 2 [yield]

- process_line is also called from DinkC "return", "if" and "if"'s
  condition. In the case of a function call, line is replaced by
  what's after the function call, so no need for 'strcpy_nooverlap'.

=====

When process_line returns 3, 4 or 5:
4:
- '}' end of skipped bloc => allow code after '}', IMHO meant to support:
  if (0) {
     something();
  } else               <- here 'else' will be analyzed next time
  {
     something_else();
  }

- 'int XXX = ...' => create/register variable XXX then analyze 'XXX = ...'

5:
'if (...)', after '(...)' was analyzed
e.g.:
  if ($flag == 1) say("I won!", 1);  <- not recommended, may mess string search (though present in the dinkc.txt documentation)
  if ($flag == 1) {

1:
after
  'else'
  '{'
  '}' (not skipped, or nested in a skipped bloc)

3:
  return from 1-line conditional bloc if condition was false
  if (0)
    something();       <- return 3;
  else
    something_else();
  if (1)
    something();
  else
    something_else();  <- return 3;


1 => continue processing this line (!= process next line, as '0' does)

0 => stop processing this line and go to the next one
2 => stop processing script i.e. give control back to the game engine i.e. yield

3 => doelse once on next line
5 => doelse once on the remainder of the line;
     Given that it's returned right after a if(), there's little
     chance to meet a "else" in the next line anyway..
4 => doelse once on a) remainder of line or b) if remainder too short, on next non-empty line
     + handle 3 or 5 return values like 1; see below for an analysis
     of when 3 or 5 happen after state 4

doelse => handle "else" if present on next line, otherwise same as
          normal; a better flag for if/else handling is 'skipnext'




=====

Changes in v1.08 - variables and scope:

- decipher_string -> replace longest variables first
- scope check:
  before: scope == DINKC_GLOBAL_SCOPE || scope == cur_script
  => FIFO (overrides are possible, but first memory slot always wins)
  after:  get_var(script, var)
  => local then global

  [X] var_equals -> search for LHS, search for RHS if variable
  [X] decipher -> search for a given variable
  [X] decipher_string -> recurse_var_replace -> replace all vars in a
      string, longest first


=====

Possible values in DinkC bindings (i.e. functions, not in syntaxic
constructs like if/then/else/goto/return/choice_start):

Constant:

- 0 (goto next line)

- 2 (yield): show_bmp, wait_for_button, draw_screen, kill_cur_item,
    kill_cur_magic, restart_game, fade_down, fade_up, kill_this_task,
    kill_game, activate_bow

Variable:

- say_stop, say_stop_xy, say_stop_npc, wait, load_game, move_stop: 2
  unless error (in which case: 0)

- playmidi: 0 unless already playing requested CD track
  (in which case 2???)

=> If simplifying DinkC, make the system return "0"/"continue" by
   default, and allow function to request a DinkC yield dynamically
   (e.g. using an in/out variable "int& yield").


=====

Changes in FreeDink: in an attempt to clarify the code, I've made a
couple bugfixes. I didn't actually test, it's just what I read from
the code.

- If the file ends with '\\' (double antislash, without final carriage
  return), the game would endlessly loop. Well nobody will care but
  this is fixed :p

- In some weird cases where the file would end on state 3, 4 or 5, the
  last line may be ran twice.

- In some weird cases where a script was killed by another script
  while it was in state 3, 4 or 5, then the current line may be ran
  again before the script is effectively stopped.

- This particular (illogical) construct:

  }
  if (&stuff) else
  do_something();

  that is, return values 4 then 5 followed by a 'else' statement,
  would do nothing in v1.07/08. Now it do_something().

- Now supposing that nobody every tried to write "int else = ...".
