Changeset 3be62bc in mainline for uspace/srv/net/app/parse.h
- Timestamp:
- 2010-03-09T22:23:18Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9f2ea28
- Parents:
- a8a13d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/srv/net/app/parse.h ¶
ra8a13d0 r3be62bc 38 38 #define __NET_APP_PARSE__ 39 39 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. 43 46 */ 44 void print_unrecognized(int index, const char * parameter);47 int parse_address_family(const char * name); 45 48 46 49 /** Parses the next parameter as an integral number. … … 58 61 */ 59 62 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);75 63 76 64 /** Parses the next named parameter as an integral number. … … 92 80 int parse_parameter_name_int(int argc, char ** argv, int * index, int * value, const char * name, int offset, int (*parse_value)(const char * value)); 93 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 */ 95 int 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 */ 102 int 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 */ 109 int 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 */ 115 void print_unrecognized(int index, const char * parameter); 116 94 117 #endif 95 118
Note:
See TracChangeset
for help on using the changeset viewer.