| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: curses_commands.c,v 1.9 2019/05/26 07:47:37 blymn Exp $ */ | | 1 | /* $NetBSD: curses_commands.c,v 1.10 2020/06/20 07:50:16 rin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright 2009 Brett Lymn <blymn@NetBSD.org> | | 4 | * Copyright 2009 Brett Lymn <blymn@NetBSD.org> |
5 | * | | 5 | * |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code has been donated to The NetBSD Foundation by the Author. | | 8 | * This code has been donated to The NetBSD Foundation by the Author. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -3051,47 +3051,53 @@ cmd_mvprintw(int nargs, char **args) | | | @@ -3051,47 +3051,53 @@ cmd_mvprintw(int nargs, char **args) |
3051 | report_count(1); | | 3051 | report_count(1); |
3052 | report_error("BAD ARGUMENT"); | | 3052 | report_error("BAD ARGUMENT"); |
3053 | return; | | 3053 | return; |
3054 | } | | 3054 | } |
3055 | | | 3055 | |
3056 | report_count(1); | | 3056 | report_count(1); |
3057 | report_return(mvprintw(y, x, args[2], args[3])); | | 3057 | report_return(mvprintw(y, x, args[2], args[3])); |
3058 | } | | 3058 | } |
3059 | | | 3059 | |
3060 | | | 3060 | |
3061 | void | | 3061 | void |
3062 | cmd_mvscanw(int nargs, char **args) | | 3062 | cmd_mvscanw(int nargs, char **args) |
3063 | { | | 3063 | { |
3064 | int y, x; | | 3064 | int y, x, val; |
3065 | char string[256]; | | 3065 | char string[256]; |
3066 | | | 3066 | |
3067 | if (check_arg_count(nargs, 3) == 1) | | 3067 | if (check_arg_count(nargs, 3) == 1) |
3068 | return; | | 3068 | return; |
3069 | | | 3069 | |
3070 | if (sscanf(args[0], "%d", &y) == 0) { | | 3070 | if (sscanf(args[0], "%d", &y) == 0) { |
3071 | report_count(1); | | 3071 | report_count(1); |
3072 | report_error("BAD ARGUMENT"); | | 3072 | report_error("BAD ARGUMENT"); |
3073 | return; | | 3073 | return; |
3074 | } | | 3074 | } |
3075 | | | 3075 | |
3076 | if (sscanf(args[1], "%d", &x) == 0) { | | 3076 | if (sscanf(args[1], "%d", &x) == 0) { |
3077 | report_count(1); | | 3077 | report_count(1); |
3078 | report_error("BAD ARGUMENT"); | | 3078 | report_error("BAD ARGUMENT"); |
3079 | return; | | 3079 | return; |
3080 | } | | 3080 | } |
3081 | | | 3081 | |
3082 | /* XXX - call2 */ | | 3082 | /* XXX - call2 */ |
3083 | report_count(2); | | 3083 | report_count(2); |
3084 | report_return(mvscanw(y, x, args[2], &string)); | | 3084 | if (strchr(args[2], 's') != NULL) |
| | | 3085 | report_return(mvscanw(y, x, args[2], &string)); |
| | | 3086 | else { |
| | | 3087 | /* XXX assume 32bit integer */ |
| | | 3088 | report_return(mvscanw(y, x, args[2], &val)); |
| | | 3089 | snprintf(string, sizeof(string), args[2], val); |
| | | 3090 | } |
3085 | report_status(string); | | 3091 | report_status(string); |
3086 | } | | 3092 | } |
3087 | | | 3093 | |
3088 | | | 3094 | |
3089 | void | | 3095 | void |
3090 | cmd_mvvline(int nargs, char **args) | | 3096 | cmd_mvvline(int nargs, char **args) |
3091 | { | | 3097 | { |
3092 | int y, x, n; | | 3098 | int y, x, n; |
3093 | chtype *ch; | | 3099 | chtype *ch; |
3094 | | | 3100 | |
3095 | if (check_arg_count(nargs, 4) == 1) | | 3101 | if (check_arg_count(nargs, 4) == 1) |
3096 | return; | | 3102 | return; |
3097 | | | 3103 | |