示例#1
0
/*
 * Returns the index to the place in the stack or -1 for error.  Uses a
 * direct reference to the prompt.
 */
int UI_add_input_string(UI *ui, const char *prompt, int flags,
                        char *result_buf, int minsize, int maxsize)
{
    return general_allocate_string(ui, prompt, 0,
                                   UIT_PROMPT, flags, result_buf, minsize,
                                   maxsize, NULL);
}
示例#2
0
文件: ui_lib.c 项目: NSGod/openbsd
int
UI_add_verify_string(UI *ui, const char *prompt, int flags, char *result_buf,
    int minsize, int maxsize, const char *test_buf)
{
	return general_allocate_string(ui, prompt, 0, UIT_VERIFY, flags,
	    result_buf, minsize, maxsize, test_buf);
}
示例#3
0
int UI_dup_error_string(UI *ui, const char *text)
{
    char *text_copy = NULL;

    if (text != NULL) {
        text_copy = OPENSSL_strdup(text);
        if (text_copy == NULL) {
            UIerr(UI_F_UI_DUP_ERROR_STRING, ERR_R_MALLOC_FAILURE);
            return -1;
        }
    }
    return general_allocate_string(ui, text_copy, 1, UIT_ERROR, 0, NULL,
                                   0, 0, NULL);
}
示例#4
0
int UI_dup_info_string(UI *ui, const char *text)
{
    char *text_copy = NULL;

    if (text) {
        text_copy = BUF_strdup(text);
        if (text_copy == NULL) {
            UIerr(UI_F_UI_DUP_INFO_STRING, ERR_R_MALLOC_FAILURE);
            return -1;
        }
    }

    return general_allocate_string(ui, text_copy, 1, UIT_INFO, 0, NULL,
                                   0, 0, NULL);
}
示例#5
0
文件: ui_lib.c 项目: NSGod/openbsd
int
UI_dup_verify_string(UI *ui, const char *prompt, int flags,
    char *result_buf, int minsize, int maxsize, const char *test_buf)
{
	char *prompt_copy = NULL;

	if (prompt) {
		prompt_copy = strdup(prompt);
		if (prompt_copy == NULL) {
			UIerr(UI_F_UI_DUP_VERIFY_STRING, ERR_R_MALLOC_FAILURE);
			return -1;
		}
	}
	return general_allocate_string(ui, prompt_copy, 1, UIT_VERIFY, flags,
	    result_buf, minsize, maxsize, test_buf);
}
示例#6
0
文件: ui_lib.c 项目: NSGod/openbsd
/* Same as UI_add_input_string(), excepts it takes a copy of the prompt */
int
UI_dup_input_string(UI *ui, const char *prompt, int flags, char *result_buf,
    int minsize, int maxsize)
{
	char *prompt_copy = NULL;

	if (prompt) {
		prompt_copy = strdup(prompt);
		if (prompt_copy == NULL) {
			UIerr(UI_F_UI_DUP_INPUT_STRING, ERR_R_MALLOC_FAILURE);
			return 0;
		}
	}
	return general_allocate_string(ui, prompt_copy, 1, UIT_PROMPT, flags,
	    result_buf, minsize, maxsize, NULL);
}
示例#7
0
int UI_add_error_string(UI *ui, const char *text)
{
    return general_allocate_string(ui, text, 0, UIT_ERROR, 0, NULL, 0, 0,
                                   NULL);
}
示例#8
0
int UI_add_info_string(UI *ui, const char *text)
{
    return general_allocate_string(ui, text, 0, UIT_INFO, 0, NULL, 0, 0,
                                   NULL);
}