MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / interface_options_photorec_cli

Function interface_options_photorec_cli

src/poptions.c:37–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35#include "poptions.h"
36
37void interface_options_photorec_cli(struct ph_options *options, char **current_cmd)
38{
39 if(*current_cmd==NULL)
40 {
41 /*@ assert valid_read_string(*current_cmd); */
42 return ;
43 }
44 /*@
45 @ loop invariant valid_read_string(*current_cmd);
46 @ loop assigns *current_cmd;
47 @ loop assigns options->paranoid, options->keep_corrupted_file, options->mode_ext2;
48 @ loop assigns options->expert, options->lowmem;
49 @*/
50 while(1)
51 {
52 skip_comma_in_command(current_cmd);
53 /* paranoid, longer option first */
54 if(check_command(current_cmd,"paranoid_no",11)==0)
55 {
56 options->paranoid=0;
57 }
58 else if(check_command(current_cmd,"paranoid_bf",11)==0)
59 {
60 options->paranoid=2;
61 }
62 else if(check_command(current_cmd,"paranoid",8)==0)
63 {
64 options->paranoid=1;
65 }
66 /* keep_corrupted_file */
67 else if(check_command(current_cmd,"keep_corrupted_file_no",22)==0)
68 {
69 options->keep_corrupted_file=0;
70 }
71 else if(check_command(current_cmd,"keep_corrupted_file",19)==0)
72 {
73 options->keep_corrupted_file=1;
74 }
75 /* mode_ext2 */
76 else if(check_command(current_cmd,"mode_ext2",9)==0)
77 {
78 options->mode_ext2=1;
79 }
80 /* expert */
81 else if(check_command(current_cmd,"expert",6)==0)
82 {
83 options->expert=1;
84 }
85 /* lowmem */
86 else if(check_command(current_cmd,"lowmem",6)==0)
87 {
88 options->lowmem=1;
89 }
90 else
91 {
92#ifndef DISABLED_FOR_FRAMAC
93 interface_options_photorec_log(options);
94#endif

Callers 1

menu_photorec_cliFunction · 0.85

Calls 3

skip_comma_in_commandFunction · 0.85
check_commandFunction · 0.85

Tested by

no test coverage detected