-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand_validate_util.h
68 lines (54 loc) · 1.87 KB
/
command_validate_util.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __COMMAND_VALIDATE_UTIL_H__
#define __COMMAND_VALIDATE_UTIL_H__
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include "command_objects.h"
#include "util.h"
#define MB (1024*1024)
/*
* 토크나이징이 적절하게 되었는지 검증한다.
* 예를들어 du , 1 1 과 같이
* 파라미터 사이에 콤마가 없거나 이상한 위치에 콤마가 있는 등의 문제를 잡아낸다.
*
* @return true or false
*/
bool validate_tokenizing(char *str, int token_cnt, int max_token_num);
bool validate_tokenizing_for_not_comma(char *str, int token_cnt, int max_token_num);
/*
* 사용자가 입력한 파라미터가 적절한 파라미터 값인지 검증한다.
* (명령어에 따른 파라미터 개수, 크기, 범위 등)
*
* @return VALID_PARAMETERS or INVALID_PARAMETERS
*/
shell_status validate_parameters(Command *user_command);
/*
* dump 명령어의 파라미터를 검증한다.
*
* @return VALID_PARAMETERS or INVALID_PARAMETERS
*/
shell_status validate_dump_parameters(Command *user_command);
/*
* opcode 명령어의 파라미터를 검증한다.
*
* @return VALID_PARAMETERS or INVALID_PARAMETERS
*/
shell_status validate_opcode_parameters(Command *user_command);
/*
* edit 명령어의 파라미터를 검증한다.
*
* @return VALID_PARAMETERS or INVALID_PARAMETERS
*/
shell_status validate_edit_parameters(Command *user_command);
/*
* fill 명령어의 파라미터를 검증한다.
*
* @return VALID_PARAMETERS or INVALID_PARAMETERS
*/
shell_status validate_fill_parameters(Command *user_command);
shell_status validate_assemble_parameters(Command *user_command);
shell_status validate_progaddr_parameters(Command *user_command);
shell_status validate_bp_parameters(Command* user_command);
shell_status validate_bp_clear_parameters(Command* user_command);
shell_status validate_loader_parameters(Command* user_command);
#endif