Changeset 074444f in mainline for uspace/app/sbi/src/os


Ignore:
Timestamp:
2010-04-10T11:15:33Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ef0fc3, 38aaacc2
Parents:
23de644
Message:

Update SBI to rev. 184.

Location:
uspace/app/sbi/src/os
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/os/helenos.c

    r23de644 r074444f  
    3838#include "os.h"
    3939
     40/** Path to executable file via which we have been invoked. */
     41static char *ef_path;
     42
    4043/*
    4144 * Using HelenOS-specific string API.
     
    7073{
    7174        return str_cmp(a, b);
     75}
     76
     77/** Return number of characters in string. */
     78size_t os_str_length(const char *str)
     79{
     80        return str_length(str);
    7281}
    7382
     
    156165        return EOK;
    157166}
     167
     168/** Store the executable file path via which we were executed. */
     169void os_store_ef_path(char *path)
     170{
     171        ef_path = path;
     172}
     173
     174/** Return path to the Sysel library
     175 *
     176 * @return New string. Caller should deallocate it using @c free().
     177 */
     178char *os_get_lib_path(void)
     179{
     180        return os_str_dup("/src/sysel/lib");
     181}
  • uspace/app/sbi/src/os/os.h

    r23de644 r074444f  
    3333int os_str_cmp(const char *a, const char *b);
    3434char *os_str_dup(const char *str);
     35size_t os_str_length(const char *str);
    3536int os_str_get_char(const char *str, int index, int *out_char);
    3637void os_input_disp_help(void);
     
    3839int os_exec(char *const cmd[]);
    3940
     41void os_store_ef_path(char *path);
     42char *os_get_lib_path(void);
    4043
    4144#endif
  • uspace/app/sbi/src/os/posix.c

    r23de644 r074444f  
    2929/** @file POSIX-specific code. */
    3030
     31#include <libgen.h>
    3132#include <stdio.h>
    3233#include <stdlib.h>
     
    3940
    4041#include "os.h"
     42
     43/** Path to executable file via which we have been invoked. */
     44static char *ef_path;
    4145
    4246/*
     
    7175{
    7276        return strcmp(a, b);
     77}
     78
     79/** Return number of characters in string. */
     80size_t os_str_length(const char *str)
     81{
     82        return strlen(str);
    7383}
    7484
     
    146156        return EOK;
    147157}
     158
     159/** Store the executable file path via which we were executed. */
     160void os_store_ef_path(char *path)
     161{
     162        ef_path = path;
     163}
     164
     165/** Return path to the Sysel library
     166 *
     167 * @return New string. Caller should deallocate it using @c free().
     168 */
     169char *os_get_lib_path(void)
     170{
     171        return os_str_acat(dirname(ef_path), "/lib");
     172}
Note: See TracChangeset for help on using the changeset viewer.