Changeset 97c7682 in mainline for uspace/app/bdsh/cmds/modules/echo/echo.c
- 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/app/bdsh/cmds/modules/echo/echo.c
r0747468 r97c7682 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Alexander Prutkov 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libnet 30 * @{ 31 */ 29 #include <stdio.h> 30 #include <stdlib.h> 31 #include "config.h" 32 #include "util.h" 33 #include "errors.h" 34 #include "entry.h" 35 #include "echo.h" 36 #include "cmds.h" 37 #include "errno.h" 32 38 33 /** @file 34 * Internetwork layer services - network interface layer service type 35 * translation. 36 */ 39 static const char *cmdname = "echo"; 37 40 38 #ifndef LIBNET_PROTOCOL_MAP_H_ 39 #define LIBNET_PROTOCOL_MAP_H_ 41 void help_cmd_echo(unsigned int level) 42 { 43 if (level == HELP_SHORT) { 44 printf("`%s' prints arguments as they are, followed by a new line.\n", cmdname); 45 } else { 46 help_cmd_echo(HELP_SHORT); 47 printf("Usage: %s [arg ...]\n", cmdname); 48 } 40 49 41 #include <ethernet_lsap.h> 42 #include <ethernet_protocols.h> 43 #include <net_hardware.h> 50 return; 51 } 44 52 45 #include <ipc/services.h> 53 /* Main entry point for echo, accepts an array of arguments */ 54 int cmd_echo(char **argv) 55 { 56 unsigned int argc; 46 57 47 extern eth_type_t protocol_map(services_t, services_t); 48 extern services_t protocol_unmap(services_t, int);49 extern eth_type_t lsap_map(eth_lsap_t); 50 extern eth_lsap_t lsap_unmap(eth_type_t);51 extern hw_type_t hardware_map(services_t);58 for (argc = 1; argv[argc] != NULL; argc ++) { 59 printf("%s ", argv[argc]); 60 } 61 printf("\n"); 62 return CMD_SUCCESS; 52 63 53 #endif 64 } 54 65 55 /** @}56 */
Note:
See TracChangeset
for help on using the changeset viewer.