1### Copyright (c) 2007, Tyzx Corporation. All rights reserved.
2
3function isok = _g_check (g)
4### isok = _g_check (g)         - Check that g is a gnuplot_object
5###
6### If nargout == 0, an error is raised if g is not a gnuplot_object.
7### Else, isok is set to 0 and returned.
8  isok = 1;
9  if !isstruct (g)
10    isok = 0;
11    if !nargout, error ("1st argument is not a struct"); endif
12    if !strcmp (g.type, "gnuplot_object")
13      isok = 0;
14      if !nargout, error ("1st argument is not a gnuplot_object"); endif
15    endif
16  endif
17  if !nargout, clear isok; endif
18endfunction
19