diff options
author | ng0 <ng0@n0.is> | 2019-09-09 19:17:18 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-09 19:17:18 +0000 |
commit | 483b0139a218a5f8a8311bda3eb23bcd88f57688 (patch) | |
tree | d9e7a0f5053cdaa1a720485b93e9927f08466958 /src/fs | |
parent | ec472b1aae122481f4f7e760e5242753eba9bf87 (diff) | |
download | gnunet-483b0139a218a5f8a8311bda3eb23bcd88f57688.tar.gz gnunet-483b0139a218a5f8a8311bda3eb23bcd88f57688.zip |
Remove win32 and cygwin support
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_file_information.c | 19 | ||||
-rw-r--r-- | src/fs/gnunet-download.c | 15 | ||||
-rw-r--r-- | src/fs/gnunet-helper-fs-publish.c | 29 |
3 files changed, 0 insertions, 63 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index ccba1a8b4..dbcfd81c4 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -112,10 +112,6 @@ GNUNET_FS_file_information_create_from_file( | |||
112 | const char *fn; | 112 | const char *fn; |
113 | const char *ss; | 113 | const char *ss; |
114 | 114 | ||
115 | #if WINDOWS | ||
116 | char fn_conv[MAX_PATH]; | ||
117 | #endif | ||
118 | |||
119 | /* FIXME: should include_symbolic_links be GNUNET_NO or GNUNET_YES here? */ | 115 | /* FIXME: should include_symbolic_links be GNUNET_NO or GNUNET_YES here? */ |
120 | if (GNUNET_OK != | 116 | if (GNUNET_OK != |
121 | GNUNET_DISK_file_size(filename, &fsize, GNUNET_NO, GNUNET_YES)) | 117 | GNUNET_DISK_file_size(filename, &fsize, GNUNET_NO, GNUNET_YES)) |
@@ -143,18 +139,12 @@ GNUNET_FS_file_information_create_from_file( | |||
143 | return NULL; | 139 | return NULL; |
144 | ret->h = h; | 140 | ret->h = h; |
145 | ret->filename = GNUNET_strdup(filename); | 141 | ret->filename = GNUNET_strdup(filename); |
146 | #if !WINDOWS | ||
147 | fn = filename; | 142 | fn = filename; |
148 | #else | ||
149 | plibc_conv_to_win_path(filename, fn_conv); | ||
150 | fn = fn_conv; | ||
151 | #endif | ||
152 | while (NULL != (ss = strstr(fn, DIR_SEPARATOR_STR))) | 143 | while (NULL != (ss = strstr(fn, DIR_SEPARATOR_STR))) |
153 | fn = ss + 1; | 144 | fn = ss + 1; |
154 | /* FIXME: If we assume that on other platforms CRT is UTF-8-aware, then | 145 | /* FIXME: If we assume that on other platforms CRT is UTF-8-aware, then |
155 | * this should be changed to EXTRACTOR_METAFORMAT_UTF8 | 146 | * this should be changed to EXTRACTOR_METAFORMAT_UTF8 |
156 | */ | 147 | */ |
157 | #if !WINDOWS | ||
158 | GNUNET_CONTAINER_meta_data_insert(ret->meta, | 148 | GNUNET_CONTAINER_meta_data_insert(ret->meta, |
159 | "<gnunet>", | 149 | "<gnunet>", |
160 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 150 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
@@ -162,15 +152,6 @@ GNUNET_FS_file_information_create_from_file( | |||
162 | "text/plain", | 152 | "text/plain", |
163 | fn, | 153 | fn, |
164 | strlen(fn) + 1); | 154 | strlen(fn) + 1); |
165 | #else | ||
166 | GNUNET_CONTAINER_meta_data_insert(ret->meta, | ||
167 | "<gnunet>", | ||
168 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | ||
169 | EXTRACTOR_METAFORMAT_UTF8, | ||
170 | "text/plain", | ||
171 | fn, | ||
172 | strlen(fn) + 1); | ||
173 | #endif | ||
174 | return ret; | 155 | return ret; |
175 | } | 156 | } |
176 | 157 | ||
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index eda6765ab..14a43e6ec 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -87,13 +87,8 @@ display_bar(unsigned long long x, unsigned long long n, unsigned int w) | |||
87 | unsigned int endeq; | 87 | unsigned int endeq; |
88 | float ratio_complete; | 88 | float ratio_complete; |
89 | 89 | ||
90 | #if !WINDOWS | ||
91 | if (0 == isatty(1)) | 90 | if (0 == isatty(1)) |
92 | return; | 91 | return; |
93 | #else | ||
94 | if (FILE_TYPE_CHAR != GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))) | ||
95 | return; | ||
96 | #endif | ||
97 | ratio_complete = x / (float)n; | 92 | ratio_complete = x / (float)n; |
98 | endeq = ratio_complete * w; | 93 | endeq = ratio_complete * w; |
99 | GNUNET_snprintf(buf, sizeof(buf), "%3d%% [", (int)(ratio_complete * 100)); | 94 | GNUNET_snprintf(buf, sizeof(buf), "%3d%% [", (int)(ratio_complete * 100)); |
@@ -175,13 +170,8 @@ progress_cb(void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
175 | break; | 170 | break; |
176 | 171 | ||
177 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: | 172 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: |
178 | #if !WINDOWS | ||
179 | if (0 != isatty(1)) | 173 | if (0 != isatty(1)) |
180 | fprintf(stdout, "\n"); | 174 | fprintf(stdout, "\n"); |
181 | #else | ||
182 | if (FILE_TYPE_CHAR == GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))) | ||
183 | fprintf(stdout, "\n"); | ||
184 | #endif | ||
185 | fprintf(stderr, | 175 | fprintf(stderr, |
186 | _("Error downloading: %s.\n"), | 176 | _("Error downloading: %s.\n"), |
187 | info->value.download.specifics.error.message); | 177 | info->value.download.specifics.error.message); |
@@ -192,13 +182,8 @@ progress_cb(void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
192 | s = GNUNET_STRINGS_byte_size_fancy( | 182 | s = GNUNET_STRINGS_byte_size_fancy( |
193 | info->value.download.completed * 1000 / | 183 | info->value.download.completed * 1000 / |
194 | (info->value.download.duration.rel_value_us + 1)); | 184 | (info->value.download.duration.rel_value_us + 1)); |
195 | #if !WINDOWS | ||
196 | if (0 != isatty(1)) | 185 | if (0 != isatty(1)) |
197 | fprintf(stdout, "\n"); | 186 | fprintf(stdout, "\n"); |
198 | #else | ||
199 | if (FILE_TYPE_CHAR == GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))) | ||
200 | fprintf(stdout, "\n"); | ||
201 | #endif | ||
202 | fprintf(stdout, | 187 | fprintf(stdout, |
203 | _("Downloading `%s' done (%s/s).\n"), | 188 | _("Downloading `%s' done (%s/s).\n"), |
204 | info->value.download.filename, | 189 | info->value.download.filename, |
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index db74e65aa..a6776d84f 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c | |||
@@ -434,7 +434,6 @@ extract_files(struct ScanTreeNode *item) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
437 | #ifndef WINDOWS | ||
438 | /** | 437 | /** |
439 | * Install a signal handler to ignore SIGPIPE. | 438 | * Install a signal handler to ignore SIGPIPE. |
440 | */ | 439 | */ |
@@ -479,8 +478,6 @@ make_dev_zero(int fd, int flags) | |||
479 | GNUNET_assert(0 == close(z)); | 478 | GNUNET_assert(0 == close(z)); |
480 | } | 479 | } |
481 | 480 | ||
482 | #endif | ||
483 | |||
484 | 481 | ||
485 | /** | 482 | /** |
486 | * Main function of the helper process to extract meta data. | 483 | * Main function of the helper process to extract meta data. |
@@ -499,23 +496,12 @@ main(int argc, char *const *argv) | |||
499 | const char *ex; | 496 | const char *ex; |
500 | struct ScanTreeNode *root; | 497 | struct ScanTreeNode *root; |
501 | 498 | ||
502 | #if WINDOWS | ||
503 | /* We're using stdout to communicate binary data back to the parent; use | ||
504 | * binary mode. | ||
505 | */ | ||
506 | _setmode(1, _O_BINARY); | ||
507 | /* Get utf-8-encoded arguments */ | ||
508 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args(argc, argv, &argc, &argv)) | ||
509 | return 5; | ||
510 | output_stream = 1; /* stdout */ | ||
511 | #else | ||
512 | ignore_sigpipe(); | 499 | ignore_sigpipe(); |
513 | /* move stdout to some other FD for IPC, bind | 500 | /* move stdout to some other FD for IPC, bind |
514 | stdout/stderr to /dev/null */ | 501 | stdout/stderr to /dev/null */ |
515 | output_stream = dup(1); | 502 | output_stream = dup(1); |
516 | make_dev_zero(1, O_WRONLY); | 503 | make_dev_zero(1, O_WRONLY); |
517 | make_dev_zero(2, O_WRONLY); | 504 | make_dev_zero(2, O_WRONLY); |
518 | #endif | ||
519 | 505 | ||
520 | /* parse command line */ | 506 | /* parse command line */ |
521 | if ((3 != argc) && (2 != argc)) | 507 | if ((3 != argc) && (2 != argc)) |
@@ -523,9 +509,6 @@ main(int argc, char *const *argv) | |||
523 | fprintf(stderr, | 509 | fprintf(stderr, |
524 | "%s", | 510 | "%s", |
525 | "gnunet-helper-fs-publish needs exactly one or two arguments\n"); | 511 | "gnunet-helper-fs-publish needs exactly one or two arguments\n"); |
526 | #if WINDOWS | ||
527 | GNUNET_free((void *)argv); | ||
528 | #endif | ||
529 | return 1; | 512 | return 1; |
530 | } | 513 | } |
531 | filename_expanded = argv[1]; | 514 | filename_expanded = argv[1]; |
@@ -548,9 +531,6 @@ main(int argc, char *const *argv) | |||
548 | #if HAVE_LIBEXTRACTOR | 531 | #if HAVE_LIBEXTRACTOR |
549 | EXTRACTOR_plugin_remove_all(plugins); | 532 | EXTRACTOR_plugin_remove_all(plugins); |
550 | #endif | 533 | #endif |
551 | #if WINDOWS | ||
552 | GNUNET_free((void *)argv); | ||
553 | #endif | ||
554 | return 2; | 534 | return 2; |
555 | } | 535 | } |
556 | /* signal that we're done counting files, so that a percentage of | 536 | /* signal that we're done counting files, so that a percentage of |
@@ -563,9 +543,6 @@ main(int argc, char *const *argv) | |||
563 | #if HAVE_LIBEXTRACTOR | 543 | #if HAVE_LIBEXTRACTOR |
564 | EXTRACTOR_plugin_remove_all(plugins); | 544 | EXTRACTOR_plugin_remove_all(plugins); |
565 | #endif | 545 | #endif |
566 | #if WINDOWS | ||
567 | GNUNET_free((void *)argv); | ||
568 | #endif | ||
569 | return 3; | 546 | return 3; |
570 | } | 547 | } |
571 | if (NULL != root) | 548 | if (NULL != root) |
@@ -579,9 +556,6 @@ main(int argc, char *const *argv) | |||
579 | #if HAVE_LIBEXTRACTOR | 556 | #if HAVE_LIBEXTRACTOR |
580 | EXTRACTOR_plugin_remove_all(plugins); | 557 | EXTRACTOR_plugin_remove_all(plugins); |
581 | #endif | 558 | #endif |
582 | #if WINDOWS | ||
583 | GNUNET_free((void *)argv); | ||
584 | #endif | ||
585 | return 4; | 559 | return 4; |
586 | } | 560 | } |
587 | free_tree(root); | 561 | free_tree(root); |
@@ -593,9 +567,6 @@ main(int argc, char *const *argv) | |||
593 | #if HAVE_LIBEXTRACTOR | 567 | #if HAVE_LIBEXTRACTOR |
594 | EXTRACTOR_plugin_remove_all(plugins); | 568 | EXTRACTOR_plugin_remove_all(plugins); |
595 | #endif | 569 | #endif |
596 | #if WINDOWS | ||
597 | GNUNET_free((void *)argv); | ||
598 | #endif | ||
599 | return 0; | 570 | return 0; |
600 | } | 571 | } |
601 | 572 | ||