encode man page on Plan9

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

ENCODE(2)							     ENCODE(2)

delim $$

NAME
       dec64,  enc64,  dec32,  enc32,  dec16, enc16, encodefmt - encoding byte
       arrays as strings

SYNOPSIS
       #include <u.h>
       #include <libc.h>

       int  dec64(uchar *out, int lim, char *in, int n)

       int  enc64(char *out, int lim, uchar *in, int n)

       int  dec32(uchar *out, int lim, char *in, int n)

       int  enc32(char *out, int lim, uchar *in, int n)

       int  dec16(uchar *out, int lim, char *in, int n)

       int  enc16(char *out, int lim, uchar *in, int n)

       int  encodefmt(Fmt*)

DESCRIPTION
       Enc16, enc32 and enc64 create null terminated strings.  They return the
       size  of	 the  encoded  string (without the null) or -1 if the encoding
       fails.  The encoding fails if lim, the length of the output buffer,  is
       too small.  They require $2 n + 1$, ${ 8 n + 4 } over 5 + 1$ and $4 { {
       n + 2 } over 3 } + 1$ bytes, respectively.

       Dec16, dec32 and dec64 return the number of bytes decoded or -1 if  the
       decoding	 fails.	  The decoding fails if the output buffer is not large
       enough or, for base 32, if the input buffer length is not a multiple of
       8.

       Encodefmt  can be used with fmtinstall(2) and print(2) to print encoded
       representations of byte arrays.	The verbs are

       H  base 16 (i.e. hexadecimal). The default encoding is in  upper	 case.
	  The l flag forces lower case.

       <  base 32

       [  base 64 (same as MIME)

       The  length of the array is specified as f2.  For example, to display a
       15 byte array as hex:

	      char x[15];

	      fmtinstall('H', encodefmt);
	      print("%.*H\n", sizeof x, x);

SOURCE
       /sys/src/libc/port/u[136][246].c

								     ENCODE(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

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