Changeset 97c7682 in mainline for uspace/lib/posix/getopt.h
- Timestamp:
- 2012-07-14T11:18:40Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 804d9b6
- Parents:
- 0747468 (diff), f0348c8 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/getopt.h
r0747468 r97c7682 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup udp29 /** @addtogroup libposix 30 30 * @{ 31 31 */ 32 /** @file Command line argument parsing. 33 */ 34 #ifndef POSIX_GETOPT_H 35 #define POSIX_GETOPT_H 32 36 33 /** @file 34 * UDP header definition. 35 * Based on the RFC 768. 36 */ 37 #include "unistd.h" 37 38 38 #ifndef NET_UDP_HEADER_H_ 39 #define NET_UDP_HEADER_H_ 39 /* Option Arguments */ 40 #define no_argument 0 41 #define required_argument 1 42 #define optional_argument 2 40 43 41 #include <sys/types.h> 44 #ifndef LIBPOSIX_INTERNAL 45 struct option { 46 const char *name; 47 int has_arg; 48 int *flag; 49 int val; 50 }; 51 #endif 42 52 43 /** UDP header size in bytes. */ 44 #define UDP_HEADER_SIZE sizeof(udp_header_t) 53 extern int posix_getopt_long(int, char * const [], const char *, const struct option *, int *); 45 54 46 /** Type definition of the user datagram header.47 * @see udp_header48 */49 typedef struct udp_header udp_header_t;50 55 51 /** User datagram header. */ 52 struct udp_header { 53 uint16_t source_port; 54 uint16_t destination_port; 55 uint16_t total_length; 56 uint16_t checksum; 57 } __attribute__ ((packed)); 56 #ifndef LIBPOSIX_INTERNAL 57 #define getopt_long posix_getopt_long 58 #endif 59 58 60 59 61 #endif 60 61 /** @}62 /** 63 * @} 62 64 */
Note:
See TracChangeset
for help on using the changeset viewer.