"Fossies" - the Fresh Open Source Software Archive 
Member "giis_4.6.2/src/uninit.c" (6 Nov 2012, 2567 Bytes) of package /linux/misc/old/giis_4.6.2.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /*
2 * /giis/uninit.c This file performs uninstall opertions.
3 *
4 * Copyright (C) 2005,2006,2007,2008,2009,2010,2011,2012 Lakshmipathi.G <lakshmipathi.g@giis.co.in>.
5 * This file may be redistributed under the terms of the GNU Public License.
6 *
7 */
8
9
10 #include "giis.h"
11
12
13 /*
14 * remove_giis() This procedure just unlinks files.
15 */
16
17
18 int remove_giis ()
19 {
20 int i;
21
22 i = open (INSTALL_DIR1, 0);
23 if (i == -1)
24 {
25 printf ("\n\t\t Install giis...and then try this :-)\n\n");
26 return 0;
27 }
28 printf ("\n\t\tPress 1 : Continue Uninstall\n\t\tPress 2 : Abort");
29 printf ("\n\t\tType in :");
30 scanf ("%d", &i);
31 if (i != 1)
32 return 0;
33
34
35 /* Remove files */
36
37 i = unlink (DIR_INFO_FILE);
38 if (i == 0)
39 printf ("\n\t%s Removed", DIR_INFO_FILE);
40 else
41 printf ("\n\t%s not Deleted...", DIR_INFO_FILE);
42
43 i = unlink (FILE_INFO_FILE);
44 if (i == 0)
45 printf ("\n\t%s Removed", FILE_INFO_FILE);
46 else
47 printf ("\n\t%s not Deleted...", FILE_INFO_FILE);
48
49 i = unlink (SIND_INFO_FILE);
50 if (i == 0)
51 printf ("\n\t%s Removed", SIND_INFO_FILE);
52 else
53 printf ("\n\t%s not Deleted...", SIND_INFO_FILE);
54
55 i = unlink (DIND_INFO_FILE);
56
57 if (i == 0)
58 printf ("\n\t%s Removed", DIND_INFO_FILE);
59 else
60 printf ("\n\t%s not Deleted...", DIND_INFO_FILE);
61
62
63 i = unlink (SAMPLE_DATA_FILE);
64
65 if (i == 0)
66 printf ("\n\t%s Removed", SAMPLE_DATA_FILE);
67 else
68 printf ("\n\t%s not Deleted...", SAMPLE_DATA_FILE);
69
70 //Remove the executable file.
71
72 i = unlink ("/usr/bin/giis");
73 if (i == 0)
74 printf ("\n\t/usr/bin/giis Removed");
75 else
76 printf ("\n\t/usr/bin/giis not Deleted...");
77
78
79
80 i = unlink ("/usr/share/giis/hai");
81 if (i == 0)
82 printf ("\n\t/usr/share/giis/hai Removed");
83 else
84 printf ("\n\t/usr/share/giis/hai not Deleted...");
85
86
87 i = unlink ("/usr/share/giis/quotes");
88 if (i == 0)
89 printf ("\n\t/usr/share/giis/quotes Removed");
90 else
91 printf ("\n\t/usr/share/giis/quotes not Deleted...");
92
93
94
95 i = unlink ("/usr/share/giis/restore_details.txt");
96 if (i == 0)
97 printf ("\n\t/usr/share/giis/restore_details.txt Removed");
98 else
99 printf ("\n\t/usr/share/giis/restore_details.txt not Deleted...");
100
101 rmdir (INSTALL_DIR3);
102 rmdir (INSTALL_DIR2);
103 rmdir (INSTALL_DIR4);
104 i = rmdir (INSTALL_DIR1);
105 if (i != 0)
106 printf ("\n\t **Unable to Delete %s\n", INSTALL_DIR1);
107 else
108 printf ("\n\t **All Files Removed...\n\t***gET iT i sAY.giis-Uninstalled Successfully***\n");
109 return 1;
110 }