Changeset 3aae4e8 in mainline for uspace/app


Ignore:
Timestamp:
2010-04-04T22:07:05Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
23de644
Parents:
9f10660f (diff), 73060801 (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.

Location:
uspace/app
Files:
14 added
5 edited
14 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/Makefile

    r9f10660f r3aae4e8  
    2929
    3030USPACE_PREFIX = ../..
    31 LIBS = $(LIB_PREFIX)/block/libblock.a $(LIB_PREFIX)/clui/libclui.a
    32 EXTRA_CFLAGS = -I$(LIB_PREFIX)/block -I$(LIB_PREFIX)/clui -I. -Icmds/ \
    33     -Icmds/builtins -Icmds/modules
     31LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCLUI_PREFIX)/libclui.a
     32EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCLUI_PREFIX) -I. -Icmds/ \
     33        -Icmds/builtins -Icmds/modules
    3434BINARY = bdsh
    3535
  • uspace/app/bdsh/input.c

    r9f10660f r3aae4e8  
    5050#include "errors.h"
    5151#include "exec.h"
     52
     53extern volatile unsigned int cli_quit;
    5254
    5355/** Text input field. */
     
    107109{
    108110        char *str;
     111        int rc;
    109112
    110113        fflush(stdout);
     
    114117        console_set_style(fphone(stdout), STYLE_NORMAL);
    115118
    116         str = tinput_read(tinput);
     119        rc = tinput_read(tinput, &str);
     120        if (rc == ENOENT) {
     121                /* User requested exit */
     122                cli_quit = 1;
     123                putchar('\n');
     124                return;
     125        }
     126
     127        if (rc != EOK) {
     128                /* Error in communication with console */
     129                return;
     130        }
    117131
    118132        /* Check for empty input. */
  • uspace/app/bdsh/scli.c

    r9f10660f r3aae4e8  
    100100                }
    101101        }
    102         goto finit;
    103102
    104 finit:
     103        printf("Leaving %s.\n", progname);
     104
    105105        cli_finit(&usr);
    106106        return ret;
  • uspace/app/netecho/Makefile

    r9f10660f r3aae4e8  
    2828#
    2929
    30 NET_BASE = ..
    31 USPACE_PREFIX = ../../..
    32 LIBRARY = libsocket
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBSOCKET_PREFIX)/libsocket.a
     32EXTRA_CFLAGS = -I$(LIBSOCKET_PREFIX)/include
     33BINARY = netecho
    3334
    3435SOURCES = \
    35         socket_client.c \
    36         $(NET_BASE)/inet.c \
    37         $(NET_BASE)/modules.c \
    38         $(NET_BASE)/structures/dynamic_fifo.c
     36        netecho.c \
     37        parse.c \
     38        print_error.c
    3939
    4040include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/netecho/netecho.c

    r9f10660f r3aae4e8  
    2727 */
    2828
    29 /** @addtogroup echo
     29/** @addtogroup netecho
    3030 *  @{
    3131 */
    3232
    3333/** @file
    34  *  Echo application.
     34 *  Network echo application.
    3535 *  Answers received packets.
    3636 */
     
    4141#include <task.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/in6.h"
    45 #include "../../include/inet.h"
    46 #include "../../include/socket.h"
    47 
    48 #include "../../err.h"
    49 
    50 #include "../parse.h"
    51 #include "../print_error.h"
    52 
    53 /** Echo module name.
    54  */
    55 #define NAME    "Echo"
     43#include <in.h>
     44#include <in6.h>
     45#include <inet.h>
     46#include <socket.h>
     47#include <net_err.h>
     48
     49#include "parse.h"
     50#include "print_error.h"
     51
     52/** Network echo module name.
     53 */
     54#define NAME    "Network Echo"
    5655
    5756/** Prints the application help.
  • uspace/app/netecho/parse.c

    r9f10660f r3aae4e8  
    3838#include <str.h>
    3939
    40 #include "../include/socket.h"
    41 
    42 #include "../err.h"
     40#include <socket.h>
     41#include <net_err.h>
    4342
    4443#include "parse.h"
  • uspace/app/netecho/parse.h

    r9f10660f r3aae4e8  
    3838#define __NET_APP_PARSE__
    3939
    40 #include "../include/socket.h"
     40#include <socket.h>
    4141
    4242/** Translates the character string to the address family number.
     
    4545 *  @returns EAFNOSUPPORTED if the address family is not supported.
    4646 */
    47 int parse_address_family(const char * name);
     47extern int parse_address_family(const char * name);
    4848
    4949/** Parses the next parameter as an integral number.
     
    6060 *  @returns EINVAL if the parameter is in wrong format.
    6161 */
    62 int parse_parameter_int(int argc, char ** argv, int * index, int * value, const char * name, int offset);
     62extern int parse_parameter_int(int argc, char ** argv, int * index, int * value, const char * name, int offset);
    6363
    6464/** Parses the next named parameter as an integral number.
     
    7878 *  @returns ENOENT if the parameter name has not been found.
    7979 */
    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));
     80extern int parse_parameter_name_int(int argc, char ** argv, int * index, int * value, const char * name, int offset, int (*parse_value)(const char * value));
    8181
    8282/** Parses the next parameter as a character string.
     
    9393 *  @returns EINVAL if the parameter is missing.
    9494 */
    95 int parse_parameter_string(int argc, char ** argv, int * index, char ** value, const char * name, int offset);
     95extern int parse_parameter_string(int argc, char ** argv, int * index, char ** value, const char * name, int offset);
    9696
    9797/** Translates the character string to the protocol family number.
     
    100100 *  @returns EPFNOSUPPORTED if the protocol family is not supported.
    101101 */
    102 int parse_protocol_family(const char * name);
     102extern int parse_protocol_family(const char * name);
    103103
    104104/** Translates the character string to the socket type number.
     
    107107 *  @returns ESOCKNOSUPPORTED if the socket type is not supported.
    108108 */
    109 int parse_socket_type(const char * name);
     109extern int parse_socket_type(const char * name);
    110110
    111111/** Prints the parameter unrecognized message and the application help.
     
    113113 *  @param[in] parameter The parameter name.
    114114 */
    115 void print_unrecognized(int index, const char * parameter);
     115extern void print_unrecognized(int index, const char * parameter);
    116116
    117117#endif
  • uspace/app/netecho/print_error.c

    r9f10660f r3aae4e8  
    3737#include <stdio.h>
    3838
    39 #include "../include/icmp_codes.h"
    40 #include "../include/socket_errno.h"
     39#include <icmp_codes.h>
     40#include <socket_errno.h>
    4141
    4242#include "print_error.h"
  • uspace/app/netecho/print_error.h

    r9f10660f r3aae4e8  
    5656 *  @param[in] suffix The error description suffix. May be NULL.
    5757 */
    58 void icmp_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
     58extern void icmp_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
    5959
    6060/** Prints the error description.
     
    6565 *  @param[in] suffix The error description suffix. May be NULL.
    6666 */
    67 void print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
     67extern void print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
    6868
    6969/** Prints the specific socket error description.
     
    7373 *  @param[in] suffix The error description suffix. May be NULL.
    7474 */
    75 void socket_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
     75extern void socket_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
    7676
    7777#endif
  • uspace/app/nettest1/Makefile

    r9f10660f r3aae4e8  
    2828#
    2929
    30 NET_BASE = ../..
    31 USPACE_PREFIX = ../../../..
    32 LIBS = $(NET_BASE)/socket/libsocket.a
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBSOCKET_PREFIX)/libsocket.a
     32EXTRA_CFLAGS = -I$(LIBSOCKET_PREFIX)/include
    3333BINARY = nettest1
    3434
    3535SOURCES = \
    3636        nettest1.c \
    37         $(NET_BASE)/app/nettest.c \
    38         $(NET_BASE)/app/parse.c \
    39         $(NET_BASE)/app/print_error.c
     37        nettest.c \
     38        parse.c \
     39        print_error.c
    4040
    4141include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/nettest1/nettest.c

    r9f10660f r3aae4e8  
    3737#include <stdio.h>
    3838
    39 #include "../include/socket.h"
    40 
    41 #include "../err.h"
     39#include <socket.h>
     40#include <net_err.h>
    4241
    4342#include "nettest.h"
  • uspace/app/nettest1/nettest.h

    r9f10660f r3aae4e8  
    3838#define __NET_TEST__
    3939
    40 #include "../include/socket.h"
     40#include <socket.h>
    4141
    4242/** Prints a mark.
     
    4444 *  @param[in] index The index of the mark to be printed.
    4545 */
    46 void print_mark(int index);
     46extern void print_mark(int index);
    4747
    4848/** Creates new sockets.
     
    5555 *  @returns Other error codes as defined for the socket() function.
    5656 */
    57 int sockets_create(int verbose, int * socket_ids, int sockets, int family, sock_type_t type);
     57extern int sockets_create(int verbose, int * socket_ids, int sockets, int family, sock_type_t type);
    5858
    5959/** Closes sockets.
     
    6464 *  @returns Other error codes as defined for the closesocket() function.
    6565 */
    66 int sockets_close(int verbose, int * socket_ids, int sockets);
     66extern int sockets_close(int verbose, int * socket_ids, int sockets);
    6767
    6868/** Connects sockets.
     
    7575 *  @returns Other error codes as defined for the connect() function.
    7676 */
    77 int sockets_connect(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen);
     77extern int sockets_connect(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen);
    7878
    7979/** Sends data via sockets.
     
    8989 *  @returns Other error codes as defined for the sendto() function.
    9090 */
    91 int sockets_sendto(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages);
     91extern int sockets_sendto(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages);
    9292
    9393/** Receives data via sockets.
     
    103103 *  @returns Other error codes as defined for the recvfrom() function.
    104104 */
    105 int sockets_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
     105extern int sockets_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
    106106
    107107/** Sends and receives data via sockets.
     
    119119 *  @returns Other error codes as defined for the recvfrom() function.
    120120 */
    121 int sockets_sendto_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
     121extern int sockets_sendto_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
    122122
    123123#endif
  • uspace/app/nettest1/nettest1.c

    r9f10660f r3aae4e8  
    4141#include <time.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/in6.h"
    45 #include "../../include/inet.h"
    46 #include "../../include/socket.h"
    47 
    48 #include "../../err.h"
    49 
    50 #include "../nettest.h"
    51 #include "../parse.h"
    52 #include "../print_error.h"
     43#include <in.h>
     44#include <in6.h>
     45#include <inet.h>
     46#include <socket.h>
     47#include <net_err.h>
     48
     49#include "nettest.h"
     50#include "parse.h"
     51#include "print_error.h"
    5352
    5453/** Echo module name.
  • uspace/app/nettest2/Makefile

    r9f10660f r3aae4e8  
    2828#
    2929
    30 NET_BASE = ../..
    31 USPACE_PREFIX = ../../../..
    32 LIBS = $(NET_BASE)/socket/libsocket.a
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBSOCKET_PREFIX)/libsocket.a
     32EXTRA_CFLAGS = -I$(LIBSOCKET_PREFIX)/include
    3333BINARY = nettest2
    3434
    3535SOURCES = \
    3636        nettest2.c \
    37         $(NET_BASE)/app/nettest.c \
    38         $(NET_BASE)/app/parse.c \
    39         $(NET_BASE)/app/print_error.c
     37        nettest.c \
     38        parse.c \
     39        print_error.c
    4040
    4141include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/nettest2/nettest2.c

    r9f10660f r3aae4e8  
    4141#include <time.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/in6.h"
    45 #include "../../include/inet.h"
    46 #include "../../include/socket.h"
    47 
    48 #include "../../err.h"
    49 
    50 #include "../nettest.h"
    51 #include "../parse.h"
    52 #include "../print_error.h"
     43#include <in.h>
     44#include <in6.h>
     45#include <inet.h>
     46#include <socket.h>
     47#include <net_err.h>
     48
     49#include "nettest.h"
     50#include "parse.h"
     51#include "print_error.h"
    5352
    5453/** Echo module name.
  • uspace/app/ping/Makefile

    r9f10660f r3aae4e8  
    2828#
    2929
    30 NET_BASE = ../..
    31 USPACE_PREFIX = ../../../..
    32 LIBS = $(NET_BASE)/socket/libsocket.a
    33 BINARY = echo
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBSOCKET_PREFIX)/libsocket.a
     32EXTRA_CFLAGS = -I$(LIBSOCKET_PREFIX)/include
     33BINARY = ping
    3434
    3535SOURCES = \
    36         echo.c \
    37         $(NET_BASE)/app/parse.c \
    38         $(NET_BASE)/app/print_error.c
     36        ping.c \
     37        parse.c \
     38        print_error.c
    3939
    4040include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/ping/ping.c

    r9f10660f r3aae4e8  
    4242#include <ipc/services.h>
    4343
    44 #include "../../include/icmp_api.h"
    45 #include "../../include/in.h"
    46 #include "../../include/in6.h"
    47 #include "../../include/inet.h"
    48 #include "../../include/ip_codes.h"
    49 #include "../../include/socket_errno.h"
    50 
    51 #include "../../err.h"
    52 
    53 #include "../parse.h"
    54 #include "../print_error.h"
     44#include <icmp_api.h>
     45#include <in.h>
     46#include <in6.h>
     47#include <inet.h>
     48#include <ip_codes.h>
     49#include <socket_errno.h>
     50#include <net_err.h>
     51
     52#include "parse.h"
     53#include "print_error.h"
    5554
    5655/** Echo module name.
  • uspace/app/sbi/Makefile

    r9f10660f r3aae4e8  
    2828
    2929USPACE_PREFIX = ../..
    30 LIBS = $(LIB_PREFIX)/clui/libclui.a
    31 EXTRA_CFLAGS = -D__HELENOS__ -I$(LIB_PREFIX)/clui
     30LIBS = $(LIBCLUI_PREFIX)/libclui.a
     31EXTRA_CFLAGS = -D__HELENOS__ -I$(LIBCLUI_PREFIX)
    3232
    3333BINARY = sbi
  • uspace/app/sbi/src/os/helenos.c

    r9f10660f r3aae4e8  
    105105{
    106106        char *line;
     107        int rc;
    107108
    108109        if (tinput == NULL) {
     
    112113        }
    113114
    114         line = tinput_read(tinput);
    115         if (line == NULL)
     115        rc = tinput_read(tinput, &line);
     116        if (rc == ENOENT) {
     117                /* User-requested abort */
     118                *ptr = os_str_dup("");
     119                return EOK;
     120        }
     121
     122        if (rc != EOK) {
     123                /* Error in communication with console */
    116124                return EIO;
     125        }
    117126
    118127        /* XXX Input module needs trailing newline to keep going. */
Note: See TracChangeset for help on using the changeset viewer.