-/* $OpenBSD: editor.c,v 1.392 2023/01/18 12:59:16 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.393 2023/01/20 14:35:43 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
int alloc_table_nitems = 4;
void edit_parms(struct disklabel *);
-void editor_resize(struct disklabel *, char *);
-void editor_add(struct disklabel *, char *);
-void editor_change(struct disklabel *, char *);
+void editor_resize(struct disklabel *, const char *);
+void editor_add(struct disklabel *, const char *);
+void editor_change(struct disklabel *, const char *);
u_int64_t editor_countfree(const struct disklabel *);
-void editor_delete(struct disklabel *, char *);
+void editor_delete(struct disklabel *, const char *);
void editor_help(void);
-void editor_modify(struct disklabel *, char *);
-void editor_name(struct disklabel *, char *);
+void editor_modify(struct disklabel *, const char *);
+void editor_name(struct disklabel *, const char *);
char *getstring(const char *, const char *, const char *);
u_int64_t getuint64(const struct disklabel *, char *, char *, u_int64_t,
u_int64_t, int *);
-u_int64_t getnumber(char *, char *, u_int32_t, u_int32_t);
+u_int64_t getnumber(const char *, const char *, u_int32_t, u_int32_t);
int has_overlap(struct disklabel *);
int partition_cmp(const void *, const void *);
const struct partition **sort_partitions(const struct disklabel *, int);
-void getdisktype(struct disklabel *, char *, char *);
+void getdisktype(struct disklabel *, const char *, char *);
void find_bounds(const struct disklabel *);
void set_bounds(struct disklabel *);
void set_duid(struct disklabel *);
* Resize a partition, moving all subsequent partitions
*/
void
-editor_resize(struct disklabel *lp, char *p)
+editor_resize(struct disklabel *lp, const char *p)
{
struct disklabel label;
struct partition *pp, *prev;
* Add a new partition.
*/
void
-editor_add(struct disklabel *lp, char *p)
+editor_add(struct disklabel *lp, const char *p)
{
struct partition *pp;
const struct diskchunk *chunk;
* Set the mountpoint of an existing partition ('name').
*/
void
-editor_name(struct disklabel *lp, char *p)
+editor_name(struct disklabel *lp, const char *p)
{
struct partition *pp;
int partno;
* Change an existing partition.
*/
void
-editor_modify(struct disklabel *lp, char *p)
+editor_modify(struct disklabel *lp, const char *p)
{
struct partition opp, *pp;
int partno;
* Delete an existing partition.
*/
void
-editor_delete(struct disklabel *lp, char *p)
+editor_delete(struct disklabel *lp, const char *p)
{
struct partition *pp;
int partno;
* Change the size of an existing partition.
*/
void
-editor_change(struct disklabel *lp, char *p)
+editor_change(struct disklabel *lp, const char *p)
{
struct partition *pp;
int partno;
* CMD_ABORTED ==> ^D on input
*/
u_int64_t
-getnumber(char *prompt, char *helpstring, u_int32_t oval, u_int32_t maxval)
+getnumber(const char *prompt, const char *helpstring, u_int32_t oval,
+ u_int32_t maxval)
{
char buf[BUFSIZ], *p;
int rslt;
* Get a valid disk type if necessary.
*/
void
-getdisktype(struct disklabel *lp, char *banner, char *dev)
+getdisktype(struct disklabel *lp, const char *banner, char *dev)
{
int i;
char *s;