assist.c.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. assist.c
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='ARPCWrite.c.html' title=' ARPCWrite.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='Attributes1.c.html' title=' Attributes1.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * void assist (char const * name, char const * type, struct _code_ const list [], size_t size);
  24. *
  25. * symbol.h
  26. *
  27. * print program name followed by an error message containing the
  28. * type of name expected, the incorrect name and a list of correct
  29. * name;
  30. *
  31. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  32. * Copyright (c) 2001-2006 by Charles Maier Associates;
  33. * Licensed under the Internet Software Consortium License;
  34. *
  35. *--------------------------------------------------------------------*/
  36. #ifndef ASSIST_SOURCE
  37. #define ASSIST_SOURCE
  38. #include &lt;stdio.h&gt;
  39. #include &lt;stdlib.h&gt;
  40. #include &lt;string.h&gt;
  41. #include &quot;../tools/symbol.h&quot;
  42. #include &quot;../tools/error.h&quot;
  43. void assist (char const * name, char const * type, struct _code_ const list [], size_t size)
  44. {
  45. extern char const * program_name;
  46. fprintf (stderr, &quot;%s: &quot;, program_name);
  47. fprintf (stderr, &quot;%s: &quot;, strerror (ENOTSUP));
  48. if (name)
  49. {
  50. #if 0
  51. fprintf (stderr, &quot;Have %s '%s' but expected %s &quot;, type, name, type);
  52. #else
  53. fprintf (stderr, &quot;Have '%s' but want &quot;, name);
  54. #endif
  55. }
  56. else
  57. {
  58. fprintf (stderr, &quot;Want %s &quot;, type);
  59. }
  60. codelist (list, size, &quot;,&quot;, &quot;''&quot;, stderr);
  61. fprintf (stderr, &quot;.\n&quot;);
  62. exit (1);
  63. }
  64. #endif
  65. </pre>
  66. <div class='footerlink'>
  67. [<a href='ARPCWrite.c.html' title=' ARPCWrite.c '>PREV</a>]
  68. [<a href='toolkit.html' title=' Index '>HOME</a>]
  69. [<a href='Attributes1.c.html' title=' Attributes1.c '>NEXT</a>]
  70. </div>
  71. </body>
  72. </html>