GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PHK_ARGV (3)

NAME

PhkArgvParse, PhkArgvFree - parse argument string

CONTENTS

Synopsis
Description
Examples
See Also
History

SYNOPSIS


.In phk_argv.h char ** PhkArgvParse const char *s int comment void PhkArgvFree char **

DESCRIPTION

These functions can parse a string into argv[] style arguments.

PhkArgvParse Splits the string s into individual arguments and returns an argv vector.

The first element of the returned vector is non-NULL it contains an error message and the conversion was a failure.

Otherwise the remainder of the vector contains the parsed arguments, terminated by a NULL element.

The returned argv and the storage for the arguments are allocated with malloc(3) but should only be freed with the PhkArgvFree function.

If the comment argument is non-zero, any argument starting with a ’#’ character will terminate the parsing, rendering the remainder of the input string a comment.

Arguments can be included in double quotes ’"’ and the usual backslash escapes are recognized and converted.

EXAMPLES

#include "phk_argv.h"

[...]

char **av; char *p;

[...]

av = PhkArgvParse(p, 0); if (av[0] != NULL)         err(1, "Parse error: %s", av[0]); for (i = 1; av[i] != NULL; i++)         printf("av[%d] = %s\n", i, av[i]); PhkArgvFree(av);

SEE ALSO

libphk(3)

HISTORY

Written by Poul-Henning Kamp, now part of libphk.
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.