-
Notifications
You must be signed in to change notification settings - Fork 0
/
recm_delmapping.h
65 lines (62 loc) · 2.57 KB
/
recm_delmapping.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
/**********************************************************************************/
/* DELETE MAPPING command */
/* Usage: */
/* delete mapping */
/* Available Qualifier(s): */
/* /tablespace=<tbsname> Tablespace name to remap */
/**********************************************************************************/
/*
@command delete mapping
@definition
Remove a cluster from the deposit.
@option "/verbose" "Display more details"
@option "/tablespace=TABLESPACE" "Tablespace's mapping name to remove"
@example
@inrecm {&list mapping&}
@out Type Name Mapping
@out --------------- -------------------- ------------------------------
@out TABLESPACE TBS1 /tmp/TBS1
@inrecm delete mapping /tablespace=TBS1
@inrecm {&list mapping&}
@out No mapping defined.
@inrecm
@end
*/
void COMMAND_DELMAPPING(int idcmd,char *command_line)
{
if (optionIsSET("opt_verbose") == true) globalArgs.verbosity=true; // Set Verbosity
if (target_list == NULL) target_list=arrayCreate(ARRAY_UP_ORDER);
// set target /all
if (optionIsSET("opt_all") == true)
{
ArrayItem *itm=arrayFirst(target_list);
while (itm != NULL)
{
TargetPiece *tp=(TargetPiece *)itm->data;
TRACE("Deleting MAPPING '%s'\n",tp->name);
free(tp->name);
free(tp->value);
arrayDelete(target_list,itm);
itm=arrayFirst(target_list);
};
};
if (qualifierIsUNSET("qal_tablespace") == false) // set target /tablespace=name /directory="<new_path>"
{
ArrayItem *fnd=NULL;
fnd=arrayFind(target_list,varGet("qal_tablespace")); // update existing entry
if (fnd != NULL && strcmp(fnd->key,varGet("qal_tablespace")) == 0)
{
VERBOSE("Remove mapping for tablespace '%s'\n",varGet("qal_tablespace"));
arrayDelete(target_list,fnd);
}
else
{
ERROR(ERR_MAPNOTFND,"Mapping '%s' not found.\n",varGet("qal_tablespace"));
}
}
else
{
ERROR(ERR_MISSQUAL,"Missing qualifier '/tablespace'.\n");
}
return;
}