Changeset 858fc90 in mainline for uspace/srv/net/app/parse.h


Ignore:
Timestamp:
2010-03-15T19:35:25Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6092b56e
Parents:
92307f1 (diff), 4684368 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from bzr://bzr.helenos.org/head.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/app/parse.h

    r92307f1 r858fc90  
    3838#define __NET_APP_PARSE__
    3939
    40 /** Prints the parameter unrecognized message and the application help.
    41  *  @param[in] index The index of the parameter.
    42  *  @param[in] parameter The parameter name.
     40#include "../include/socket.h"
     41
     42/** Translates the character string to the address family number.
     43 *  @param[in] name The address family name.
     44 *  @returns The corresponding address family number.
     45 *  @returns EAFNOSUPPORTED if the address family is not supported.
    4346 */
    44 void    print_unrecognized( int index, const char * parameter );
     47int parse_address_family(const char * name);
    4548
    4649/** Parses the next parameter as an integral number.
     
    5760 *  @returns EINVAL if the parameter is in wrong format.
    5861 */
    59 int     parse_parameter_int( int argc, char ** argv, int * index, int * value, const char * name, int offset );
    60 
    61 /** Parses the next parameter as a character string.
    62  *  The actual parameter is pointed by the index.
    63  *  Uses the offseted actual parameter value if the offset is set or the next one if not.
    64  *  Increments the actual index by the number of processed parameters.
    65  *  @param[in] argc The total number of the parameters.
    66  *  @param[in] argv The parameters.
    67  *  @param[in,out] index The actual parameter index. The index is incremented by the number of processed parameters.
    68  *  @param[out] value The parsed parameter value.
    69  *  @param[in] name The parameter name to be printed on errors.
    70  *  @param[in] offset The value offset in the actual parameter. If not set, the next parameter is parsed instead.
    71  *  @returns EOK on success.
    72  *  @returns EINVAL if the parameter is missing.
    73  */
    74 int     parse_parameter_string( int argc, char ** argv, int * index, char ** value, const char * name, int offset );
     62int parse_parameter_int(int argc, char ** argv, int * index, int * value, const char * name, int offset);
    7563
    7664/** Parses the next named parameter as an integral number.
     
    9078 *  @returns ENOENT if the parameter name has not been found.
    9179 */
    92 int     parse_parameter_name_int( int argc, char ** argv, int * index, int * value, const char * name, int offset, int ( * parse_value )( const char * value ));
     80int parse_parameter_name_int(int argc, char ** argv, int * index, int * value, const char * name, int offset, int (*parse_value)(const char * value));
     81
     82/** Parses the next parameter as a character string.
     83 *  The actual parameter is pointed by the index.
     84 *  Uses the offseted actual parameter value if the offset is set or the next one if not.
     85 *  Increments the actual index by the number of processed parameters.
     86 *  @param[in] argc The total number of the parameters.
     87 *  @param[in] argv The parameters.
     88 *  @param[in,out] index The actual parameter index. The index is incremented by the number of processed parameters.
     89 *  @param[out] value The parsed parameter value.
     90 *  @param[in] name The parameter name to be printed on errors.
     91 *  @param[in] offset The value offset in the actual parameter. If not set, the next parameter is parsed instead.
     92 *  @returns EOK on success.
     93 *  @returns EINVAL if the parameter is missing.
     94 */
     95int parse_parameter_string(int argc, char ** argv, int * index, char ** value, const char * name, int offset);
     96
     97/** Translates the character string to the protocol family number.
     98 *  @param[in] name The protocol family name.
     99 *  @returns The corresponding protocol family number.
     100 *  @returns EPFNOSUPPORTED if the protocol family is not supported.
     101 */
     102int parse_protocol_family(const char * name);
     103
     104/** Translates the character string to the socket type number.
     105 *  @param[in] name The socket type name.
     106 *  @returns The corresponding socket type number.
     107 *  @returns ESOCKNOSUPPORTED if the socket type is not supported.
     108 */
     109int parse_socket_type(const char * name);
     110
     111/** Prints the parameter unrecognized message and the application help.
     112 *  @param[in] index The index of the parameter.
     113 *  @param[in] parameter The parameter name.
     114 */
     115void print_unrecognized(int index, const char * parameter);
    93116
    94117#endif
Note: See TracChangeset for help on using the changeset viewer.