diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-07 18:47:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-07 18:47:14 +0000 |
commit | 06563b7a66e1045a963933eec87d4328b6b6efb3 (patch) | |
tree | 25fdb7ee06d7dec33dffa67e26f0e780586de3d6 | |
parent | f1dd5a49d93dec2e2866dc6ca8f322085d5fb1a1 (diff) | |
download | gnunet-gtk-06563b7a66e1045a963933eec87d4328b6b6efb3.tar.gz gnunet-gtk-06563b7a66e1045a963933eec87d4328b6b6efb3.zip |
-remove dead code
-rw-r--r-- | src/fs/Makefile.am | 2 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_advertise-pseudonym.c | 175 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_advertise-pseudonym.h | 45 |
3 files changed, 0 insertions, 222 deletions
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index f8096675..90bd1b39 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am | |||
@@ -13,8 +13,6 @@ bin_PROGRAMS = gnunet-fs-gtk | |||
13 | gnunet_fs_gtk_SOURCES = \ | 13 | gnunet_fs_gtk_SOURCES = \ |
14 | gnunet-fs-gtk.c gnunet-fs-gtk.h \ | 14 | gnunet-fs-gtk.c gnunet-fs-gtk.h \ |
15 | gnunet-fs-gtk_about.c \ | 15 | gnunet-fs-gtk_about.c \ |
16 | gnunet-fs-gtk_advertise-pseudonym.c \ | ||
17 | gnunet-fs-gtk_advertise-pseudonym.h \ | ||
18 | gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \ | 16 | gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \ |
19 | gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \ | 17 | gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \ |
20 | gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \ | 18 | gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \ |
diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c deleted file mode 100644 index 388aa22b..00000000 --- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2005-2013 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file src/fs/gnunet-fs-gtk_advertise-pseudonym.c | ||
23 | * @author Christian Grothoff | ||
24 | * @brief allow the user to select a pseudonym to advertise and | ||
25 | * then run the advertising dialog (using the edit-publish | ||
26 | * dialog functions) and finally do the advertising | ||
27 | */ | ||
28 | #include "gnunet-fs-gtk_common.h" | ||
29 | #include "gnunet-fs-gtk.h" | ||
30 | #include "gnunet-fs-gtk_publish-edit-dialog.h" | ||
31 | #include "gnunet-fs-gtk_advertise-pseudonym.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * Columns in the select pseudonym model. | ||
36 | */ | ||
37 | enum FS_SelectPseudonymModelColumns | ||
38 | { | ||
39 | /** | ||
40 | * A gchararray | ||
41 | */ | ||
42 | FS_SELECT_PSEUDONYM_NAMESPACE_MC_NAME = 0, | ||
43 | |||
44 | /** | ||
45 | * A gpointer | ||
46 | */ | ||
47 | FS_SELECT_PSEUDONYM_NAMESPACE_MC_HANDLE = 1, | ||
48 | }; | ||
49 | |||
50 | |||
51 | /* *************************** handlers run on closing of the dialog ********************** */ | ||
52 | |||
53 | |||
54 | /** | ||
55 | * Closure for 'advertise_namespace' and the callback from the editing dialog. | ||
56 | */ | ||
57 | struct NamespaceAdvertisementContext | ||
58 | { | ||
59 | /** | ||
60 | * Handle to the namespace to advertise. | ||
61 | */ | ||
62 | struct GNUNET_CRYPTO_EccPrivateKey ns; | ||
63 | |||
64 | /** | ||
65 | * Root of the namespace is stored here temporarily. | ||
66 | */ | ||
67 | const char *root; | ||
68 | |||
69 | /** | ||
70 | * File information structure (fake) which we use to run the 'edit' dialog. | ||
71 | */ | ||
72 | struct GNUNET_FS_FileInformation *fip; | ||
73 | }; | ||
74 | |||
75 | |||
76 | /** | ||
77 | * Actually perform the advertising with the information collected. | ||
78 | * | ||
79 | * @param cls closure, a 'struct NamespaceAdvertisementContext *' | ||
80 | * @param fi the entry in the publish-structure | ||
81 | * @param length length of the file or directory | ||
82 | * @param meta metadata for the file or directory (can be modified) | ||
83 | * @param uri pointer to the keywords that will be used for this entry (can be modified) | ||
84 | * @param bo block options (can be modified) | ||
85 | * @param do_index should we index (can be modified) | ||
86 | * @param client_info pointer to client context set upon creation (can be modified) | ||
87 | * @return GNUNET_OK to continue, GNUNET_NO to remove | ||
88 | * this entry from the directory, GNUNET_SYSERR | ||
89 | * to abort the iteration | ||
90 | */ | ||
91 | static int | ||
92 | advertise_namespace (void *cls, | ||
93 | struct GNUNET_FS_FileInformation *fi, | ||
94 | uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, | ||
95 | struct GNUNET_FS_Uri **uri, | ||
96 | struct GNUNET_FS_BlockOptions *bo, int *do_index, | ||
97 | void **client_info) | ||
98 | { | ||
99 | struct NamespaceAdvertisementContext *nds = cls; | ||
100 | struct GNUNET_FS_Uri *sks_uri; | ||
101 | struct GNUNET_CRYPTO_EccPublicKey pub; | ||
102 | |||
103 | GNUNET_CRYPTO_ecc_key_get_public (&nds->ns, &pub); | ||
104 | sks_uri = GNUNET_FS_uri_sks_create (&pub, nds->root); | ||
105 | GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (), | ||
106 | *uri, meta, sks_uri, | ||
107 | bo, GNUNET_FS_PUBLISH_OPTION_NONE, | ||
108 | NULL, NULL); | ||
109 | GNUNET_FS_uri_destroy (sks_uri); | ||
110 | return GNUNET_SYSERR; | ||
111 | } | ||
112 | |||
113 | |||
114 | /** | ||
115 | * Callback invoked from the editing dialog upon completion of the | ||
116 | * meta data editing for the advertisement. | ||
117 | * | ||
118 | * @param cls the 'struct NamespaceAdvertisementContext' | ||
119 | * @param ret return value from the dialog | ||
120 | * @param root namespace root to use | ||
121 | */ | ||
122 | static void | ||
123 | adv_pseudonym_edit_publish_dialog_cb (gpointer cls, | ||
124 | gint ret, | ||
125 | const char *root) | ||
126 | { | ||
127 | struct NamespaceAdvertisementContext *nds = cls; | ||
128 | |||
129 | if (ret == GTK_RESPONSE_OK) | ||
130 | { | ||
131 | nds->root = root; | ||
132 | GNUNET_FS_file_information_inspect (nds->fip, &advertise_namespace, nds); | ||
133 | nds->root = NULL; | ||
134 | } | ||
135 | GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL); | ||
136 | GNUNET_free (nds); | ||
137 | } | ||
138 | |||
139 | |||
140 | /** | ||
141 | * Call the publication editor dialog in namespace advertising mode, | ||
142 | * and publish the namespace when it's OK'ed. | ||
143 | * | ||
144 | * @param ns namespace to advertise | ||
145 | * @param transient_for parent window for the dialog | ||
146 | */ | ||
147 | void | ||
148 | GNUNET_FS_GTK_advertise_namespace (const struct GNUNET_CRYPTO_EccPrivateKey *ns, | ||
149 | GtkWindow *transient_for) | ||
150 | { | ||
151 | struct NamespaceAdvertisementContext *nds; | ||
152 | struct GNUNET_FS_BlockOptions bo; | ||
153 | struct GNUNET_CONTAINER_MetaData *meta; | ||
154 | |||
155 | nds = GNUNET_new (struct NamespaceAdvertisementContext); | ||
156 | nds->ns = *ns; | ||
157 | memset (&bo, 0, sizeof (struct GNUNET_FS_BlockOptions)); | ||
158 | bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); | ||
159 | bo.anonymity_level = 1; | ||
160 | bo.content_priority = 1000; | ||
161 | /* create fake file information to run the 'edit' dialog with */ | ||
162 | meta = GNUNET_CONTAINER_meta_data_create (); | ||
163 | nds->fip = | ||
164 | GNUNET_FS_file_information_create_empty_directory (NULL, NULL, NULL, meta, | ||
165 | &bo, NULL); | ||
166 | GNUNET_CONTAINER_meta_data_destroy (meta); | ||
167 | GNUNET_FS_GTK_edit_publish_dialog (transient_for, | ||
168 | nds->fip, | ||
169 | GNUNET_YES, | ||
170 | &adv_pseudonym_edit_publish_dialog_cb, | ||
171 | nds); | ||
172 | } | ||
173 | |||
174 | |||
175 | /* end of gnunet-fs-gtk_advertise-pseudonym.c */ | ||
diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.h b/src/fs/gnunet-fs-gtk_advertise-pseudonym.h deleted file mode 100644 index 4002401e..00000000 --- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.h +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2005-2013 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file src/fs/gnunet-fs-gtk_advertise-pseudonym.h | ||
22 | * @author Christian Grothoff | ||
23 | * @brief run the advertising dialog (using the edit-publish | ||
24 | * dialog functions) and finally do the advertising | ||
25 | */ | ||
26 | #ifndef GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H | ||
27 | #define GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H | ||
28 | |||
29 | #include "gnunet-fs-gtk_common.h" | ||
30 | |||
31 | /** | ||
32 | * Call the publication editor dialog in namespace advertising mode, | ||
33 | * and publish the namespace when it's OK'ed. | ||
34 | * | ||
35 | * @param ns namespace to advertise | ||
36 | * @param transient_for parent window for the dialog | ||
37 | */ | ||
38 | void | ||
39 | GNUNET_FS_GTK_advertise_namespace (const struct GNUNET_CRYPTO_EccPrivateKey *ns, | ||
40 | GtkWindow *transient_for); | ||
41 | |||
42 | #endif | ||
43 | |||
44 | /* end of gnunet-fs-gtk_advertise-pseudonym.h */ | ||
45 | |||