cdecl man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



     CDECL(1)		       UNIX System V		      CDECL(1)

     NAME
	  cdecl - Compose C declarations

     SYNOPSIS
	  cdecl

     DESCRIPTION
	  Cdecl is a program for encoding and decoding C type-
	  declarations.	 It reads standard input for statements in the
	  language described below.  The results are written on
	  standard output.

	  Cdecl's scope is intentionally small.	 It doesn't help you
	  figure out storage classes or initializations.

     COMMAND LANGUAGE
	  There are four statements in the language.  The "declare"
	  statement composes a C type-declaration from a verbose
	  description.	The "cast" statement composes a C type-cast as
	  might appear in an expression.  The "explain" statement
	  decodes a C type-declaration, producing a verbose
	  description.	The "help" statement describes the others.

	  The following grammar describes the language.	 In the
	  grammar, words in "<>" are non-terminals, bare lower-case
	  words are terminals that stand for themselves.  Bare upper-
	  case words are other lexical tokens:	NOTHING means the
	  empty string; NAME means a C identifier; NUMBER means a
	  string of decimal digits; and NL means the new-line
	  character.

	  <program>    ::= NOTHING
			 | <program> <stat> NL
	  <stat>       ::= NOTHING
			 | declare NAME as <decl>
			 | cast NAME into <decl>
			 | explain <cdecl>
			 | help
	  <decl>       ::= array of <decl>
			 | array NUMBER of <decl>
			 | function returning <decl>
			 | function ( NAME ) returning <decl>
			 | pointer to <decl>
			 | <type>
	  <cdecl>      ::= <cdecl1>
			 | * <cdecl>
	  <cdecl1>     ::= <cdecl1> ( )
			 | <cdecl1> [ ]
			 | <cdecl1> [ NUMBER ]
			 | ( <cdecl> )
			 | NAME
	  <type>       ::= <typename> | <modlist>

     Page 1					     (printed 5/23/00)

     CDECL(1)		       UNIX System V		      CDECL(1)

			 | <modlist> <typename>
			 | struct NAME | union NAME | enum NAME
	  <typename>   ::= int | char | double | float
	  <modlist>    ::= <modifier> | <modlist> <modifier>
	  <modifier>   ::= short | long | unsigned

     EXAMPLES
	  To declare an array of pointers to functions like malloc(3),
	  do declare fptab as array of pointer to function returning
	  pointer to char The result of this command is char
	  *(*fptab[])() When you see this declaration in someone
	  else's code, you can make sense out of it by doing explain
	  char *(*fptab[])() The proper declaration for signal(2)
	  cannot be described in cdecl's language (it can't be
	  described in C either).  An adequate declaration for most
	  purposes is given by declare signal as function returning
	  pointer to function returning int The function declaration
	  that results has two sets of empty parentheses.  The author
	  of such a function might wonder where the parameters go.
	  declare signal as function (args) returning pointer to
	  function returning int provides the solution:	 int
	  (*signal(args))()

     DIAGNOSTICS
	  The declare statement tries to point out constructions that
	  are not supported in C.  Also, certain non-portable
	  constructs are flagged.

	  Syntax errors cause the parser to play dead until a newline
	  is read.

     SEE ALSO
	  Section 8.4 of the C Reference Manual.

     BUGS
	  The pseudo-English syntax is excessively verbose.

     Page 2					     (printed 5/23/00)

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net