Ignore:
Timestamp:
2012-06-29T13:02:14Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
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.
Message:

Merge mainline changes

Trivial conflicts.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/echo/echo.c

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Alexander Prutkov
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    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"
    3238
    33 /** @file
    34  * ICMP common interface implementation.
    35  * @see icmp_common.h
    36  */
     39static const char *cmdname = "echo";
    3740
    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>
     41void 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        }
    4449
    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;
    5351}
    5452
    55 /** @}
    56  */
     53/* Main entry point for echo, accepts an array of arguments */
     54int 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.