txtopt 1.25 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Title:     txtopt.c
 * Purpose:   setting/reading option name
 * Author:    IDJ
 * History:
 *   21-Feb-90: IDJ: Created
 *   08-May-91: ECN: #ifndefed out unused ROM functions
 */

#include <stdlib.h>
#include <string.h>


#include "msgs.h"
#include "werr.h"
#include "txtopt.h"
31
#include "VerIntern/messages.h"
Neil Turton's avatar
Neil Turton committed
32 33 34 35 36 37 38 39

#ifndef TRUE
#define TRUE 1
#endif

static char *txtopt__option_name = "Edit";

#ifndef UROM
Robert Sprowson's avatar
Robert Sprowson committed
40
void txtopt_set_name(const char *name)
Neil Turton's avatar
Neil Turton committed
41
{
Robert Sprowson's avatar
Robert Sprowson committed
42
    if ((txtopt__option_name = malloc(strlen(name)+1)) == NULL)
Neil Turton's avatar
Neil Turton committed
43 44 45 46 47
        werr(TRUE, msgs_lookup(MSGS_txtopt1));
    strcpy(txtopt__option_name, name);
}
#endif

Robert Sprowson's avatar
Robert Sprowson committed
48
const char *txtopt_get_name(void)
Neil Turton's avatar
Neil Turton committed
49 50 51 52
{
    return txtopt__option_name;
}