Changeset 6843a9c in mainline for uspace/app/bdsh/cmds/modules/echo/echo.c
- Timestamp:
- 2012-06-29T13:02:14Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 722912e
- Parents:
- ba72f2b (diff), 0bbd13e (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
rba72f2b r6843a9c 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 libc 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 * ICMP common interface implementation. 35 * @see icmp_common.h 36 */ 39 static const char *cmdname = "echo"; 37 40 38 #include <net/modules.h> 39 #include <net/icmp_common.h> 40 #include <ipc/services.h> 41 #include <ipc/icmp.h> 42 #include <sys/time.h> 43 #include <async.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 } 44 49 45 /** Connect to the ICMP module. 46 * 47 * @return ICMP module session. 48 * 49 */ 50 async_sess_t *icmp_connect_module(void) 51 { 52 return connect_to_service(SERVICE_ICMP); 50 return; 53 51 } 54 52 55 /** @} 56 */ 53 /* Main entry point for echo, accepts an array of arguments */ 54 int cmd_echo(char **argv) 55 { 56 unsigned int argc; 57 58 for (argc = 1; argv[argc] != NULL; argc ++) { 59 printf("%s ", argv[argc]); 60 } 61 printf("\n"); 62 return CMD_SUCCESS; 63 64 } 65
Note:
See TracChangeset
for help on using the changeset viewer.