parsecmd man page on Inferno

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

PARSECMD(10.2)							PARSECMD(10.2)

NAME
       parsecmd - parse device commands

SYNOPSIS
       Cmdbuf* parsecmd(char *a, int n)

DESCRIPTION
       Parsecmd is an interface to tokenize (see getfields(10.2)), that safely
       parses a command, with blank-separated fields, as might be written to a
       device's ctl file.  The buffer a and count n can be those passed to the
       driver's write function.	 Parsecmd converts the byte array (which might
       not  be	null-terminated)  to  a	 null-terminated  string, trimming any
       trailing new line, before invoking tokenize to break  the  string  into
       arguments, interpreting blank and tab as field separators when they are
       not quoted (in the style of sh(1)).  It returns a pointer to a  dynami‐
       cally-allocated	Cmdbuf	structure, which holds a copy of the string as
       modified by parsefields, and the resulting fields;  it  is  defined  as
       follows:

	      typedef
	      struct Cmdbuf
	      {
		    char  buf[128];
		    char  *f[16];
		    int	  nf;
	      } Cmdbuf;

       The  array  f  holds the field pointers; nf gives the number of fields.
       Cmdbuf is allocated by smalloc (see malloc(10.2)), and  the  caller  is
       responsible for freeing it using free.

SOURCE
       /os/port/parse.c
       /emu/port/dev.c

								PARSECMD(10.2)
[top]

List of man pages available for Inferno

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