Changeset 3e828ea in mainline for uspace/app
- Timestamp:
- 2019-09-23T12:49:29Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9be2358
- Parents:
- 9259d20 (diff), 1a4ec93f (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. - git-author:
- Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
- Location:
- uspace/app
- Files:
-
- 50 added
- 25 deleted
- 19 edited
- 29 moved
-
barber/Makefile (deleted)
-
barber/barber.c (modified) (1 diff)
-
barber/meson.build (added)
-
bdsh/cmds/modules/alias/alias.c (added)
-
bdsh/cmds/modules/alias/alias.h (added)
-
bdsh/cmds/modules/alias/alias_def.inc (added)
-
bdsh/cmds/modules/alias/entry.h (added)
-
bdsh/cmds/modules/ls/ls.c (modified) (12 diffs)
-
bdsh/cmds/modules/ls/ls.h (modified) (2 diffs)
-
bdsh/cmds/modules/modules.c (modified) (2 diffs)
-
bdsh/cmds/modules/modules.h (modified) (1 diff)
-
bdsh/cmds/modules/unalias/entry.h (added)
-
bdsh/cmds/modules/unalias/unalias.c (added)
-
bdsh/cmds/modules/unalias/unalias.h (added)
-
bdsh/cmds/modules/unalias/unalias_def.inc (added)
-
bdsh/compl.c (modified) (8 diffs)
-
bdsh/config.h (modified) (1 diff)
-
bdsh/exec.c (modified) (3 diffs)
-
bdsh/input.c (modified) (6 diffs)
-
bdsh/meson.build (moved) (moved from uspace/app/bdsh/Makefile ) (1 diff)
-
bdsh/scli.c (modified) (5 diffs)
-
bdsh/scli.h (modified) (3 diffs)
-
bdsh/util.c (modified) (1 diff)
-
bdsh/util.h (modified) (1 diff)
-
bithenge/meson.build (added)
-
blkdump/meson.build (moved) (moved from uspace/srv/klog/Makefile ) (1 diff)
-
contacts/meson.build (moved) (moved from boot/arch/abs32le/Makefile.inc ) (2 diffs)
-
corecfg/meson.build (added)
-
cpptest/main.cpp (modified) (1 diff)
-
cpptest/meson.build (added)
-
date/meson.build (moved) (moved from uspace/app/date/Makefile ) (1 diff)
-
devctl/meson.build (moved) (moved from uspace/app/loc/Makefile ) (1 diff)
-
df/meson.build (moved) (moved from uspace/app/df/Makefile ) (1 diff)
-
dltest/Makefile (deleted)
-
dltest/meson.build (added)
-
dltests/meson.build (added)
-
dnscfg/Makefile (deleted)
-
dnscfg/meson.build (added)
-
dnsres/Makefile (deleted)
-
dnsres/meson.build (added)
-
download/main.c (modified) (1 diff)
-
download/meson.build (moved) (moved from uspace/srv/hid/rfb/Makefile ) (1 diff)
-
edit/meson.build (moved) (moved from uspace/app/stats/Makefile ) (1 diff)
-
fdisk/meson.build (added)
-
fontviewer/fontviewer.c (modified) (1 diff)
-
fontviewer/meson.build (added)
-
getterm/meson.build (added)
-
getterm/version.c (modified) (1 diff)
-
gfxdemo/meson.build (moved) (moved from uspace/app/pci/Makefile ) (1 diff)
-
gunzip/meson.build (moved) (moved from uspace/app/vol/Makefile ) (1 diff)
-
hbench/Makefile (deleted)
-
hbench/meson.build (moved) (moved from uspace/app/contacts/Makefile ) (1 diff)
-
inet/meson.build (moved) (moved from uspace/app/ping/Makefile ) (1 diff)
-
init/meson.build (moved) (moved from uspace/app/redir/Makefile ) (1 diff)
-
kill/meson.build (added)
-
killall/meson.build (moved) (moved from uspace/lib/c/arch/abs32le/Makefile.common ) (1 diff)
-
kio/meson.build (added)
-
loc/meson.build (added)
-
logset/meson.build (moved) (moved from uspace/app/logset/Makefile ) (1 diff)
-
lprint/meson.build (added)
-
meson.build (moved) (moved from uspace/srv/fs/udf/Makefile ) (2 diffs)
-
mixerctl/meson.build (added)
-
mkbd/meson.build (added)
-
mkexfat/Makefile (deleted)
-
mkexfat/meson.build (added)
-
mkext4/Makefile (deleted)
-
mkext4/meson.build (moved) (moved from uspace/app/lprint/Makefile ) (1 diff)
-
mkfat/meson.build (added)
-
mkmfs/Makefile (deleted)
-
mkmfs/meson.build (added)
-
modplay/meson.build (moved) (moved from uspace/app/modplay/Makefile ) (1 diff)
-
netecho/meson.build (added)
-
nic/meson.build (added)
-
nterm/meson.build (added)
-
pci/meson.build (added)
-
ping/meson.build (added)
-
pkg/meson.build (moved) (moved from uspace/app/pkg/Makefile ) (1 diff)
-
redir/meson.build (moved) (moved from uspace/lib/c/arch/riscv64/Makefile.common ) (2 diffs)
-
sbi/Makefile (deleted)
-
sbi/meson.build (moved) (moved from uspace/app/kill/Makefile ) (1 diff)
-
sportdmp/Makefile (deleted)
-
sportdmp/meson.build (added)
-
stats/meson.build (added)
-
sysinfo/Makefile (deleted)
-
sysinfo/meson.build (added)
-
sysinst/Makefile (deleted)
-
sysinst/meson.build (moved) (moved from uspace/app/nic/Makefile ) (1 diff)
-
taskdump/Makefile (deleted)
-
taskdump/meson.build (moved) (moved from uspace/srv/hid/s3c24xx_ts/Makefile ) (1 diff)
-
tester/Makefile (deleted)
-
tester/meson.build (added)
-
testread/Makefile (deleted)
-
testread/meson.build (added)
-
testrunner/Makefile (deleted)
-
testrunner/meson.build (added)
-
testwrit/Makefile (deleted)
-
testwrit/meson.build (added)
-
tetris/Makefile (deleted)
-
tetris/meson.build (moved) (moved from uspace/lib/fs/Makefile ) (1 diff)
-
tmon/Makefile (deleted)
-
tmon/meson.build (added)
-
top/Makefile (deleted)
-
top/meson.build (added)
-
trace/Makefile (deleted)
-
trace/meson.build (added)
-
untar/meson.build (added)
-
usbinfo/Makefile (deleted)
-
usbinfo/meson.build (moved) (moved from uspace/drv/test/test1/Makefile ) (1 diff)
-
vcalc/meson.build (added)
-
vdemo/meson.build (added)
-
viewer/meson.build (moved) (moved from uspace/app/viewer/Makefile ) (1 diff)
-
viewer/viewer.c (modified) (1 diff)
-
vlaunch/meson.build (moved) (moved from uspace/app/vdemo/Makefile ) (1 diff)
-
vlaunch/vlaunch.c (modified) (1 diff)
-
vol/meson.build (added)
-
vterm/Makefile (deleted)
-
vterm/meson.build (added)
-
vuhid/Makefile (deleted)
-
vuhid/meson.build (moved) (moved from uspace/drv/block/usbmast/Makefile ) (1 diff)
-
wavplay/meson.build (moved) (moved from uspace/lib/pcm/Makefile ) (1 diff)
-
websrv/Makefile (deleted)
-
websrv/meson.build (added)
-
wifi_supplicant/meson.build (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/barber/barber.c
r9259d20 r3e828ea 45 45 #include <window.h> 46 46 #include <canvas.h> 47 #include < surface.h>48 #include < codec/tga.gz.h>47 #include <draw/surface.h> 48 #include <draw/codec.h> 49 49 #include "images.h" 50 50 -
uspace/app/bdsh/cmds/modules/ls/ls.c
r9259d20 r3e828ea 42 42 #include <vfs/vfs.h> 43 43 #include <str.h> 44 #include <cap.h> 44 45 45 46 #include "ls.h" … … 58 59 { "unsort", no_argument, 0, 'u' }, 59 60 { "recursive", no_argument, 0, 'r' }, 61 { "exact-size", no_argument, 0, 'e' }, 62 { "single-column", no_argument, 0, '1' }, 60 63 { 0, 0, 0, 0 } 61 64 }; … … 63 66 /* Prototypes for the ls command, excluding entry points. */ 64 67 static unsigned int ls_start(ls_job_t *); 65 static void ls_print(struct dir_elem_t *); 66 static int ls_cmp(const void *, const void *); 68 static errno_t ls_print(struct dir_elem_t *); 69 static errno_t ls_print_single_column(struct dir_elem_t *); 70 static int ls_cmp_type_name(const void *, const void *); 71 static int ls_cmp_name(const void *, const void *); 67 72 static signed int ls_scan_dir(const char *, DIR *, struct dir_elem_t **); 68 73 static unsigned int ls_recursive(const char *, DIR *); … … 74 79 ls->sort = 1; 75 80 81 ls->exact_size = false; 82 ls->single_column = false; 83 ls->printer = ls_print; 76 84 return 1; 77 85 } … … 88 96 * @param de Directory element. 89 97 */ 90 static void ls_print(struct dir_elem_t *de) 91 { 92 if (de->s.is_file) 93 printf("%-40s\t%llu\n", de->name, (long long) de->s.size); 94 else if (de->s.is_directory) 95 printf("%-40s\t<dir>\n", de->name); 98 static errno_t ls_print(struct dir_elem_t *de) 99 { 100 int width = 13; 101 102 if (de->s.is_file) { 103 if (ls.exact_size) { 104 printf("%-40s\t%*llu\n", de->name, width, (long long) de->s.size); 105 return EOK; 106 } 107 108 cap_spec_t cap; 109 cap_from_blocks(de->s.size, 1, &cap); 110 cap_simplify(&cap); 111 112 char *rptr; 113 errno_t rc = cap_format(&cap, &rptr); 114 if (rc != EOK) { 115 return rc; 116 } 117 118 char *sep = str_rchr(rptr, ' '); 119 if (sep == NULL) { 120 free(rptr); 121 return ENOENT; 122 } 123 124 *sep = '\0'; 125 126 printf("%-40s\t%*s %2s\n", de->name, width - 3, rptr, sep + 1); 127 free(rptr); 128 } else if (de->s.is_directory) 129 printf("%-40s\t%*s\n", de->name, width, "<dir>"); 96 130 else 97 131 printf("%-40s\n", de->name); 132 133 return EOK; 134 } 135 136 static errno_t ls_print_single_column(struct dir_elem_t *de) 137 { 138 if (de->s.is_file) { 139 printf("%s\n", de->name); 140 } else { 141 printf("%s/\n", de->name); 142 } 143 144 return EOK; 98 145 } 99 146 … … 109 156 * @return -1 if a < b, 1 otherwise. 110 157 */ 111 static int ls_cmp (const void *a, const void *b)158 static int ls_cmp_type_name(const void *a, const void *b) 112 159 { 113 160 struct dir_elem_t const *da = a; … … 120 167 else 121 168 return 1; 169 } 170 171 /** Compare directories/files per name 172 * 173 * This comparision ignores the type of 174 * the node. Sorted will strictly by name. 175 * 176 */ 177 static int ls_cmp_name(const void *a, const void *b) 178 { 179 struct dir_elem_t const *da = a; 180 struct dir_elem_t const *db = b; 181 182 return str_cmp(da->name, db->name); 122 183 } 123 184 … … 192 253 } 193 254 194 if (ls.sort) 195 qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), ls_cmp); 196 197 for (i = 0; i < nbdirs; i++) 198 ls_print(&tosort[i]); 255 if (ls.sort) { 256 int (*compar)(const void *, const void *); 257 compar = ls.single_column ? ls_cmp_name : ls_cmp_type_name; 258 qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), compar); 259 } 260 261 for (i = 0; i < nbdirs; i++) { 262 if (ls.printer(&tosort[i]) != EOK) { 263 cli_error(CL_ENOMEM, "%s: Out of memory", cmdname); 264 goto out; 265 } 266 } 199 267 200 268 /* Populate the directory list. */ … … 333 401 "If not path is given, the current working directory is used.\n" 334 402 "Options:\n" 335 " -h, --help A short option summary\n" 336 " -u, --unsort Do not sort directory entries\n" 337 " -r, --recursive List subdirectories recursively\n", 403 " -h, --help A short option summary\n" 404 " -u, --unsort Do not sort directory entries\n" 405 " -r, --recursive List subdirectories recursively\n" 406 " -e, --exact-size File sizes will be unformatted (raw bytes count)\n" 407 " -1, --single-column Only the names will be returned\n", 338 408 cmdname); 339 409 } … … 364 434 365 435 while (c != -1) { 366 c = getopt_long(argc, argv, "hur ", long_options, &opt_ind);436 c = getopt_long(argc, argv, "hure1", long_options, &opt_ind); 367 437 switch (c) { 368 438 case 'h': … … 375 445 ls.recursive = 1; 376 446 break; 447 case 'e': 448 ls.exact_size = true; 449 break; 450 case '1': 451 ls.single_column = true; 452 ls.printer = ls_print_single_column; 453 break; 377 454 } 378 455 } … … 400 477 switch (scope) { 401 478 case LS_FILE: 402 ls_print(&de); 479 if (ls.printer(&de) != EOK) { 480 cli_error(CL_ENOMEM, "%s: Out of memory", cmdname); 481 return CMD_FAILURE; 482 } 403 483 break; 404 484 case LS_DIR: -
uspace/app/bdsh/cmds/modules/ls/ls.h
r9259d20 r3e828ea 8 8 #define LS_FILE 1 9 9 #define LS_DIR 2 10 11 typedef struct {12 /* Options set at runtime. */13 unsigned int recursive;14 unsigned int sort;15 16 } ls_job_t;17 10 18 11 /** Structure to represent a directory entry. … … 26 19 }; 27 20 21 typedef struct { 22 /* Options set at runtime. */ 23 unsigned int recursive; 24 unsigned int sort; 25 26 bool single_column; 27 bool exact_size; 28 29 errno_t (*printer)(struct dir_elem_t *); 30 } ls_job_t; 31 28 32 #endif -
uspace/app/bdsh/cmds/modules/modules.c
r9259d20 r3e828ea 63 63 #include "echo/entry.h" 64 64 #include "cmp/entry.h" 65 #include "alias/entry.h" 66 #include "unalias/entry.h" 65 67 66 68 /* … … 88 90 #include "echo/echo_def.inc" 89 91 #include "cmp/cmp_def.inc" 92 #include "alias/alias_def.inc" 93 #include "unalias/unalias_def.inc" 90 94 91 95 { NULL, NULL, NULL, NULL } -
uspace/app/bdsh/cmds/modules/modules.h
r9259d20 r3e828ea 31 31 32 32 #include "../cmds.h" 33 #include "modules.h"34 33 35 34 extern module_t modules[]; -
uspace/app/bdsh/compl.c
r9259d20 r3e828ea 35 35 #include <vfs/vfs.h> 36 36 #include <str.h> 37 37 #include <adt/odict.h> 38 39 #include "scli.h" 38 40 #include "cmds/cmds.h" 39 41 #include "compl.h" 40 42 #include "exec.h" 41 43 #include "tok.h" 44 #include "util.h" 42 45 43 46 static errno_t compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state); … … 62 65 /** Length of string prefix (number of characters) */ 63 66 size_t prefix_len; 67 68 /* Pointer to the current alias */ 69 odlink_t *alias_link; 64 70 65 71 /** Pointer inside list of modules */ … … 209 215 } 210 216 *cstart += rpath_sep + 1 - prefix; 211 free(prefix);212 prefix = NULL;213 217 214 218 cs->path_list = malloc(sizeof(char *) * 2); … … 217 221 goto error; 218 222 } 219 cs->path_list[0] = dirname; 223 224 if (!is_path(prefix) && cs->is_command) { 225 cs->path_list[0] = malloc(sizeof(char) * PATH_MAX); 226 if (cs->path_list[0] == NULL) { 227 retval = ENOMEM; 228 goto error; 229 } 230 231 int ret = snprintf(cs->path_list[0], PATH_MAX, "%s/%s", search_dir[0], dirname); 232 if (ret < 0 || ret >= PATH_MAX) { 233 retval = ENOMEM; 234 goto error; 235 } 236 } else { 237 cs->path_list[0] = dirname; 238 } 239 240 free(prefix); 220 241 cs->path_list[1] = NULL; 221 242 /* … … 227 248 } else if (cs->is_command) { 228 249 /* Command without path */ 250 cs->alias_link = odict_first(&alias_dict); 229 251 cs->module = modules; 230 252 cs->builtin = builtins; … … 305 327 } 306 328 329 /* Alias */ 330 if (cs->alias_link != NULL) { 331 while (*compl == NULL && cs->alias_link != NULL) { 332 alias_t *data = odict_get_instance(cs->alias_link, alias_t, odict); 333 if (compl_match_prefix(cs, data->name)) { 334 asprintf(compl, "%s ", data->name); 335 cs->last_compl = *compl; 336 if (*compl == NULL) 337 return ENOMEM; 338 } 339 cs->alias_link = odict_next(cs->alias_link, &alias_dict); 340 } 341 } 342 307 343 /* Modules */ 308 344 if (cs->module != NULL) { 309 345 while (*compl == NULL && cs->module->name != NULL) { 346 /* prevents multiple listing of an overriden cmd */ 310 347 if (compl_match_prefix(cs, cs->module->name)) { 311 asprintf(compl, "%s ", cs->module->name); 312 cs->last_compl = *compl; 313 if (*compl == NULL) 314 return ENOMEM; 348 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)cs->module->name, NULL); 349 if (alias_link == NULL) { 350 asprintf(compl, "%s ", cs->module->name); 351 cs->last_compl = *compl; 352 if (*compl == NULL) 353 return ENOMEM; 354 } 315 355 } 316 356 cs->module++; … … 322 362 while (*compl == NULL && cs->builtin->name != NULL) { 323 363 if (compl_match_prefix(cs, cs->builtin->name)) { 324 asprintf(compl, "%s ", cs->builtin->name); 325 cs->last_compl = *compl; 326 if (*compl == NULL) 327 return ENOMEM; 364 /* prevents multiple listing of an overriden cmd */ 365 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)cs->module->name, NULL); 366 if (alias_link == NULL) { 367 asprintf(compl, "%s ", cs->builtin->name); 368 cs->last_compl = *compl; 369 if (*compl == NULL) 370 return ENOMEM; 371 } 328 372 } 329 373 cs->builtin++; … … 373 417 free(ent_path); 374 418 419 /* prevents multiple listing of an overriden cmd */ 420 if (cs->is_command && !ent_stat.is_directory) { 421 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)dent->d_name, NULL); 422 if (alias_link != NULL) { 423 continue; 424 } 425 } 426 375 427 asprintf(compl, "%s%c", dent->d_name, 376 428 ent_stat.is_directory ? '/' : ' '); -
uspace/app/bdsh/config.h
r9259d20 r3e828ea 42 42 #endif 43 43 44 /* define maximal nested aliases */ 45 #ifndef HUBS_MAX 46 #define HUBS_MAX 20 47 #endif 48 44 49 /* Used in many places */ 45 50 #define SMALL_BUFLEN 256 -
uspace/app/bdsh/exec.c
r9259d20 r3e828ea 47 47 #include "errors.h" 48 48 49 /* FIXME: Just have find_command() return an allocated string */ 50 static char *found; 51 52 static char *find_command(char *); 49 static errno_t find_command(char *, char **); 53 50 static int try_access(const char *); 54 51 … … 68 65 } 69 66 70 /** Returns the full path of "cmd" if cmd is found67 /** Returns EOK if no internal failure or else ENOMEM 71 68 * 72 * else just hand back cmd as it was presented 69 * When the parameter `cmd` can be found then the absolute path will be set in `found`. 70 * Or else `found` will be NULL. 71 * `found` will be newly allocated and must be freed by the caller 73 72 */ 74 static char *find_command(char *cmd)73 static errno_t find_command(char *cmd, char **found) 75 74 { 76 size_t i; 75 /* The user has specified a full or relative path, just give it back. */ 76 if (is_path(cmd)) { 77 if (-1 != try_access(cmd)) { 78 *found = str_dup(cmd); 79 return EOK; 80 } 77 81 78 found = (char *)malloc(PATH_MAX); 82 *found = NULL; 83 return EOK; 84 } 79 85 80 /* The user has specified a full or relative path, just give it back. */81 if ( -1 != try_access(cmd)) {82 return (char *) cmd;86 *found = (char *)malloc(PATH_MAX); 87 if (*found == NULL) { 88 return ENOMEM; 83 89 } 84 90 85 91 /* We now have n places to look for the command */ 92 size_t i; 93 size_t cmd_length = str_length(cmd); 86 94 for (i = 0; search_dir[i] != NULL; i++) { 87 memset(found, 0, PATH_MAX); 88 snprintf(found, PATH_MAX, "%s/%s", search_dir[i], cmd); 89 if (-1 != try_access(found)) { 90 return (char *) found; 95 if (str_length(search_dir[i]) + cmd_length + 2 > PATH_MAX) { 96 free(*found); 97 return ENOMEM; 98 } 99 100 memset(*found, 0, PATH_MAX); 101 snprintf(*found, PATH_MAX, "%s/%s", search_dir[i], cmd); 102 if (-1 != try_access(*found)) { 103 return EOK; 91 104 } 92 105 } 106 free(*found); 107 *found = NULL; 93 108 94 /* We didn't find it, just give it back as-is.*/95 return (char *) cmd;109 /* We didn't find it, return NULL */ 110 return EOK; 96 111 } 97 112 … … 107 122 FILE *files[3]; 108 123 109 tmp = str_dup(find_command(cmd)); 110 free(found); 124 rc = find_command(cmd, &tmp); 125 if (rc != EOK) { 126 cli_error(CL_ENOMEM, "%s: failure executing find_command()", progname); 127 return 1; 128 } 129 130 if (tmp == NULL) { 131 cli_error(CL_EEXEC, "%s: Command not found '%s'", progname, cmd); 132 return 1; 133 } 111 134 112 135 files[0] = io->stdin; -
uspace/app/bdsh/input.c
r9259d20 r3e828ea 3 3 * Copyright (c) 2011 Jiri Svoboda 4 4 * Copyright (c) 2011 Martin Sucha 5 * Copyright (c) 2018 Matthieu Riolo 5 6 * All rights reserved. 6 7 * … … 43 44 #include <stdbool.h> 44 45 #include <tinput.h> 46 #include <adt/odict.h> 47 #include <adt/list.h> 45 48 46 49 #include "config.h" … … 62 65 static void print_pipe_usage(void); 63 66 67 typedef struct { 68 link_t alias_hup_link; 69 alias_t *alias; 70 } alias_hup_t; 71 72 static bool find_alias_hup(alias_t *alias, list_t *alias_hups) 73 { 74 list_foreach(*alias_hups, alias_hup_link, alias_hup_t, link) { 75 if (alias == link->alias) { 76 return true; 77 } 78 } 79 80 return false; 81 } 82 64 83 /* 65 84 * Tokenizes input from console, sees if the first word is a built-in, if so … … 67 86 * the handler 68 87 */ 69 errno_t process_input(cliuser_t *usr) 70 { 88 static errno_t process_input_nohup(cliuser_t *usr, list_t *alias_hups, size_t count_executed_hups) 89 { 90 if (count_executed_hups >= HUBS_MAX) { 91 cli_error(CL_EFAIL, "%s: maximal alias hubs reached\n", PACKAGE_NAME); 92 return ELIMIT; 93 } 94 71 95 token_t *tokens_buf = calloc(WORD_MAX, sizeof(token_t)); 72 96 if (tokens_buf == NULL) … … 171 195 } 172 196 197 /* test if the passed cmd is an alias */ 198 odlink_t *alias_link = odict_find_eq(&alias_dict, (void *)cmd[0], NULL); 199 if (alias_link != NULL) { 200 alias_t *data = odict_get_instance(alias_link, alias_t, odict); 201 /* check if the alias already has been resolved once */ 202 if (!find_alias_hup(data, alias_hups)) { 203 alias_hup_t *hup = (alias_hup_t *)calloc(1, sizeof(alias_hup_t)); 204 if (hup == NULL) { 205 cli_error(CL_EFAIL, "%s: cannot allocate alias structure\n", PACKAGE_NAME); 206 rc = ENOMEM; 207 goto finit; 208 } 209 210 hup->alias = data; 211 list_append(&hup->alias_hup_link, alias_hups); 212 213 char *oldLine = usr->line; 214 const size_t input_length = str_size(usr->line) - str_size(cmd[0]) + str_size(data->value) + 1; 215 usr->line = (char *)malloc(input_length); 216 if (usr->line == NULL) { 217 cli_error(CL_EFAIL, "%s: cannot allocate input structure\n", PACKAGE_NAME); 218 rc = ENOMEM; 219 goto finit; 220 } 221 222 usr->line[0] = '\0'; 223 224 unsigned int cmd_replace_index = cmd_token_start; 225 for (i = 0; i < tokens_length; i++) { 226 if (i == cmd_replace_index) { 227 /* if there is a pipe symbol than cmd_token_start will point at the SPACE after the pipe symbol */ 228 if (tokens[i].type == TOKTYPE_SPACE) { 229 cmd_replace_index++; 230 str_append(usr->line, input_length, tokens[i].text); 231 continue; 232 } 233 234 str_append(usr->line, input_length, data->value); 235 } else { 236 str_append(usr->line, input_length, tokens[i].text); 237 } 238 } 239 240 /* reprocess input after string replace */ 241 rc = process_input_nohup(usr, alias_hups, count_executed_hups + 1); 242 usr->line = oldLine; 243 goto finit; 244 } 245 } 246 173 247 iostate_t new_iostate = { 174 248 .stdin = stdin, … … 225 299 } 226 300 301 errno_t process_input(cliuser_t *usr) 302 { 303 list_t alias_hups; 304 list_initialize(&alias_hups); 305 306 errno_t rc = process_input_nohup(usr, &alias_hups, 0); 307 308 list_foreach_safe(alias_hups, cur_link, next_link) { 309 alias_hup_t *cur_item = list_get_instance(cur_link, alias_hup_t, alias_hup_link); 310 free(cur_item); 311 } 312 313 return rc; 314 } 315 227 316 void print_pipe_usage(void) 228 317 { -
uspace/app/bdsh/meson.build
r9259d20 r3e828ea 28 28 # 29 29 30 USPACE_PREFIX = ../.. 31 LIBS = clui fmtutil 32 EXTRA_CFLAGS = -I. -Icmds/ -Icmds/builtins -Icmds/modules 33 BINARY = bdsh 30 deps = [ 'clui', 'fmtutil' ] 31 includes += include_directories('.', 'cmds', 'cmds/builtins', 'cmds/modules') 32 src = files( 33 'cmds/builtin_cmds.c', 34 'cmds/builtins/batch/batch.c', 35 'cmds/builtins/builtin_aliases.c', 36 'cmds/builtins/builtins.c', 37 'cmds/builtins/cd/cd.c', 38 'cmds/builtins/exit/exit.c', 39 'cmds/mod_cmds.c', 40 'cmds/modules/alias/alias.c', 41 'cmds/modules/cat/cat.c', 42 'cmds/modules/cmp/cmp.c', 43 'cmds/modules/cp/cp.c', 44 'cmds/modules/echo/echo.c', 45 'cmds/modules/help/help.c', 46 'cmds/modules/kcon/kcon.c', 47 'cmds/modules/ls/ls.c', 48 'cmds/modules/mkdir/mkdir.c', 49 'cmds/modules/mkfile/mkfile.c', 50 'cmds/modules/module_aliases.c', 51 'cmds/modules/modules.c', 52 'cmds/modules/mount/mount.c', 53 'cmds/modules/mv/mv.c', 54 'cmds/modules/printf/printf.c', 55 'cmds/modules/pwd/pwd.c', 56 'cmds/modules/rm/rm.c', 57 'cmds/modules/sleep/sleep.c', 58 'cmds/modules/touch/touch.c', 59 'cmds/modules/unalias/unalias.c', 60 'cmds/modules/unmount/unmount.c', 61 'compl.c', 62 'errors.c', 63 'exec.c', 64 'input.c', 65 'scli.c', 66 'tok.c', 67 'util.c', 68 ) 34 69 35 SOURCES = \ 36 cmds/modules/module_aliases.c \ 37 cmds/modules/modules.c \ 38 cmds/modules/help/help.c \ 39 cmds/modules/mkdir/mkdir.c \ 40 cmds/modules/mkfile/mkfile.c \ 41 cmds/modules/rm/rm.c \ 42 cmds/modules/cat/cat.c \ 43 cmds/modules/touch/touch.c \ 44 cmds/modules/ls/ls.c \ 45 cmds/modules/pwd/pwd.c \ 46 cmds/modules/sleep/sleep.c \ 47 cmds/modules/cp/cp.c \ 48 cmds/modules/mv/mv.c \ 49 cmds/modules/printf/printf.c \ 50 cmds/modules/echo/echo.c \ 51 cmds/modules/mount/mount.c \ 52 cmds/modules/unmount/unmount.c \ 53 cmds/modules/kcon/kcon.c \ 54 cmds/modules/cmp/cmp.c \ 55 cmds/builtins/builtin_aliases.c \ 56 cmds/builtins/builtins.c \ 57 cmds/builtins/batch/batch.c \ 58 cmds/builtins/exit/exit.c \ 59 cmds/builtins/cd/cd.c \ 60 cmds/mod_cmds.c \ 61 cmds/builtin_cmds.c \ 62 compl.c \ 63 errors.c \ 64 input.c \ 65 util.c \ 66 exec.c \ 67 scli.c \ 68 tok.c 70 test_src = files( 71 'tok.c', 72 'test/toktest.c', 73 ) 69 74 70 TEST_SOURCES = \ 71 tok.c \ 72 test/toktest.c 73 74 include $(USPACE_PREFIX)/Makefile.common 75 # TODO: install this file somewhere sane 76 installed_data += { 'name': 'demo.txt', 'dir': '/' } -
uspace/app/bdsh/scli.c
r9259d20 r3e828ea 1 1 /* 2 2 * Copyright (c) 2008 Tim Post 3 * Copyright (c) 2018 Matthieu Riolo 3 4 * All rights reserved. 4 5 * … … 31 32 #include <stddef.h> 32 33 #include <str.h> 34 #include <adt/odict.h> 33 35 #include "config.h" 34 36 #include "scli.h" … … 42 44 static iostate_t *iostate; 43 45 static iostate_t stdiostate; 46 47 odict_t alias_dict; 44 48 45 49 /* … … 55 59 */ 56 60 const char *progname = PACKAGE_NAME; 61 62 static int alias_cmp(void *a, void *b) 63 { 64 return str_cmp((char *)a, (char *)b); 65 } 66 67 static void *alias_key(odlink_t *odlink) 68 { 69 return (void *)odict_get_instance(odlink, alias_t, odict)->name; 70 } 57 71 58 72 /* These are not exposed, even to builtins */ … … 108 122 iostate = &stdiostate; 109 123 124 odict_initialize(&alias_dict, alias_key, alias_cmp); 125 110 126 if (cli_init(&usr)) 111 127 exit(EXIT_FAILURE); -
uspace/app/bdsh/scli.h
r9259d20 r3e828ea 1 1 /* 2 2 * Copyright (c) 2008 Tim Post 3 * Copyright (c) 2018 Matthieu Riolo 3 4 * All rights reserved. 4 5 * … … 34 35 #include <stdint.h> 35 36 #include <stdio.h> 37 #include <types/adt/odict.h> 36 38 37 39 typedef struct { … … 54 56 extern void set_iostate(iostate_t *); 55 57 58 extern odict_t alias_dict; 59 60 typedef struct { 61 odlink_t odict; 62 char *name; 63 char *value; 64 } alias_t; 65 56 66 #endif -
uspace/app/bdsh/util.c
r9259d20 r3e828ea 74 74 return 0; 75 75 } 76 77 /* 78 * Returns true if the string is a relative or an absolute path 79 */ 80 bool is_path(const char *cmd) 81 { 82 83 bool ret = str_lcmp(cmd, "/", 1) == 0; 84 ret = ret || str_lcmp(cmd, "./", 2) == 0; 85 ret = ret || str_lcmp(cmd, "../", 3) == 0; 86 87 return ret; 88 } -
uspace/app/bdsh/util.h
r9259d20 r3e828ea 31 31 32 32 #include "scli.h" 33 #include <stdbool.h> 33 34 34 35 /* Utility functions */ 35 36 extern unsigned int cli_count_args(char **); 36 37 extern unsigned int cli_set_prompt(cliuser_t *usr); 38 extern bool is_path(const char *cmd); 37 39 38 40 #endif -
uspace/app/blkdump/meson.build
r9259d20 r3e828ea 28 28 # 29 29 30 USPACE_PREFIX = ../.. 31 BINARY = klog 32 33 SOURCES = \ 34 klog.c 35 36 include $(USPACE_PREFIX)/Makefile.common 30 deps = [ 'block', 'scsi' ] 31 src = files('blkdump.c') -
uspace/app/contacts/meson.build
r9259d20 r3e828ea 1 1 # 2 # Copyright (c) 201 0 Martin Decky2 # Copyright (c) 2018 Jiri Svoboda 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 BOOT_OUTPUT = 30 RAW = 31 JOB = 32 MAP = 33 PREBUILD = 34 BUILD = Makefile.empty 29 deps = [ 'clui', 'sif' ] 30 src = files('contacts.c') -
uspace/app/cpptest/main.cpp
r9259d20 r3e828ea 121 121 ts.add<std::test::functional_test>(); 122 122 ts.add<std::test::algorithm_test>(); 123 ts.add<std::test::future_test>(); 123 124 124 125 return ts.run(true) ? 0 : 1; -
uspace/app/date/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = date 31 32 SOURCES = \ 33 date.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('date.c') -
uspace/app/devctl/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = loc 31 32 SOURCES = \ 33 loc.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('devctl.c') -
uspace/app/df/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = df 31 32 SOURCES = \ 33 df.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('df.c') -
uspace/app/download/main.c
r9259d20 r3e828ea 49 49 #define NAME "download" 50 50 #ifdef TIMESTAMP_UNIX 51 #define VERSION STRING( RELEASE) "-" STRING(TIMESTAMP_UNIX)51 #define VERSION STRING(HELENOS_RELEASE) "-" STRING(TIMESTAMP_UNIX) 52 52 #else 53 #define VERSION STRING( RELEASE)53 #define VERSION STRING(HELENOS_RELEASE) 54 54 #endif 55 55 #define USER_AGENT "HelenOS-" NAME "/" VERSION -
uspace/app/download/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../../.. 30 LIBS = graph 31 BINARY = rfb 32 33 SOURCES = \ 34 main.c \ 35 rfb.c 36 37 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'http', 'uri' ] 30 c_args += ('-DRELEASE=' + HELENOS_RELEASE) 31 src = files('main.c') -
uspace/app/edit/meson.build
r9259d20 r3e828ea 28 28 # 29 29 30 USPACE_PREFIX = ../.. 31 BINARY = stats 32 33 SOURCES = \ 34 stats.c 35 36 include $(USPACE_PREFIX)/Makefile.common 30 src = files( 31 'edit.c', 32 'search.c', 33 'sheet.c', 34 ) -
uspace/app/fontviewer/fontviewer.c
r9259d20 r3e828ea 41 41 #include <window.h> 42 42 #include <canvas.h> 43 #include < surface.h>44 #include < codec/tga.h>43 #include <draw/surface.h> 44 #include <draw/codec.h> 45 45 #include <task.h> 46 #include <drawctx.h> 47 #include <font/embedded.h> 48 #include <font/pcf.h> 46 #include <draw/drawctx.h> 47 #include <draw/font.h> 49 48 #include <stdarg.h> 50 49 #include <io/verify.h> -
uspace/app/getterm/version.c
r9259d20 r3e828ea 39 39 #include "version.h" 40 40 41 static const char *copyright = STRING( COPYRIGHT);42 static const char *release = STRING( RELEASE);43 static const char *name = STRING( NAME);41 static const char *copyright = STRING(HELENOS_COPYRIGHT); 42 static const char *release = STRING(HELENOS_RELEASE); 43 static const char *name = STRING(HELENOS_CODENAME); 44 44 static const char *arch = STRING(UARCH); 45 45 -
uspace/app/gfxdemo/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = pci 31 32 SOURCES = \ 33 pci.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'gfx' ] 30 src = files( 31 'gfxdemo.c', 32 ) -
uspace/app/gunzip/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = vol 31 32 SOURCES = \ 33 vol.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'compress' ] 30 src = files('gunzip.c') -
uspace/app/hbench/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = contacts 31 LIBS = clui sif 32 33 SOURCES = \ 34 contacts.c 35 36 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'math' ] 30 src = files( 31 'benchlist.c', 32 'csv.c', 33 'env.c', 34 'main.c', 35 'utils.c', 36 'fs/dirread.c', 37 'fs/fileread.c', 38 'ipc/ns_ping.c', 39 'ipc/ping_pong.c', 40 'malloc/malloc1.c', 41 'malloc/malloc2.c', 42 'synch/fibril_mutex.c', 43 ) -
uspace/app/inet/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = ping 31 32 SOURCES = \ 33 ping.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('inet.c') -
uspace/app/init/meson.build
r9259d20 r3e828ea 28 28 # 29 29 30 USPACE_PREFIX = ../.. 31 BINARY = redir 32 33 SOURCES = \ 34 redir.c 35 36 include $(USPACE_PREFIX)/Makefile.common 30 deps = [ 'untar', 'block' ] 31 link_args += '-static' 32 src = files('init.c', 'untar.c') -
uspace/app/killall/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 ENDIANESS = LE 29 src = files('killall.c') -
uspace/app/logset/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = logset 31 32 SOURCES = \ 33 main.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('main.c') -
uspace/app/meson.build
r9259d20 r3e828ea 1 1 # 2 # Copyright (c) 2005 Martin Decky 3 # Copyright (c) 2007 Jakub Jermar 4 # Copyright (c) 2012 Julia Medvedeva 2 # Copyright (c) 2019 Jiří Zárevúcky 5 3 # All rights reserved. 6 4 # … … 29 27 # 30 28 31 USPACE_PREFIX = ../../.. 32 LIBS = block fs 33 BINARY = udf 29 apps = [ 30 'barber', 31 'bdsh', 32 'bithenge', 33 'blkdump', 34 'contacts', 35 'corecfg', 36 'cpptest', 37 'date', 38 'devctl', 39 'df', 40 'dnscfg', 41 'dnsres', 42 'download', 43 'edit', 44 'fdisk', 45 'fontviewer', 46 'getterm', 47 'gfxdemo', 48 'gunzip', 49 'hbench', 50 'inet', 51 'init', 52 'kill', 53 'killall', 54 'kio', 55 'loc', 56 'logset', 57 'lprint', 58 'mixerctl', 59 'mkbd', 60 'mkexfat', 61 'mkext4', 62 'mkfat', 63 'mkmfs', 64 'modplay', 65 'netecho', 66 'nic', 67 'nterm', 68 'pci', 69 'ping', 70 'pkg', 71 'redir', 72 'sbi', 73 'sportdmp', 74 'stats', 75 'sysinfo', 76 'sysinst', 77 'taskdump', 78 'tester', 79 'testread', 80 'testrunner', 81 'testwrit', 82 'tetris', 83 'tmon', 84 'top', 85 'trace', 86 'untar', 87 'usbinfo', 88 'vcalc', 89 'vdemo', 90 'viewer', 91 'vlaunch', 92 'vol', 93 'vterm', 94 'vuhid', 95 'wavplay', 96 'websrv', 97 'wifi_supplicant', 98 ] 34 99 35 SOURCES = \ 36 udf.c \ 37 udf_volume.c \ 38 udf_ops.c \ 39 udf_osta.c \ 40 udf_cksum.c \ 41 udf_file.c \ 42 udf_idx.c 43 44 include $(USPACE_PREFIX)/Makefile.common 100 if CONFIG_BUILD_SHARED_LIBS 101 apps += [ 102 'dltest', 103 'dltests', 104 ] 105 endif -
uspace/app/mkext4/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = lprint 31 32 SOURCES = \ 33 lprint.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 # FIXME remove transitive deps 30 deps = [ 'ext4', 'fs', 'block', 'crypto' ] 31 src = files('mkext4.c') -
uspace/app/modplay/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 LIBS = trackmod hound pcm 29 deps = [ 'trackmod', 'hound', 'pcm' ] 30 src = files('modplay.c') 31 31 32 BINARY = modplay 33 34 SOURCES = \ 35 modplay.c 36 37 include $(USPACE_PREFIX)/Makefile.common 32 if install_nonessential_data 33 # TODO: install this file somewhere sane 34 installed_data += { 'name': 'demo.xm', 'dir': '/' } 35 endif -
uspace/app/pkg/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = pkg 31 32 SOURCES = \ 33 pkg.c 34 35 include $(USPACE_PREFIX)/Makefile.common 29 src = files('pkg.c') -
uspace/app/redir/meson.build
r9259d20 r3e828ea 1 1 # 2 2 # Copyright (c) 2005 Martin Decky 3 # Copyright (c) 2007 Jakub Jermar 3 4 # All rights reserved. 4 5 # … … 27 28 # 28 29 29 ENDIANESS = LE 30 31 BFD_NAME = elf64-littleriscv 32 BFD_ARCH = riscv 30 src = files('redir.c') -
uspace/app/sbi/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 LIBS = 31 EXTRA_CFLAGS = 32 BINARY = kill 33 34 SOURCES = \ 35 kill.c 36 37 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'clui' ] 30 c_args += '-D__HELENOS__' 31 src = files( 32 'src/builtin/bi_boxed.c', 33 'src/builtin/bi_error.c', 34 'src/builtin/bi_char.c', 35 'src/builtin/bi_console.c', 36 'src/builtin/bi_int.c', 37 'src/builtin/bi_task.c', 38 'src/builtin/bi_textfile.c', 39 'src/builtin/bi_string.c', 40 'src/os/helenos.c', 41 'src/ancr.c', 42 'src/bigint.c', 43 'src/builtin.c', 44 'src/cspan.c', 45 'src/imode.c', 46 'src/input.c', 47 'src/intmap.c', 48 'src/lex.c', 49 'src/list.c', 50 'src/main.c', 51 'src/p_expr.c', 52 'src/p_type.c', 53 'src/parse.c', 54 'src/program.c', 55 'src/rdata.c', 56 'src/run.c', 57 'src/run_expr.c', 58 'src/run_texpr.c', 59 'src/stree.c', 60 'src/strtab.c', 61 'src/stype.c', 62 'src/stype_expr.c', 63 'src/symbol.c', 64 'src/tdata.c', 65 ) -
uspace/app/sysinst/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 BINARY = nic 31 LIBS = drv 32 33 SOURCES = \ 34 nic.c 35 36 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'block', 'fdisk', 'sif' ] 30 src = files( 31 'futil.c', 32 'rdimg.c', 33 'sysinst.c', 34 'volume.c', 35 ) -
uspace/app/taskdump/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../../.. 30 31 BINARY = s3c24xx_ts 32 33 SOURCES = \ 34 s3c24xx_ts.c 35 36 include $(USPACE_PREFIX)/Makefile.common 29 includes += include_directories('include') 30 src = files( 31 'elf_core.c', 32 'fibrildump.c', 33 'taskdump.c', 34 'symtab.c', 35 ) -
uspace/app/tetris/meson.build
r9259d20 r3e828ea 28 28 # 29 29 30 USPACE_PREFIX = ../.. 31 LIBRARY = libfs 32 33 SOURCES = \ 34 libfs.c 35 36 include $(USPACE_PREFIX)/Makefile.common 30 src = files( 31 'shapes.c', 32 'scores.c', 33 'tetris.c', 34 'screen.c', 35 ) -
uspace/app/usbinfo/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../../.. 30 LIBS = drv 31 BINARY = test1 32 33 SOURCES = \ 34 test1.c 35 36 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'usbhid', 'usbdev', 'usb', 'drv' ] 30 src = files( 31 'desctree.c', 32 'dump.c', 33 'hid.c', 34 'info.c', 35 'list.c', 36 'main.c', 37 ) -
uspace/app/viewer/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 29 deps = [ 'gui' ] 30 src = files('viewer.c') 30 31 31 # TODO: Should be just "gui", rest is transitive dependencies. 32 LIBS = gui draw softrend compress math 33 34 BINARY = viewer 35 36 SOURCES = \ 37 viewer.c 38 39 include $(USPACE_PREFIX)/Makefile.common 32 if install_nonessential_data 33 # TODO: install this file somewhere sane 34 installed_data += { 'name': 'logo.tga', 'dir': '/' } 35 endif -
uspace/app/viewer/viewer.c
r9259d20 r3e828ea 41 41 #include <window.h> 42 42 #include <canvas.h> 43 #include < surface.h>44 #include < codec/tga.h>43 #include <draw/surface.h> 44 #include <draw/codec.h> 45 45 #include <task.h> 46 46 #include <str.h> -
uspace/app/vlaunch/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 29 deps = [ 'gui' ] 30 30 31 # TODO: Should be just "gui", rest is transitive dependencies. 32 LIBS = gui draw softrend compress math 31 _images = files('gfx/helenos.tga') 33 32 34 BINARY = vdemo 33 _images_zip = custom_target('vlaunch_images.zip', 34 input : _images, 35 output : [ 'images.zip' ], 36 command : [ mkarray, '@OUTDIR@', 'images', 'image', uspace_as_prolog, '.data', '@INPUT@' ], 37 ) 38 _imgs_s = custom_target('vlaunch_images.s', 39 input : _images_zip, 40 output : [ 'images.s' ], 41 command : [ unzip, '-p', '@INPUT@', 'images.s' ], 42 capture : true, 43 ) 44 _imgs_h = custom_target('vlaunch_images.h', 45 input : _images_zip, 46 output : [ 'images.h' ], 47 command : [ unzip, '-p', '@INPUT@', 'images.h' ], 48 capture : true, 49 ) 50 _imgs_desc_c = custom_target('vlaunch_images_desc.c', 51 input : _images_zip, 52 output : [ 'images_desc.c' ], 53 command : [ unzip, '-p', '@INPUT@', 'images_desc.c' ], 54 capture : true, 55 ) 35 56 36 SOURCES = \ 37 vdemo.c 38 39 include $(USPACE_PREFIX)/Makefile.common 57 src = [ files('vlaunch.c'), _imgs_s, _imgs_h, _imgs_desc_c ] -
uspace/app/vlaunch/vlaunch.c
r9259d20 r3e828ea 46 46 #include <canvas.h> 47 47 48 #include < surface.h>49 #include < source.h>50 #include <draw ctx.h>51 #include < codec/tga.h>48 #include <draw/surface.h> 49 #include <draw/source.h> 50 #include <draw/drawctx.h> 51 #include <draw/codec.h> 52 52 53 53 #include "images.h" -
uspace/app/vuhid/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../../.. 30 31 LIBS = usbdev usb drv scsi 32 33 BINARY = usbmast 34 35 SOURCES = \ 36 bo_trans.c \ 37 cmdw.c \ 38 main.c \ 39 scsi_ms.c 40 41 include $(USPACE_PREFIX)/Makefile.common 29 deps = [ 'usb', 'usbdev', 'usbhid', 'usbvirt', 'drv' ] 30 src = files( 31 'main.c', 32 'device.c', 33 'ifaces.c', 34 'life.c', 35 'stdreq.c', 36 'hids/bootkbd.c', 37 'hids/logitech_wireless.c', 38 ) -
uspace/app/wavplay/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 USPACE_PREFIX = ../.. 30 EXTRA_CFLAGS = -Iinclude/pcm 31 LIBRARY = libpcm 29 deps = [ 'drv', 'hound', 'pcm' ] 30 src = files( 31 'dplay.c', 32 'drec.c', 33 'main.c', 34 'wave.c', 35 ) 32 36 33 SOURCES = \ 34 src/format.c 35 include $(USPACE_PREFIX)/Makefile.common 36 37 37 if install_nonessential_data 38 # TODO: install this file somewhere sane 39 installed_data += { 'name': 'demo.wav', 'dir': '/' } 40 endif
Note:
See TracChangeset
for help on using the changeset viewer.
