Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/scli.c

    r09ab0a9a ra02aa5c  
    11/*
    22 * Copyright (c) 2008 Tim Post
     3 * Copyright (c) 2018 Matthieu Riolo
    34 * All rights reserved.
    45 *
     
    3132#include <stddef.h>
    3233#include <str.h>
     34#include <adt/odict.h>
    3335#include "config.h"
    3436#include "scli.h"
     
    4244static iostate_t *iostate;
    4345static iostate_t stdiostate;
     46
     47odict_t alias_dict;
    4448
    4549/*
     
    5559 */
    5660const char *progname = PACKAGE_NAME;
     61
     62static int alias_cmp(void *a, void *b)
     63{
     64        return str_cmp((char *)a, (char *)b);
     65}
     66
     67static void *alias_key(odlink_t *odlink)
     68{
     69        return (void *)odict_get_instance(odlink, alias_t, odict)->name;
     70}
    5771
    5872/* These are not exposed, even to builtins */
     
    108122        iostate = &stdiostate;
    109123
     124        odict_initialize(&alias_dict, alias_key, alias_cmp);
     125
    110126        if (cli_init(&usr))
    111127                exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.