home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / x / 453 < prev    next >
Encoding:
Text File  |  1992-08-18  |  50.3 KB  |  1,963 lines

  1. Path: sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!swrinde!mips!msi!dcmartin
  2. From: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
  3. Newsgroups: comp.sources.x
  4. Subject: v18i084: Ftptool 4.3 (XVIEW), Part02/12
  5. Message-ID: <1992Aug18.153539.28611@msi.com>
  6. Date: 18 Aug 92 15:35:39 GMT
  7. References: <csx-18i083-ftptool-4.3@uunet.UU.NET>
  8. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  9. Organization: Molecular Simulations, Inc.
  10. Lines: 1949
  11. Approved: dcmartin@msi.com
  12. Originator: dcmartin@fascet
  13.  
  14. Submitted-by: Mike.Sullivan@EBay.Sun.COM (Mike Sullivan {AKA Simon BarSinister})
  15. Posting-number: Volume 18, Issue 84
  16. Archive-name: ftptool-4.3/part02
  17.  
  18. #!/bin/sh
  19. # this is part.02 (part 2 of a multipart archive)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file menu_funcs.h continued
  22. #
  23. if test ! -r _shar_seq_.tmp; then
  24.     echo 'Please unpack part 1 first!'
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 2; then
  29.     echo Please unpack part "$Scheck" next!
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < _shar_seq_.tmp || exit 1
  35. if test ! -f _shar_wnt_.tmp; then
  36.     echo 'x - still skipping menu_funcs.h'
  37. else
  38. echo 'x - continuing file menu_funcs.h'
  39. sed 's/^X//' << 'SHAR_EOF' >> 'menu_funcs.h' &&
  40. void change_local_list_menu(void);
  41. void change_remote_list_menu(void);
  42. Menu props_menu_gen(Menu m, Menu_generate op);
  43. Menu send_list_menu_gen(Menu m, Menu_generate op);
  44. Menu receive_list_menu_gen(Menu m, Menu_generate op);
  45. Menu host_menu_gen(Menu m, Menu_generate op);
  46. X
  47. #else
  48. X
  49. Menu file_menu_gen();
  50. Menu file_copy_menu_gen();
  51. Menu file_delete_menu_gen();
  52. Menu view_menu_gen();
  53. void change_local_list_menu();
  54. void change_remote_list_menu();
  55. Menu props_menu_gen();
  56. Menu send_list_menu_gen();
  57. Menu receive_list_menu_gen();
  58. Menu host_menu_gen();
  59. X
  60. #endif
  61. SHAR_EOF
  62. echo 'File menu_funcs.h is complete' &&
  63. chmod 0644 menu_funcs.h ||
  64. echo 'restore of menu_funcs.h failed'
  65. Wc_c="`wc -c < 'menu_funcs.h'`"
  66. test 770 -eq "$Wc_c" ||
  67.     echo 'menu_funcs.h: original size 770, current size' "$Wc_c"
  68. rm -f _shar_wnt_.tmp
  69. fi
  70. # ============= misc.h ==============
  71. if test -f 'misc.h' -a X"$1" != X"-c"; then
  72.     echo 'x - skipping misc.h (File already exists)'
  73.     rm -f _shar_wnt_.tmp
  74. else
  75. > _shar_wnt_.tmp
  76. echo 'x - extracting misc.h (Text)'
  77. sed 's/^X//' << 'SHAR_EOF' > 'misc.h' &&
  78. X
  79. #ifdef USE_PROTOTYPES
  80. X
  81. void log_char(char ch);
  82. void log_message(char *s);
  83. char *ftp_error(char ch, char *def);
  84. void footer_message(char *format, ...);
  85. void local_footer_message(char *format, ...);
  86. void right_footer_message(char *format, ...);
  87. void local_right_footer_message(char *format, ...);
  88. void schedule_footer_message(char *format, ...);
  89. void status_footer_message(char *format, ...);
  90. void timeout_disconnect(void);
  91. void close_files(void);
  92. void quit_ftp(void);
  93. void disconnect(void);
  94. void xfer_buttons_inactive(void);
  95. void xfer_buttons_active(void);
  96. void cursor_busy(void);
  97. void cursor_normal(void);
  98. void show_stats(struct file_property_window *file_props,
  99. X    struct dirlist *tmp);
  100. void inactivate_props(struct file_property_window *file_props);
  101. int ask_make_dir(char *s);
  102. int make_dirs(char *s, int make_last);
  103. int ask_make_remote_dir(char *s);
  104. int make_remote_dirs(char *s, int make_last);
  105. void set_geometry(char *s, Frame frame, int def_width, int def_height, 
  106. X    int def_x, int def_y);
  107. void save_geometry(char *s, Frame frame);
  108. void justify_items(Panel panel, int resize);
  109. void resize_text_item(Panel panel, Panel_item text_item);
  110. char *linkval(char *string);
  111. char *linkname(char *string);
  112. void add_dismiss(Panel panel, Panel_item first, Panel_item dismiss);
  113. void update_date(int doscheddefault);
  114. Notify_value date_wrapper(void);
  115. void local_show_items(void);
  116. void remote_show_items(void);
  117. int ping_server(void);
  118. X
  119. #else
  120. X
  121. void log_char();
  122. void log_message();
  123. char *ftp_error();
  124. void footer_message();
  125. void local_footer_message();
  126. void right_footer_message();
  127. void local_right_footer_message();
  128. void schedule_footer_message();
  129. void status_footer_message();
  130. void timeout_disconnect();
  131. void close_files();
  132. void quit_ftp();
  133. void disconnect();
  134. void xfer_buttons_inactive();
  135. void xfer_buttons_active();
  136. void cursor_busy();
  137. void cursor_normal();
  138. void show_stats();
  139. void inactivate_props();
  140. int ask_make_dir();
  141. int make_dirs();
  142. int ask_make_remote_dir();
  143. int make_remote_dirs();
  144. void set_geometry();
  145. void save_geometry();
  146. void justify_items();
  147. void resize_text_item();
  148. char *linkval();
  149. char *linkname();
  150. void add_dismiss();
  151. void update_date();
  152. Notify_value date_wrapper();
  153. void local_show_items();
  154. void remote_show_items();
  155. int ping_server();
  156. X
  157. #endif
  158. SHAR_EOF
  159. chmod 0644 misc.h ||
  160. echo 'restore of misc.h failed'
  161. Wc_c="`wc -c < 'misc.h'`"
  162. test 2248 -eq "$Wc_c" ||
  163.     echo 'misc.h: original size 2248, current size' "$Wc_c"
  164. rm -f _shar_wnt_.tmp
  165. fi
  166. # ============= more ==============
  167. if test -f 'more' -a X"$1" != X"-c"; then
  168.     echo 'x - skipping more (File already exists)'
  169.     rm -f _shar_wnt_.tmp
  170. else
  171. > _shar_wnt_.tmp
  172. echo 'x - extracting more (Text)'
  173. sed 's/^X//' << 'SHAR_EOF' > 'more' &&
  174. |: No such file or directory
  175. SHAR_EOF
  176. chmod 0644 more ||
  177. echo 'restore of more failed'
  178. Wc_c="`wc -c < 'more'`"
  179. test 29 -eq "$Wc_c" ||
  180.     echo 'more: original size 29, current size' "$Wc_c"
  181. rm -f _shar_wnt_.tmp
  182. fi
  183. # ============= patchlevel.h ==============
  184. if test -f 'patchlevel.h' -a X"$1" != X"-c"; then
  185.     echo 'x - skipping patchlevel.h (File already exists)'
  186.     rm -f _shar_wnt_.tmp
  187. else
  188. > _shar_wnt_.tmp
  189. echo 'x - extracting patchlevel.h (Text)'
  190. sed 's/^X//' << 'SHAR_EOF' > 'patchlevel.h' &&
  191. #define VERSION        4
  192. #define PATCHLEVEL    3
  193. SHAR_EOF
  194. chmod 0644 patchlevel.h ||
  195. echo 'restore of patchlevel.h failed'
  196. Wc_c="`wc -c < 'patchlevel.h'`"
  197. test 40 -eq "$Wc_c" ||
  198.     echo 'patchlevel.h: original size 40, current size' "$Wc_c"
  199. rm -f _shar_wnt_.tmp
  200. fi
  201. # ============= readdir.h ==============
  202. if test -f 'readdir.h' -a X"$1" != X"-c"; then
  203.     echo 'x - skipping readdir.h (File already exists)'
  204.     rm -f _shar_wnt_.tmp
  205. else
  206. > _shar_wnt_.tmp
  207. echo 'x - extracting readdir.h (Text)'
  208. sed 's/^X//' << 'SHAR_EOF' > 'readdir.h' &&
  209. X
  210. #define PERMS        1
  211. #define LINKS        2
  212. #define USER        3
  213. #define GROUP        4
  214. #define SIZE        5
  215. #define MONTH        6
  216. #define DAY            7
  217. #define TIME        8
  218. #define NAME        9
  219. #define SKIP        10
  220. #define NONUNIX        11
  221. #define LOWERNAME    12
  222. #define MAXTOKENS    12
  223. X
  224. #ifdef USE_PROTOTYPES
  225. X
  226. struct dirlist *read_local_dir(char *dirname);
  227. struct dirlist *read_remote_dir(char *dname);
  228. int    parse_line(struct dirlist *head, char *line, int *temp_non_unix);
  229. char *dir_parse_to_pattern(char *dir_parse);
  230. int perms(char *s, int *temp_non_unix);
  231. X
  232. #else
  233. X
  234. struct dirlist *read_local_dir();
  235. struct dirlist *read_remote_dir();
  236. int    parse_line();
  237. char *dir_parse_to_pattern();
  238. int perms();
  239. X
  240. #endif
  241. SHAR_EOF
  242. chmod 0644 readdir.h ||
  243. echo 'restore of readdir.h failed'
  244. Wc_c="`wc -c < 'readdir.h'`"
  245. test 646 -eq "$Wc_c" ||
  246.     echo 'readdir.h: original size 646, current size' "$Wc_c"
  247. rm -f _shar_wnt_.tmp
  248. fi
  249. # ============= schedule.h ==============
  250. if test -f 'schedule.h' -a X"$1" != X"-c"; then
  251.     echo 'x - skipping schedule.h (File already exists)'
  252.     rm -f _shar_wnt_.tmp
  253. else
  254. > _shar_wnt_.tmp
  255. echo 'x - extracting schedule.h (Text)'
  256. sed 's/^X//' << 'SHAR_EOF' > 'schedule.h' &&
  257. X
  258. #ifdef USE_PROTOTYPES
  259. X
  260. struct schedule *new_schedule(char *menu_name, int direction, 
  261. X    time_t date, char *filename, struct hostlist *hl);
  262. struct schedule *add_schedule(struct schedule *head, char *menu_name, 
  263. X    int direction, time_t date, char *filename, struct hostlist *hl);
  264. void free_schedule(struct schedule *head);
  265. void delete_schedule(struct schedule *head, char *menu_name, int direction);
  266. void reorder_list(struct schedule *head);
  267. void load_schedule(void);
  268. void set_current_schedule_proc(Menu menu, Menu_item menu_item);
  269. int schedule_exists(struct schedule *head, char *menu_name, 
  270. X    int direction);
  271. void enter_schedule_info(int warnchange);
  272. void schedule_add_proc(Menu menu, Menu_item menu_item);
  273. void schedule_change_proc(Menu menu, Menu_item menu_item);
  274. void schedule_delete_proc(Menu menu, Menu_item menu_item);
  275. void schedule_item_proc(Menu menu, Menu_item menu_item);
  276. void reload_schedule_menu(struct schedule *head);
  277. void action_choice_proc(Panel_item item, unsigned int value, 
  278. X    Event *event);
  279. Notify_value schedule_timer_proc(void);
  280. void activate_schedule_timer(void);
  281. void batch_process_proc(Panel_item item, Event *event);
  282. void doschedule(void);
  283. X
  284. #else
  285. X
  286. struct schedule *new_schedule();
  287. struct schedule *add_schedule();
  288. void free_schedule();
  289. void delete_schedule();
  290. void reorder_list();
  291. void load_schedule();
  292. void set_current_schedule_proc();
  293. int schedule_exists();
  294. void enter_schedule_info();
  295. void schedule_add_proc();
  296. void schedule_change_proc();
  297. void schedule_delete_proc();
  298. void schedule_item_proc();
  299. void reload_schedule_menu();
  300. void action_choice_proc();
  301. Notify_value schedule_timer_proc();
  302. void activate_schedule_timer();
  303. void batch_process_proc();
  304. void doschedule();
  305. X
  306. #endif
  307. SHAR_EOF
  308. chmod 0644 schedule.h ||
  309. echo 'restore of schedule.h failed'
  310. Wc_c="`wc -c < 'schedule.h'`"
  311. test 1700 -eq "$Wc_c" ||
  312.     echo 'schedule.h: original size 1700, current size' "$Wc_c"
  313. rm -f _shar_wnt_.tmp
  314. fi
  315. # ============= schedule_struct.h ==============
  316. if test -f 'schedule_struct.h' -a X"$1" != X"-c"; then
  317.     echo 'x - skipping schedule_struct.h (File already exists)'
  318.     rm -f _shar_wnt_.tmp
  319. else
  320. > _shar_wnt_.tmp
  321. echo 'x - extracting schedule_struct.h (Text)'
  322. sed 's/^X//' << 'SHAR_EOF' > 'schedule_struct.h' &&
  323. struct schedule {
  324. X    char    *menu_name;
  325. X    int        direction;
  326. X    time_t    date;
  327. X    char    *filename;
  328. X    struct hostlist *hl;
  329. X    struct schedule *next;
  330. };
  331. X
  332. #define RECV    0
  333. #define    SEND    1
  334. X
  335. SHAR_EOF
  336. chmod 0644 schedule_struct.h ||
  337. echo 'restore of schedule_struct.h failed'
  338. Wc_c="`wc -c < 'schedule_struct.h'`"
  339. test 165 -eq "$Wc_c" ||
  340.     echo 'schedule_struct.h: original size 165, current size' "$Wc_c"
  341. rm -f _shar_wnt_.tmp
  342. fi
  343. # ============= tar.viewer.icon ==============
  344. if test -f 'tar.viewer.icon' -a X"$1" != X"-c"; then
  345.     echo 'x - skipping tar.viewer.icon (File already exists)'
  346.     rm -f _shar_wnt_.tmp
  347. else
  348. > _shar_wnt_.tmp
  349. echo 'x - extracting tar.viewer.icon (Text)'
  350. sed 's/^X//' << 'SHAR_EOF' > 'tar.viewer.icon' &&
  351. /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  352. X */
  353. X    0x0000,    0x0000,    0x0000,    0x0000,
  354. X    0x0000,    0x0000,    0x0000,    0x0000,
  355. X    0x0000,    0x0000,    0x0000,    0x0000,
  356. X    0x0000,    0x0000,    0x0000,    0x0000,
  357. X    0x0000,    0x0000,    0x0000,    0x0000,
  358. X    0x0000,    0x0000,    0x0000,    0x0000,
  359. X    0x0000,    0x0000,    0x0000,    0x0000,
  360. X    0x0000,    0x0000,    0x0000,    0x0000,
  361. X    0x0000,    0x0000,    0x0000,    0x0000,
  362. X    0x0000,    0x0C00,    0x0000,    0x0000,
  363. X    0x0000,    0x0C00,    0x0000,    0x0000,
  364. X    0x0000,    0x0C00,    0x0000,    0x0000,
  365. X    0x0000,    0x0C00,    0x0000,    0x0000,
  366. X    0x0000,    0x3F07,    0xC0CC,    0x0000,
  367. X    0x0000,    0x3F0F,    0xE0DC,    0x0000,
  368. X    0x0000,    0x0C18,    0x70FC,    0x0000,
  369. X    0x0000,    0x0C18,    0x30E0,    0x0000,
  370. X    0x0000,    0x0C00,    0x30C0,    0x0000,
  371. X    0x0000,    0x0C01,    0xF0C0,    0x0000,
  372. X    0x0000,    0x0C0F,    0xF0C0,    0x0000,
  373. X    0x0000,    0x0C1E,    0x30C0,    0x0000,
  374. X    0x0000,    0x0C38,    0x30C0,    0x0000,
  375. X    0x0000,    0x0C30,    0x30C0,    0x0000,
  376. X    0x0000,    0x0C30,    0x70C0,    0x0000,
  377. X    0x0000,    0x0C38,    0xF0C0,    0x0000,
  378. X    0x0000,    0x0F1F,    0xB8C0,    0x0000,
  379. X    0x0000,    0x070F,    0x18C0,    0x0000,
  380. X    0x0000,    0x0000,    0x0000,    0x0000,
  381. X    0x0000,    0x0000,    0x0000,    0x0000,
  382. X    0x0000,    0x0000,    0x0000,    0x0000,
  383. X    0x0000,    0x0000,    0x0000,    0x0000,
  384. X    0x0000,    0x0000,    0x0000,    0x0000,
  385. X    0x0000,    0x0000,    0x0000,    0x0000,
  386. X    0x0000,    0x0000,    0x0000,    0x0000,
  387. X    0x0000,    0x0000,    0x0000,    0x0000,
  388. X    0x0000,    0x0000,    0x0000,    0x0000,
  389. X    0x0000,    0x0000,    0x0000,    0x0000,
  390. X    0x0000,    0x0000,    0x0000,    0x0000,
  391. X    0x0000,    0x0000,    0x0000,    0x0000,
  392. X    0x0000,    0x0000,    0x0000,    0x0000,
  393. X    0x0000,    0x6000,    0x0000,    0x0000,
  394. X    0x0000,    0x6000,    0x0000,    0x0000,
  395. X    0x0000,    0x0000,    0x0000,    0x0000,
  396. X    0x0000,    0x0000,    0x0000,    0x0000,
  397. X    0x0186,    0x61E1,    0x8C61,    0xE1B0,
  398. X    0x0186,    0x63F1,    0x8C63,    0xF1B0,
  399. X    0x0186,    0x6619,    0x8C66,    0x19C0,
  400. X    0x00CC,    0x6618,    0xCCC6,    0x1980,
  401. X    0x00CC,    0x67F8,    0xCCC7,    0xF980,
  402. X    0x00CC,    0x6600,    0xD2C6,    0x0180,
  403. X    0x0048,    0x6600,    0x5286,    0x0180,
  404. X    0x0078,    0x6718,    0x7387,    0x1980,
  405. X    0x0030,    0x63F8,    0x3303,    0xF980,
  406. X    0x0030,    0x61E0,    0x3301,    0xE180,
  407. X    0x0000,    0x0000,    0x0000,    0x0000,
  408. X    0x0000,    0x0000,    0x0000,    0x0000,
  409. X    0x0000,    0x0000,    0x0000,    0x0000,
  410. X    0x0000,    0x0000,    0x0000,    0x0000,
  411. X    0x0000,    0x0000,    0x0000,    0x0000,
  412. X    0x0000,    0x0000,    0x0000,    0x0000,
  413. X    0x0000,    0x0000,    0x0000,    0x0000,
  414. X    0x0000,    0x0000,    0x0000,    0x0000,
  415. X    0x0000,    0x0000,    0x0000,    0x0000,
  416. X    0x0000,    0x0000,    0x0000,    0x0000,
  417. SHAR_EOF
  418. chmod 0644 tar.viewer.icon ||
  419. echo 'restore of tar.viewer.icon failed'
  420. Wc_c="`wc -c < 'tar.viewer.icon'`"
  421. test 2190 -eq "$Wc_c" ||
  422.     echo 'tar.viewer.icon: original size 2190, current size' "$Wc_c"
  423. rm -f _shar_wnt_.tmp
  424. fi
  425. # ============= tar_view.h ==============
  426. if test -f 'tar_view.h' -a X"$1" != X"-c"; then
  427.     echo 'x - skipping tar_view.h (File already exists)'
  428.     rm -f _shar_wnt_.tmp
  429. else
  430. > _shar_wnt_.tmp
  431. echo 'x - extracting tar_view.h (Text)'
  432. sed 's/^X//' << 'SHAR_EOF' > 'tar_view.h' &&
  433. X
  434. #ifdef USE_PROTOTYPES
  435. X
  436. void handle_tarfile(char *filename);
  437. void list_proc(void);
  438. void doextract_proc(void);
  439. void tar_extract_proc(void);
  440. void start_tar(char *options, char *filename);
  441. Notify_value input_func(Notify_client client, int fd);
  442. Notify_value tar_destroy_func(Notify_client client, Destroy_status status);
  443. void tar_quit_proc(void);
  444. X
  445. #else
  446. X
  447. void handle_tarfile();
  448. void list_proc();
  449. void doextract_proc();
  450. void tar_extract_proc();
  451. void start_tar();
  452. Notify_value input_func();
  453. Notify_value tar_destroy_func();
  454. void tar_quit_proc();
  455. X
  456. #endif
  457. SHAR_EOF
  458. chmod 0644 tar_view.h ||
  459. echo 'restore of tar_view.h failed'
  460. Wc_c="`wc -c < 'tar_view.h'`"
  461. test 548 -eq "$Wc_c" ||
  462.     echo 'tar_view.h: original size 548, current size' "$Wc_c"
  463. rm -f _shar_wnt_.tmp
  464. fi
  465. # ============= transfer.h ==============
  466. if test -f 'transfer.h' -a X"$1" != X"-c"; then
  467.     echo 'x - skipping transfer.h (File already exists)'
  468.     rm -f _shar_wnt_.tmp
  469. else
  470. > _shar_wnt_.tmp
  471. echo 'x - extracting transfer.h (Text)'
  472. sed 's/^X//' << 'SHAR_EOF' > 'transfer.h' &&
  473. X
  474. #ifdef USE_PROTOTYPES
  475. X
  476. int get_file(char *name, char *localname, size_t size);
  477. int put_file(char *name, char *remote_name, size_t size);
  478. int get_dir(char *parent_remote_dir, char *parent_local_dir, 
  479. X    char *name, char *localname);
  480. int put_dir(char *parent_remote_dir, char *parent_local_dir, 
  481. X    char *name, char *localname);
  482. char *make_path(char *parent, char *curdir);
  483. void init_status(int total);
  484. void end_status(void);
  485. void update_status_label(char *direction, char *name, size_t size);
  486. void update_status_gauge(long bytes);
  487. int sum_local_dir(char *parent, char *dir);
  488. int sum_local_size(void);
  489. int sum_remote_dir(char *parent, char *dir);
  490. int sum_remote_size(void);
  491. int sum_remote_batch_size(void);
  492. int sum_local_batch_size(void);
  493. X
  494. #else
  495. X
  496. int get_file();
  497. int put_file();
  498. int get_dir();
  499. int put_dir();
  500. char *make_path();
  501. void init_status();
  502. void end_status();
  503. void update_status_label();
  504. void update_status_gauge();
  505. int sum_local_dir();
  506. int sum_local_size();
  507. int sum_remote_dir();
  508. int sum_remote_size();
  509. int sum_remote_batch_size();
  510. int sum_local_batch_size();
  511. X
  512. #endif
  513. SHAR_EOF
  514. chmod 0644 transfer.h ||
  515. echo 'restore of transfer.h failed'
  516. Wc_c="`wc -c < 'transfer.h'`"
  517. test 1071 -eq "$Wc_c" ||
  518.     echo 'transfer.h: original size 1071, current size' "$Wc_c"
  519. rm -f _shar_wnt_.tmp
  520. fi
  521. # ============= unknown.pr ==============
  522. if test -f 'unknown.pr' -a X"$1" != X"-c"; then
  523.     echo 'x - skipping unknown.pr (File already exists)'
  524.     rm -f _shar_wnt_.tmp
  525. else
  526. > _shar_wnt_.tmp
  527. echo 'x - extracting unknown.pr (Text)'
  528. sed 's/^X//' << 'SHAR_EOF' > 'unknown.pr' &&
  529. /* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  530. X */
  531. X    0xFFFF,
  532. X    0x8001,
  533. X    0x8001,
  534. X    0x8381,
  535. X    0x8441,
  536. X    0x8441,
  537. X    0x8041,
  538. X    0x8081,
  539. X    0x8101,
  540. X    0x8101,
  541. X    0x8001,
  542. X    0x8101,
  543. X    0x8001,
  544. X    0x8001,
  545. X    0x8001,
  546. X    0xFFFF
  547. X
  548. SHAR_EOF
  549. chmod 0644 unknown.pr ||
  550. echo 'restore of unknown.pr failed'
  551. Wc_c="`wc -c < 'unknown.pr'`"
  552. test 222 -eq "$Wc_c" ||
  553.     echo 'unknown.pr: original size 222, current size' "$Wc_c"
  554. rm -f _shar_wnt_.tmp
  555. fi
  556. # ============= view_file.h ==============
  557. if test -f 'view_file.h' -a X"$1" != X"-c"; then
  558.     echo 'x - skipping view_file.h (File already exists)'
  559.     rm -f _shar_wnt_.tmp
  560. else
  561. > _shar_wnt_.tmp
  562. echo 'x - extracting view_file.h (Text)'
  563. sed 's/^X//' << 'SHAR_EOF' > 'view_file.h' &&
  564. #define UNKNOWN     (-1)
  565. #define COMPRESSED  1
  566. #define POSTSCRIPT  2
  567. #define TARFILE     3
  568. X
  569. #ifdef USE_PROTOTYPES
  570. X
  571. int start_viewer(char *filename, int isremote);
  572. void fork_viewer(char *program, char *filename);
  573. int file_type(char *filename);
  574. void uncompress_file(char *filename, char *options);
  575. void compress_file(char *filename, char *options);
  576. void pipe_program(char *argv[]);
  577. int view_local_file(char *name, int which, int *dirchanged);
  578. int view_remote_file(char *name, size_t size);
  579. X
  580. #else
  581. X
  582. int start_viewer();
  583. void fork_viewer();
  584. int file_type();
  585. void uncompress_file();
  586. void compress_file();
  587. void pipe_program();
  588. int view_local_file();
  589. int view_remote_file();
  590. X
  591. #endif
  592. SHAR_EOF
  593. chmod 0644 view_file.h ||
  594. echo 'restore of view_file.h failed'
  595. Wc_c="`wc -c < 'view_file.h'`"
  596. test 675 -eq "$Wc_c" ||
  597.     echo 'view_file.h: original size 675, current size' "$Wc_c"
  598. rm -f _shar_wnt_.tmp
  599. fi
  600. # ============= README ==============
  601. if test -f 'README' -a X"$1" != X"-c"; then
  602.     echo 'x - skipping README (File already exists)'
  603.     rm -f _shar_wnt_.tmp
  604. else
  605. > _shar_wnt_.tmp
  606. echo 'x - extracting README (Text)'
  607. sed 's/^X//' << 'SHAR_EOF' > 'README' &&
  608. X
  609. The source for ftptool is, as far as I'm concerned freely distributable as 
  610. long as I recieve credit for it (my bosses agree, though Sun hasn't spoken).
  611. X
  612. You should be able to compile and run it on 4.1.X, OW2 or better. You
  613. might want to use xview3, which is available with the OW3 CD or from
  614. export.lcs.mit.edu in /contrib/xview3. For a sun3, you may also need
  615. the unofficial patch /contrib/xview3/Fixes/xview3.0_unofficial_patch
  616. (unless Patch-02 fixed those problems).  Other operating
  617. systems (besides SunOS 5.0) have not been tested by me, though I believe 
  618. it works under Ultrix and 386SVR4.
  619. X
  620. You can either use the supplied Makefile.sun, or use the Imakefile (which
  621. seems to work, but I'm not an Imakefile expert so I'm not sure. I _have_ been
  622. using a Makefile generated from this one though). You should be able to
  623. compile a version for SunOS 5.0 (internal to Sun) by modifying Makefile.sun.
  624. X
  625. Also, make sure config.h is set up appropriately for your system.
  626. X
  627. Author: Mike Sullivan (Mike.Sullivan@Sun.COM)
  628. X
  629. Ported to 386 SVR4 by Jerry Whelan <guru@stasi.bradley.edu>.
  630. X
  631. Ported to Ultrix by Robert Evans <Robert.Evans@cm.cf.ac.uk>.
  632. X
  633. Note, the ftp code was taken from the Berkeley ftp. Primarily, the following
  634. notice applies to ftp.c.
  635. X
  636. /*
  637. X * Copyright (c) 1985, 1989 Regents of the University of California.
  638. X * All rights reserved.
  639. X *
  640. X * Redistribution and use in source and binary forms, with or without
  641. X * modification, are permitted provided that the following conditions
  642. X * are met:
  643. X * 1. Redistributions of source code must retain the above copyright
  644. X *    notice, this list of conditions and the following disclaimer.
  645. X * 2. Redistributions in binary form must reproduce the above copyright
  646. X *    notice, this list of conditions and the following disclaimer in the
  647. X *    documentation and/or other materials provided with the distribution.
  648. X * 3. All advertising materials mentioning features or use of this software
  649. X *    must display the following acknowledgement:
  650. X *    This product includes software developed by the University of
  651. X *    California, Berkeley and its contributors.
  652. X * 4. Neither the name of the University nor the names of its contributors
  653. X *    may be used to endorse or promote products derived from this software
  654. X *    without specific prior written permission.
  655. X *
  656. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  657. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  658. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  659. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  660. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  661. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  662. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  663. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  664. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  665. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  666. X * SUCH DAMAGE.
  667. X */
  668. X
  669. SHAR_EOF
  670. chmod 0644 README ||
  671. echo 'restore of README failed'
  672. Wc_c="`wc -c < 'README'`"
  673. test 3069 -eq "$Wc_c" ||
  674.     echo 'README: original size 3069, current size' "$Wc_c"
  675. rm -f _shar_wnt_.tmp
  676. fi
  677. # ============= batch.c ==============
  678. if test -f 'batch.c' -a X"$1" != X"-c"; then
  679.     echo 'x - skipping batch.c (File already exists)'
  680.     rm -f _shar_wnt_.tmp
  681. else
  682. > _shar_wnt_.tmp
  683. echo 'x - extracting batch.c (Text)'
  684. sed 's/^X//' << 'SHAR_EOF' > 'batch.c' &&
  685. #include "ftptool.h"
  686. X
  687. #ifdef USE_PROTOTYPES
  688. struct batchlist *new_batchlist(void)
  689. #else
  690. struct batchlist *new_batchlist()
  691. #endif
  692. {
  693. X    struct batchlist *tmp;
  694. X
  695. X    tmp = (struct batchlist *)malloc(sizeof(struct batchlist));
  696. X    if (tmp == NULL)
  697. X        return NULL;
  698. X    bzero((char *)tmp, sizeof(struct batchlist));
  699. X    tmp->name = NULL;
  700. X    return tmp;
  701. }
  702. X
  703. #ifdef USE_PROTOTYPES
  704. struct batchlist *add_batchname(Panel panel_list, char *name, mode_t mode,
  705. X    size_t size, char *dir)
  706. #else
  707. struct batchlist *add_batchname(panel_list, name, mode, size, dir)
  708. Panel    panel_list;
  709. char    *name;
  710. mode_t    mode;
  711. size_t        size;
  712. char    *dir;
  713. #endif
  714. {
  715. X    struct batchlist *tmp;
  716. X    int    nitems;
  717. X    char    *fullname;
  718. X    Xv_font    entry_font;
  719. X
  720. X    if (!S_ISDIR(mode) && !S_ISREG(mode) && !S_ISLNK(mode))
  721. X        return NULL;
  722. X    if (dir != NULL && *name != '/') {
  723. X        fullname = (char *)malloc((unsigned int)(strlen(dir)+1+strlen(name)+1));
  724. X        if (fullname == NULL)
  725. X            return NULL;
  726. X        strcpy(fullname, dir);
  727. X        if (strcmp(dir, "/"))
  728. X            strcat(fullname, "/");
  729. X        strcat(fullname, name);
  730. X    } else {
  731. X        fullname = strdup(name);
  732. X        if (fullname == NULL)
  733. X            return NULL;
  734. X    }
  735. X
  736. X    /* just add to the end */
  737. X    if (batchentry_exists(panel_list, fullname) != -1) {
  738. X        free(fullname);
  739. X        return NULL;
  740. X    }
  741. X    tmp = new_batchlist();
  742. X    if (tmp == NULL)
  743. X        return NULL;
  744. X    
  745. X    nitems = xv_get(panel_list, PANEL_LIST_NROWS);
  746. X    tmp->name = fullname;
  747. X    tmp->mode = mode;
  748. X    tmp->row = nitems;
  749. X    tmp->size = size;
  750. X
  751. X    if (S_ISDIR(tmp->mode)) {
  752. X        entry_font = bold_list_font;
  753. X        sprintf(scratch, "%s/", tmp->name);
  754. X    } else {
  755. X        entry_font = list_font;
  756. X        strcpy(scratch, tmp->name);
  757. X    }
  758. X
  759. X    xv_set(panel_list, 
  760. X        PANEL_LIST_INSERT, nitems,
  761. X        PANEL_LIST_STRING, nitems, scratch,
  762. X        PANEL_LIST_FONT, nitems, entry_font,
  763. X        PANEL_LIST_CLIENT_DATA, nitems, tmp,
  764. X        PANEL_PAINT, PANEL_NONE,
  765. X        NULL);
  766. X
  767. X    panel_paint(panel_list, PANEL_CLEAR);
  768. X    return tmp;
  769. }
  770. X
  771. #ifdef USE_PROTOTYPES
  772. void free_batchlist(Panel panel_list, int only_selected)
  773. #else
  774. void free_batchlist(panel_list, only_selected)
  775. Panel    panel_list;
  776. int        only_selected;
  777. #endif
  778. {
  779. X    int    nitems, row;
  780. X    struct batchlist *tmp;
  781. X
  782. X    nitems = xv_get(panel_list, PANEL_LIST_NROWS);
  783. X    for (row = nitems - 1; row >= 0; row--) {
  784. X        if (only_selected && 
  785. X            (xv_get(panel_list, PANEL_LIST_SELECTED, row) == FALSE))
  786. X            continue;
  787. X        tmp = (struct batchlist *)xv_get(panel_list, 
  788. X            PANEL_LIST_CLIENT_DATA, row);        
  789. X        if (only_selected)
  790. X            if (panel_list == schedule_window.receive_list)
  791. X                nreceiveitems--;
  792. X            else
  793. X                nsenditems--;
  794. X        free(tmp->name);
  795. X        free((char *)tmp);
  796. X        xv_set(panel_list,
  797. X            PANEL_LIST_DELETE, row,
  798. X            PANEL_PAINT, PANEL_NONE,
  799. X            NULL);
  800. X    }
  801. X    panel_paint(panel_list, PANEL_CLEAR);
  802. }
  803. X
  804. #ifdef USE_PROTOTYPES
  805. int batchentry_exists(Panel panel_list, char *name)
  806. #else
  807. int batchentry_exists(panel_list, name)
  808. Panel    panel_list;
  809. char    *name;
  810. #endif
  811. {
  812. X    int    nitems, row;
  813. X    struct batchlist *tmp;
  814. X
  815. X    nitems = xv_get(panel_list, PANEL_LIST_NROWS);
  816. X    for (row = 0; row < nitems; row++) {
  817. X        tmp = (struct batchlist *)xv_get(panel_list, 
  818. X            PANEL_LIST_CLIENT_DATA, row);
  819. X        if (!strcmp(tmp->name, name))
  820. X            return row;
  821. X    }
  822. X    return -1;
  823. }
  824. X
  825. #ifdef USE_PROTOTYPES
  826. void receive_list_delete_proc(void)
  827. #else
  828. void receive_list_delete_proc()
  829. #endif
  830. {
  831. X    free_batchlist(schedule_window.receive_list, 1);
  832. }
  833. X
  834. #ifdef USE_PROTOTYPES
  835. void send_list_delete_proc(void)
  836. #else
  837. void send_list_delete_proc()
  838. #endif
  839. {
  840. X    free_batchlist(schedule_window.send_list, 1);
  841. }
  842. X
  843. #ifdef USE_PROTOTYPES
  844. void dobatchget(void)
  845. #else
  846. void dobatchget()
  847. #endif
  848. {
  849. X    int     nitems, row;
  850. X    struct batchlist *tmp;
  851. X    int        rval;
  852. X    int        mode;
  853. X    int        dirchanged=0;
  854. X
  855. X    xfer_buttons_inactive();
  856. X    abort_transfer = 0;
  857. X    if (ping_server())
  858. X        goto out;
  859. X    if (show_status)
  860. X        xv_set(status_window.frame,
  861. X            XV_SHOW, TRUE,
  862. X            NULL);
  863. X    init_status(sum_remote_batch_size());
  864. X    settype((int)xv_get(host_window.advanced.transfer_mode, PANEL_VALUE));
  865. X    /* loop over each element, and do a get, then unselect */
  866. X    nitems = xv_get(schedule_window.receive_list, PANEL_LIST_NROWS);
  867. X    for (row = nitems - 1; row >= 0; row--) {
  868. X        tmp = (struct batchlist *)xv_get(schedule_window.receive_list, 
  869. X            PANEL_LIST_CLIENT_DATA, row);
  870. X        mode = tmp->mode & S_IFMT;
  871. X        if (non_unix) {
  872. X            /* we can't transfer whole dirs on non-unix machines */
  873. X            mode = S_IFREG;
  874. X        }
  875. X        switch(mode) {
  876. X        case S_IFDIR:
  877. X            if (rval = get_dir(remote_dircache.first->name, 
  878. X                local_dircache.first->name, tmp->name, tmp->name + 1)) {
  879. X                /* XXX? - fail or property here */
  880. X                /*
  881. X                if (rval == EEXIST) 
  882. X                    footer_message("%s already exists.", tmp->name, (char *)NULL);
  883. X                else
  884. X                    goto out;
  885. X                */
  886. X            }
  887. X            dirchanged++;
  888. X            break;
  889. X        case S_IFREG:
  890. X            if (rval = make_dirs(tmp->name + 1, 0)) {
  891. X            /* XXX? - fail or property here */
  892. X            /*
  893. X                goto out;
  894. X            */
  895. X            }
  896. X            if (get_file(tmp->name, tmp->name + 1, tmp->size))
  897. X                goto out;
  898. X            dirchanged++;
  899. X            break;
  900. X        case S_IFLNK:
  901. X            if (rval = make_dirs(tmp->name + 1, 0)) {
  902. X            /* XXX? - fail or property here */
  903. X            /*
  904. X                goto out;
  905. X            */
  906. X            }
  907. X            rval = get_file(tmp->name, tmp->name + 1, tmp->size);
  908. X            if (rval == EPERM) {
  909. X                if (rval = get_dir(remote_dircache.first->name, 
  910. X                    local_dircache.first->name, tmp->name, tmp->name + 1)) {
  911. X                /* XXX? - fail or property here */
  912. X                /*
  913. X                    if (rval == EEXIST) 
  914. X                        footer_message("%s already exists.", tmp->name, (char *)NULL);
  915. X                    else
  916. X                        goto out;
  917. X                */
  918. X                }
  919. X            } else if (rval != 0) {
  920. X                goto out;
  921. X            }
  922. X            dirchanged++;
  923. X            break;
  924. X        default:
  925. X            footer_message("Ignoring non-file/directory %s.", 
  926. X                tmp->name, (char *)NULL);
  927. X            log_message("Can only transfer files.\n");
  928. X            break;
  929. X        }
  930. X        free(tmp->name);
  931. X        free((char *)tmp);
  932. X        xv_set(schedule_window.receive_list,
  933. X            PANEL_LIST_DELETE, row,
  934. X            PANEL_PAINT, PANEL_NONE,
  935. X            NULL);
  936. X        panel_paint(schedule_window.receive_list, PANEL_CLEAR);
  937. X    }
  938. X
  939. out:
  940. X    if (dirchanged)
  941. X        change_local_dir(".", 1);
  942. X    if (show_status)
  943. X        xv_set(status_window.frame,
  944. X            XV_SHOW, FALSE,
  945. X            NULL);
  946. X    update_status_label("Not", "transferring", (size_t)0);
  947. X    end_status();
  948. X    xfer_buttons_active();
  949. X    if (timedout)
  950. X        timeout_disconnect();
  951. X    return;
  952. }
  953. X
  954. #ifdef USE_PROTOTYPES
  955. void dobatchput(void)
  956. #else
  957. void dobatchput()
  958. #endif
  959. {
  960. X    int     nitems, row;
  961. X    struct batchlist *tmp;
  962. X    int        rval = 0;
  963. X    int        mode;
  964. X    int        dirchanged=0;
  965. X
  966. X    xfer_buttons_inactive();
  967. X    abort_transfer = 0;
  968. X    if (ping_server())
  969. X        goto out;
  970. X    if (show_status)
  971. X        xv_set(status_window.frame,
  972. X            XV_SHOW, TRUE,
  973. X            NULL);
  974. X    init_status(sum_local_batch_size());
  975. X    settype((int)xv_get(host_window.advanced.transfer_mode, PANEL_VALUE));
  976. X
  977. X    /* loop over each element, and do a get, then unselect */
  978. X    nitems = xv_get(schedule_window.send_list, PANEL_LIST_NROWS);
  979. X    for (row = nitems-1; row >= 0; row--) {
  980. X        tmp = (struct batchlist *)xv_get(schedule_window.send_list, 
  981. X            PANEL_LIST_CLIENT_DATA, row);
  982. X        mode = tmp->mode & S_IFMT;
  983. X        if (non_unix) {
  984. X            /* we can't transfer whole dirs on non-unix machines */
  985. X            mode = S_IFREG;
  986. X        }
  987. X        switch(mode) {
  988. X        case S_IFDIR:
  989. X            dirchanged++;
  990. X            if (rval = put_dir(remote_dircache.first->name, 
  991. X                local_dircache.first->name, tmp->name + 1, tmp->name)) {
  992. X                /* XXX? - fail or property here */
  993. X                /*
  994. X                goto out;
  995. X                */
  996. X            }
  997. X            break;
  998. X        case S_IFREG:
  999. X            if (rval = make_remote_dirs(tmp->name + 1, 0)) {
  1000. X            /* XXX? - fail or property here */
  1001. X            /*
  1002. X                goto out;
  1003. X            */
  1004. X            }
  1005. X            dirchanged++;
  1006. X            if (rval = put_file(tmp->name, tmp->name+1, tmp->size))
  1007. X                goto out;
  1008. X            break;
  1009. X        case S_IFLNK:
  1010. X            if (rval = make_remote_dirs(tmp->name + 1, 0)) {
  1011. X            /* XXX? - fail or property here */
  1012. X            /*
  1013. X                goto out;
  1014. X            */
  1015. X            }
  1016. X            dirchanged++;
  1017. X            rval = put_file(tmp->name, tmp->name+1, tmp->size);
  1018. X            if (rval == EPERM) {
  1019. X                if (rval = put_dir(remote_dircache.first->name, 
  1020. X                    local_dircache.first->name, tmp->name + 1, tmp->name)) {
  1021. X                    /* XXX? - fail or property here */
  1022. X                    /*
  1023. X                    goto out;
  1024. X                    */
  1025. X                }
  1026. X            } else if (rval != 0) {
  1027. X                goto out;
  1028. X            }
  1029. X            break;
  1030. X        default:
  1031. X            local_footer_message("Ignoring non-file/directory %s.", 
  1032. X                tmp->name, (char *)NULL);
  1033. X            log_message("Can only transfer files.\n");
  1034. X            break;
  1035. X        }
  1036. X        free(tmp->name);
  1037. X        free((char *)tmp);
  1038. X        xv_set(schedule_window.send_list,
  1039. X            PANEL_LIST_DELETE, row,
  1040. X            PANEL_PAINT, PANEL_NONE,
  1041. X            NULL);
  1042. X        panel_paint(schedule_window.send_list, PANEL_CLEAR);
  1043. X    }
  1044. X
  1045. X
  1046. out:
  1047. X    if (dirchanged)
  1048. X        change_remote_dir(".", 1);
  1049. X    if (show_status)
  1050. X        xv_set(status_window.frame,
  1051. X            XV_SHOW, FALSE,
  1052. X            NULL);
  1053. X    update_status_label("Not", "transferring", (size_t)0);
  1054. X    end_status();
  1055. X    xfer_buttons_active();
  1056. X    if (rval == ENOSPC) {
  1057. X        disconnect();
  1058. X    }
  1059. X    if (timedout)
  1060. X        timeout_disconnect();
  1061. X    return;
  1062. }
  1063. X
  1064. #ifdef USE_PROTOTYPES
  1065. int save_batch_list(Panel list, char *filename)
  1066. #else
  1067. int save_batch_list(list, filename)
  1068. Panel    list;
  1069. char    *filename;
  1070. #endif
  1071. {
  1072. X    FILE    *fp;
  1073. X    int    isdir;
  1074. X    extern char *sys_errlist[];
  1075. X    int        nitems, row;
  1076. X    struct batchlist *tmp;
  1077. X    
  1078. X    if ((fp = fopen(filename, "w")) == NULL) {
  1079. X        footer_message("%s:%s", filename, sys_errlist[errno], (char *)NULL);
  1080. X        return 1;
  1081. X    }
  1082. X    /* save */
  1083. X    fprintf(fp, "#name:isdir:size\n");
  1084. X    nitems = xv_get(list, PANEL_LIST_NROWS);
  1085. X    for (row = 0; row < nitems; row++) {
  1086. X        tmp = (struct batchlist *)xv_get(list, 
  1087. X            PANEL_LIST_CLIENT_DATA, row);
  1088. X        isdir = 0;
  1089. X        if (S_ISDIR(tmp->mode))
  1090. X            isdir = 1;
  1091. X        fprintf(fp, "%s:%d:%d\n", tmp->name, isdir, tmp->size);
  1092. X    }
  1093. X    fclose(fp);
  1094. X    return 0;
  1095. }
  1096. X
  1097. #ifdef USE_PROTOTYPES
  1098. int load_batch_list(Panel list, char *filename)
  1099. #else
  1100. int load_batch_list(list, filename)
  1101. Panel    list;
  1102. char    *filename;
  1103. #endif
  1104. {
  1105. X    char    fname[MAXPATHLEN+1];
  1106. X    int    isdir;
  1107. X    size_t        size;
  1108. X    mode_t        mode;
  1109. X    int    ch;
  1110. X    FILE    *fp;
  1111. X    extern char *sys_errlist[];
  1112. X    
  1113. X    if ((fp = fopen(filename, "r")) == NULL) {
  1114. X        footer_message("%s:%s", filename, sys_errlist[errno], (char *)NULL);
  1115. X        return 1;
  1116. X    }
  1117. X    if (list == schedule_window.receive_list)
  1118. X        nreceiveitems = 0;
  1119. X    else
  1120. X        nsenditems = 0;
  1121. X    free_batchlist(list, 0);
  1122. X
  1123. X    /* load */
  1124. X    /*
  1125. X     Alias
  1126. X     host
  1127. X     login
  1128. X     encrypted password
  1129. X     */
  1130. X
  1131. X    for (;;) {
  1132. X        ch = getc(fp);
  1133. X        if (ch == EOF)
  1134. X            break;
  1135. X        if (ch == '#') {
  1136. X            while (((ch = getc(fp)) != '\n') && (ch != EOF))
  1137. X                /* null */ ;
  1138. X            continue;
  1139. X        } else
  1140. X            ungetc(ch, fp);
  1141. X        if (fscanf(fp,"%[^:]:%d:%d\n", fname, &isdir, &size) != 3) 
  1142. X            break;
  1143. X        mode = S_IFREG;
  1144. X        if (isdir)
  1145. X            mode = S_IFDIR;
  1146. X        if (add_batchname(list, fname, mode, size, (char *)NULL) == NULL)
  1147. X            return 1;
  1148. X    }
  1149. X    return 0;
  1150. }
  1151. SHAR_EOF
  1152. chmod 0644 batch.c ||
  1153. echo 'restore of batch.c failed'
  1154. Wc_c="`wc -c < 'batch.c'`"
  1155. test 10213 -eq "$Wc_c" ||
  1156.     echo 'batch.c: original size 10213, current size' "$Wc_c"
  1157. rm -f _shar_wnt_.tmp
  1158. fi
  1159. # ============= button_funcs.h ==============
  1160. if test -f 'button_funcs.h' -a X"$1" != X"-c"; then
  1161.     echo 'x - skipping button_funcs.h (File already exists)'
  1162.     rm -f _shar_wnt_.tmp
  1163. else
  1164. > _shar_wnt_.tmp
  1165. echo 'x - extracting button_funcs.h (Text)'
  1166. sed 's/^X//' << 'SHAR_EOF' > 'button_funcs.h' &&
  1167. #ifdef USE_PROTOTYPES
  1168. X
  1169. void    connect_proc(void);
  1170. void    local_properties(void);
  1171. void    remote_properties(void);
  1172. void    props_proc(void);
  1173. void    get_proc(void);
  1174. void    batchget_proc(void);
  1175. void    uncompress_proc(void);
  1176. void    compress_proc(void);
  1177. void    tar_proc(void);
  1178. void    create_tar_proc(void);
  1179. void    extract_proc(void);
  1180. void    put_proc(void);
  1181. void    batchput_proc(void);
  1182. void    remote_view(void);
  1183. void    local_view(void);
  1184. void    local_dir_view(void);
  1185. void    session_view(void);
  1186. void    status_view(void);
  1187. void    host_view(void);
  1188. void    schedule_view(void);
  1189. void    abort_proc(void);
  1190. int local_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1191. X    Panel_list_op op, Event *event);
  1192. int remote_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1193. X    Panel_list_op op, Event *event);
  1194. int send_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1195. X    Panel_list_op op,Event *event);
  1196. int receive_list_proc(Panel_item item, char *string, Xv_opaque client_data,
  1197. X    Panel_list_op op, Event *event);
  1198. void apply_changes(void);
  1199. void ftptool_props_apply_proc(void);
  1200. void directory_lists_props_apply_proc(void);
  1201. void viewers_props_apply_proc(void);
  1202. void ftptool_props_reset_proc(void);
  1203. void directory_lists_props_reset_proc(void);
  1204. void viewers_props_reset_proc(void);
  1205. void about_proc(void);
  1206. void    remote_sort_choice_proc(void);
  1207. void set_remote_sort_order(int val);
  1208. void    local_sort_choice_proc(void);
  1209. void set_local_sort_order(int val);
  1210. void    about_send_proc(void);
  1211. void    feedback_address_proc(Panel_item item, unsigned int value, 
  1212. X    Event *event);
  1213. void    feedback_send_proc(Panel_item item, Event *event);
  1214. void    feedback_cancel_proc(void);
  1215. Panel_setting    reject_spaces(Panel_item item, Event *event);
  1216. void    host_window_choice_proc(Panel_item item, unsigned int value, 
  1217. X    Event *event);
  1218. void    remote_delete_proc(void);
  1219. void    local_delete_proc(void);
  1220. void    show_load_receive_list_proc(void);
  1221. void    show_save_receive_list_proc(void);
  1222. void    show_load_send_list_proc(void);
  1223. void    show_save_send_list_proc(void);
  1224. void    load_send_list_proc(void);
  1225. void    save_send_list_proc(void);
  1226. void    load_receive_list_proc(void);
  1227. void    save_receive_list_proc(void);
  1228. void add_batch_send_proc(void);
  1229. void add_batch_receive_proc(void);
  1230. void    props_inf_check_box(Panel_item item, Event *event);
  1231. void    quit_proc(void);
  1232. void switch_category(int value, int show);
  1233. void category_proc(void);
  1234. void    dismiss_local_window(void);
  1235. void    dismiss_host_window(void);
  1236. void    dismiss_about_window(void);
  1237. void    dismiss_file_props_window(Panel_item item, Event *event);
  1238. void    dismiss_schedule_window(void);
  1239. void    dismiss_status_window(void);
  1240. void dir_list_proc(void);
  1241. void ls_list_proc(void);
  1242. void list_remote_dir(void);
  1243. void save_layout_func(void);
  1244. void local_doubleclick(struct dirlist *tmp);
  1245. void remote_doubleclick(void);
  1246. void plus_proc(void);
  1247. void minus_proc(void);
  1248. X
  1249. #else
  1250. X
  1251. void    connect_proc();
  1252. void    local_properties();
  1253. void    remote_properties();
  1254. void    props_proc();
  1255. void    get_proc();
  1256. void    batchget_proc();
  1257. void    uncompress_proc();
  1258. void    compress_proc();
  1259. void    tar_proc();
  1260. void    create_tar_proc();
  1261. void    extract_proc();
  1262. void    put_proc();
  1263. void    batchput_proc();
  1264. void    remote_view();
  1265. void    local_view();
  1266. void    local_dir_view();
  1267. void    session_view();
  1268. void    status_view();
  1269. void    host_view();
  1270. void    schedule_view();
  1271. void    abort_proc();
  1272. int local_list_proc();
  1273. int remote_list_proc();
  1274. int send_list_proc();
  1275. int receive_list_proc();
  1276. void apply_changes();
  1277. void ftptool_props_apply_proc();
  1278. void directory_lists_props_apply_proc();
  1279. void viewers_props_apply_proc();
  1280. void ftptool_props_reset_proc();
  1281. void directory_lists_props_reset_proc();
  1282. void viewers_props_reset_proc();
  1283. void about_proc();
  1284. void    remote_sort_choice_proc();
  1285. void set_remote_sort_order();
  1286. void    local_sort_choice_proc();
  1287. void set_local_sort_order();
  1288. void    about_send_proc();
  1289. void    feedback_address_proc();
  1290. void    feedback_send_proc();
  1291. void    feedback_cancel_proc();
  1292. Panel_setting    reject_spaces();
  1293. void    host_window_choice_proc();
  1294. void    remote_delete_proc();
  1295. void    local_delete_proc();
  1296. void    show_load_receive_list_proc();
  1297. void    show_save_receive_list_proc();
  1298. void    show_load_send_list_proc();
  1299. void    show_save_send_list_proc();
  1300. void    load_send_list_proc();
  1301. void    save_send_list_proc();
  1302. void    load_receive_list_proc();
  1303. void    save_receive_list_proc();
  1304. void add_batch_send_proc();
  1305. void add_batch_receive_proc();
  1306. void    props_inf_check_box();
  1307. void    quit_proc();
  1308. void switch_category();
  1309. void category_proc();
  1310. void    dismiss_local_window();
  1311. void    dismiss_host_window();
  1312. void    dismiss_about_window();
  1313. void    dismiss_file_props_window();
  1314. void    dismiss_schedule_window();
  1315. void    dismiss_status_window();
  1316. void dir_list_proc();
  1317. void ls_list_proc();
  1318. void list_remote_dir();
  1319. void save_layout_func();
  1320. void local_doubleclick();
  1321. void remote_doubleclick();
  1322. void plus_proc();
  1323. void minus_proc();
  1324. X
  1325. #endif
  1326. SHAR_EOF
  1327. chmod 0644 button_funcs.h ||
  1328. echo 'restore of button_funcs.h failed'
  1329. Wc_c="`wc -c < 'button_funcs.h'`"
  1330. test 4698 -eq "$Wc_c" ||
  1331.     echo 'button_funcs.h: original size 4698, current size' "$Wc_c"
  1332. rm -f _shar_wnt_.tmp
  1333. fi
  1334. # ============= dircache.c ==============
  1335. if test -f 'dircache.c' -a X"$1" != X"-c"; then
  1336.     echo 'x - skipping dircache.c (File already exists)'
  1337.     rm -f _shar_wnt_.tmp
  1338. else
  1339. > _shar_wnt_.tmp
  1340. echo 'x - extracting dircache.c (Text)'
  1341. sed 's/^X//' << 'SHAR_EOF' > 'dircache.c' &&
  1342. #include "ftptool.h"
  1343. X
  1344. #ifdef USE_PROTOTYPES
  1345. int dircache_add(struct dircache *dcache, char *name, struct dirlist *dlist)
  1346. #else
  1347. int dircache_add(dcache, name, dlist)
  1348. struct dircache *dcache;
  1349. char    *name;
  1350. struct dirlist *dlist;
  1351. #endif
  1352. {
  1353. X    struct dirlist_header *new_header;
  1354. X    struct dirlist_header *last;
  1355. X
  1356. X    if (dircache_size != 0 && dircache_size == dcache->ndirs) {
  1357. X        last = dcache->last;
  1358. X        if (dcache->ndirs == 1) {
  1359. X            dcache->first = NULL;
  1360. X            dcache->last = NULL;
  1361. X        } else {
  1362. X            dcache->last = dcache->last->prev;
  1363. X            dcache->last->next = NULL;
  1364. X        }
  1365. X        free_dirlist_header(last);
  1366. X        dcache->ndirs--;
  1367. X    }
  1368. X    new_header = new_dirlist_header(name, dlist);
  1369. X    if (new_header == NULL)
  1370. X        return ENOMEM;
  1371. X    if (dcache->ndirs == 0) {
  1372. X        dcache->first = new_header;
  1373. X        dcache->last = new_header;
  1374. X        new_header->next = NULL;
  1375. X        new_header->prev = NULL;
  1376. X    } else {
  1377. X        new_header->prev = NULL;
  1378. X        new_header->next = dcache->first;
  1379. X        dcache->first->prev = new_header;
  1380. X        dcache->first = new_header;
  1381. X    }
  1382. X
  1383. X    dcache->ndirs++;
  1384. X
  1385. X    return 0;
  1386. }
  1387. X
  1388. #ifdef USE_PROTOTYPES
  1389. void dircache_delete(struct dircache *dcache, char *name)
  1390. #else
  1391. void dircache_delete(dcache, name)
  1392. struct dircache *dcache;
  1393. char    *name;
  1394. #endif
  1395. {
  1396. X    struct dirlist_header *first;
  1397. X
  1398. X    if (cache_lookup(dcache, name) == NULL)
  1399. X        return;
  1400. X    /* now at top of list */
  1401. X    first = dcache->first;
  1402. X    if (dcache->ndirs == 1) {
  1403. X        dcache->first = NULL;
  1404. X        dcache->last = NULL;
  1405. X    } else {
  1406. X        dcache->first = first->next;
  1407. X        dcache->first->prev = NULL;
  1408. X    }
  1409. X    free_dirlist_header(first);
  1410. X
  1411. X    dcache->ndirs--;
  1412. X
  1413. X    return;
  1414. }
  1415. X
  1416. #ifdef USE_PROTOTYPES
  1417. void dircache_shrink(struct dircache *dcache, int newsize)
  1418. #else
  1419. void dircache_shrink(dcache, newsize)
  1420. struct dircache *dcache;
  1421. int    newsize;
  1422. #endif
  1423. {
  1424. X    struct dirlist_header *last;
  1425. X
  1426. X    if (newsize == 0) 
  1427. X        return;
  1428. X    while (dcache->ndirs > newsize) {
  1429. X        last = dcache->last;
  1430. X        dcache->last = dcache->last->prev;
  1431. X        dcache->last->next = NULL;
  1432. X        free_dirlist_header(last);
  1433. X        dcache->ndirs--;
  1434. X    } 
  1435. }
  1436. X
  1437. #ifdef USE_PROTOTYPES
  1438. void free_dircache(struct dircache *dcache)
  1439. #else
  1440. void free_dircache(dcache)
  1441. struct dircache *dcache;
  1442. #endif
  1443. {
  1444. X    struct dirlist_header *next;
  1445. X    struct dirlist_header *tmp;
  1446. X
  1447. X    for (tmp = dcache->first; tmp != NULL;) {
  1448. X        next = tmp->next;
  1449. X        free_dirlist_header(tmp);
  1450. X        tmp = next;
  1451. X    }
  1452. X    dcache->ndirs = 0;
  1453. X    dcache->first = NULL;
  1454. X    dcache->last = NULL;
  1455. }
  1456. X
  1457. #ifdef USE_PROTOTYPES
  1458. struct dirlist *cache_lookup(struct dircache *dcache, char *dirname)
  1459. #else
  1460. struct dirlist *cache_lookup(dcache, dirname)
  1461. struct dircache *dcache;
  1462. char    *dirname;
  1463. #endif
  1464. {
  1465. X    struct dirlist_header *tmp;
  1466. X
  1467. X    for (tmp = dcache->first; tmp != NULL; tmp=tmp->next) 
  1468. X        if (!strcmp(tmp->name, dirname)) {
  1469. X            /* match! move to top of cache */
  1470. X            if (tmp == dcache->first) {
  1471. X                /* nothing to do */
  1472. X                return tmp->dlist;
  1473. X            } else if (tmp == dcache->last) {
  1474. X                /* at least 2 */
  1475. X                /* off list */
  1476. X                dcache->last = dcache->last->prev;
  1477. X                dcache->last->next = NULL;
  1478. X            } else {
  1479. X                /* in the middle */
  1480. X                /* off list */
  1481. X                tmp->prev->next = tmp->next;
  1482. X                tmp->next->prev = tmp->prev;
  1483. X            }
  1484. X            /* now add to front */
  1485. X            tmp->next = dcache->first;
  1486. X            tmp->prev = NULL;
  1487. X            dcache->first->prev = tmp;
  1488. X            dcache->first = tmp;
  1489. X            
  1490. X            return tmp->dlist;
  1491. X        }
  1492. X    /* no match */
  1493. X    return NULL;
  1494. }
  1495. X
  1496. #ifdef USE_PROTOTYPES
  1497. struct dirlist_header *new_dirlist_header(char *name, struct dirlist *dlist)
  1498. #else
  1499. struct dirlist_header *new_dirlist_header(name, dlist)
  1500. char    *name;
  1501. struct dirlist *dlist;
  1502. #endif
  1503. {
  1504. X    struct dirlist_header *tmp;
  1505. X
  1506. X    tmp = (struct dirlist_header *)malloc(sizeof(struct dirlist_header));
  1507. X    if (tmp == NULL)
  1508. X        return NULL;
  1509. X    bzero((char *)tmp, sizeof(struct dirlist_header));
  1510. X    tmp->name = strdup(name);
  1511. X    if (tmp->name == NULL) {
  1512. X        free((char *)tmp);
  1513. X        return NULL;
  1514. X    }
  1515. X    tmp->next = NULL;
  1516. X    tmp->prev = NULL;
  1517. X    tmp->dlist = dlist;
  1518. X    return tmp;
  1519. }
  1520. X
  1521. #ifdef USE_PROTOTYPES
  1522. void free_dirlist_header(struct dirlist_header *head)
  1523. #else
  1524. void free_dirlist_header(head)
  1525. struct dirlist_header *head;
  1526. #endif
  1527. {
  1528. X    free_dirlist(head->dlist);
  1529. X    free(head->name);
  1530. X    free((char *)head);
  1531. }
  1532. X
  1533. #ifdef notdef
  1534. X
  1535. #ifdef USE_PROTOTYPES
  1536. void show_dircache(struct dircache *dcache)
  1537. #else
  1538. void show_dircache(dcache)
  1539. struct dircache *dcache;
  1540. #endif
  1541. {
  1542. X    struct dirlist_header *tmp;
  1543. X
  1544. X    printf("cache contains\n");
  1545. X    printf("--------------\n");
  1546. X    for (tmp = dcache->first; tmp != NULL; tmp=tmp->next) {
  1547. X        printf("%s\n", tmp->name);
  1548. X    }
  1549. X    printf("--------------\n");
  1550. }
  1551. X
  1552. #endif
  1553. SHAR_EOF
  1554. chmod 0644 dircache.c ||
  1555. echo 'restore of dircache.c failed'
  1556. Wc_c="`wc -c < 'dircache.c'`"
  1557. test 4331 -eq "$Wc_c" ||
  1558.     echo 'dircache.c: original size 4331, current size' "$Wc_c"
  1559. rm -f _shar_wnt_.tmp
  1560. fi
  1561. # ============= ftp_var.h ==============
  1562. if test -f 'ftp_var.h' -a X"$1" != X"-c"; then
  1563.     echo 'x - skipping ftp_var.h (File already exists)'
  1564.     rm -f _shar_wnt_.tmp
  1565. else
  1566. > _shar_wnt_.tmp
  1567. echo 'x - extracting ftp_var.h (Text)'
  1568. sed 's/^X//' << 'SHAR_EOF' > 'ftp_var.h' &&
  1569. /*
  1570. X * Copyright (c) 1985, 1989 Regents of the University of California.
  1571. X * All rights reserved.
  1572. X *
  1573. X * Redistribution and use in source and binary forms, with or without
  1574. X * modification, are permitted provided that the following conditions
  1575. X * are met:
  1576. X * 1. Redistributions of source code must retain the above copyright
  1577. X *    notice, this list of conditions and the following disclaimer.
  1578. X * 2. Redistributions in binary form must reproduce the above copyright
  1579. X *    notice, this list of conditions and the following disclaimer in the
  1580. X *    documentation and/or other materials provided with the distribution.
  1581. X * 3. All advertising materials mentioning features or use of this software
  1582. X *    must display the following acknowledgement:
  1583. X *    This product includes software developed by the University of
  1584. X *    California, Berkeley and its contributors.
  1585. X * 4. Neither the name of the University nor the names of its contributors
  1586. X *    may be used to endorse or promote products derived from this software
  1587. X *    without specific prior written permission.
  1588. X *
  1589. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1590. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1591. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1592. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1593. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1594. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1595. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1596. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1597. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1598. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1599. X * SUCH DAMAGE.
  1600. X */
  1601. X
  1602. #define strerror(e) sys_errlist[e]
  1603. extern char *sys_errlist[];
  1604. X
  1605. #ifdef USE_PROTOTYPES
  1606. X
  1607. int ftp_hookup(char *host, int port);
  1608. int ftp_login(char *user, char *pass);
  1609. int command(char *fmt, ...);
  1610. int command_dataconn(FILE **a_file, char *lmode, char *fmt, ...);
  1611. int getreply(int expecteof);
  1612. int empty(fd_set *mask, int sec);
  1613. int sendrequest(char *cmd, char *local, char *remote, size_t size);
  1614. int recvrequest(char *cmd, char *local, char *remote, 
  1615. X    char *lmode, size_t size);
  1616. int initconn(void);
  1617. FILE *dataconn(char *lmode);
  1618. char *gunique(char *local);
  1619. void abort_remote(FILE *din);
  1620. void lostpeer(void);
  1621. FILE *open_remote_ls(int nlst);
  1622. char *next_remote_line(FILE *din);
  1623. void close_remote_ls(FILE *din);
  1624. void settype(int type);
  1625. X
  1626. #else
  1627. X
  1628. int ftp_hookup();
  1629. int ftp_login();
  1630. int command();
  1631. int command_dataconn();
  1632. int getreply();
  1633. int empty();
  1634. int sendrequest();
  1635. int recvrequest();
  1636. int initconn();
  1637. FILE *dataconn();
  1638. char *gunique();
  1639. void abort_remote();
  1640. void lostpeer();
  1641. FILE *open_remote_ls();
  1642. char *next_remote_line();
  1643. void close_remote_ls();
  1644. void settype();
  1645. X
  1646. #endif
  1647. SHAR_EOF
  1648. chmod 0644 ftp_var.h ||
  1649. echo 'restore of ftp_var.h failed'
  1650. Wc_c="`wc -c < 'ftp_var.h'`"
  1651. test 2888 -eq "$Wc_c" ||
  1652.     echo 'ftp_var.h: original size 2888, current size' "$Wc_c"
  1653. rm -f _shar_wnt_.tmp
  1654. fi
  1655. # ============= ftptool.h ==============
  1656. if test -f 'ftptool.h' -a X"$1" != X"-c"; then
  1657.     echo 'x - skipping ftptool.h (File already exists)'
  1658.     rm -f _shar_wnt_.tmp
  1659. else
  1660. > _shar_wnt_.tmp
  1661. echo 'x - extracting ftptool.h (Text)'
  1662. sed 's/^X//' << 'SHAR_EOF' > 'ftptool.h' &&
  1663. /*
  1664. X Ftptool - written by Mike Sullivan
  1665. X
  1666. X The more I add, the nastier it gets. I used to _like_ this code,
  1667. X and I usually _hate_ using globals.
  1668. X */
  1669. X
  1670. #include <stdio.h>
  1671. #include <errno.h>
  1672. #include <math.h>
  1673. X
  1674. #include <X11/Xos.h>
  1675. #include <X11/Xlib.h>
  1676. #include <X11/Xatom.h>
  1677. #include <X11/Xresource.h>
  1678. X
  1679. #ifndef LINT
  1680. #include <unistd.h>
  1681. #endif
  1682. X
  1683. #include <sys/param.h>
  1684. #include <sys/stat.h>
  1685. X
  1686. #if defined(SYSV) || defined(SYSV386)
  1687. #include <sys/statvfs.h>
  1688. #else
  1689. #    ifdef ultrix
  1690. #    include <sys/mount.h>
  1691. #    include <nfs/nfs_clnt.h>
  1692. #    include <nfs/vfs.h>
  1693. #    else
  1694. #    include <sys/vfs.h>
  1695. #    endif
  1696. #endif
  1697. X
  1698. #include <termios.h>
  1699. #include <signal.h>
  1700. #include <sys/socket.h>
  1701. #include <netinet/in.h>
  1702. #include <netinet/in_systm.h>
  1703. #include <netinet/ip.h>
  1704. #include <arpa/ftp.h>
  1705. #include <arpa/telnet.h>
  1706. #include <arpa/inet.h>
  1707. #include <netdb.h>
  1708. #include <malloc.h>
  1709. #include <dirent.h>
  1710. #include <xview/xview.h>
  1711. #include <xview/panel.h>
  1712. #include <xview/notice.h>
  1713. #include <xview/textsw.h>
  1714. #include <xview/font.h>
  1715. #include <xview/canvas.h>
  1716. #include <xview/xv_xrect.h>
  1717. #include <xview/cursor.h>
  1718. #include <xview/defaults.h>
  1719. #include <pwd.h>
  1720. #include <grp.h>
  1721. #include <setjmp.h>
  1722. #include <stdlib.h>
  1723. #include <string.h>
  1724. #include <time.h>
  1725. #include <ctype.h>
  1726. X
  1727. #if !defined(XVIEW2) && !defined(XVIEW3)
  1728. #    ifdef FRAME_CMD_PIN_STATE
  1729. #    define XVIEW3
  1730. #    else
  1731. #    define XVIEW2
  1732. #    endif
  1733. #endif
  1734. X
  1735. #if defined(XVIEW2)
  1736. #undef XVIEW3
  1737. #endif
  1738. X
  1739. #if defined(XVIEW3)
  1740. #undef XVIEW2
  1741. #endif
  1742. X
  1743. #ifndef USE_PROTOTYPES
  1744. extern time_t time();
  1745. #endif
  1746. X
  1747. #include "config.h"
  1748. X
  1749. #ifdef USE_PROTOTYPES
  1750. #include <stdarg.h>
  1751. #else
  1752. #include <varargs.h>
  1753. #endif
  1754. X
  1755. struct file_property_window; /* for prototypes */
  1756. X
  1757. #include "batch_struct.h"
  1758. #include "dircache_struct.h"
  1759. #include "dirlist_struct.h"
  1760. #include "host_list_struct.h"
  1761. #include "schedule_struct.h"
  1762. X
  1763. #include "batch.h"
  1764. #include "button_funcs.h"
  1765. #include "change_dir.h"
  1766. #include "create_main.h"
  1767. #include "create_other.h"
  1768. #include "dircache.h"
  1769. #include "dirlist.h"
  1770. #include "dofuncs.h"
  1771. #include "event.h"
  1772. #include "ftp_var.h"
  1773. #include "host_list.h"
  1774. #include "main.h"
  1775. #include "menu_funcs.h"
  1776. #include "misc.h"
  1777. #include "patchlevel.h"
  1778. #include "readdir.h"
  1779. #include "schedule.h"
  1780. #include "tar_view.h"
  1781. #include "transfer.h"
  1782. #include "view_file.h"
  1783. X
  1784. extern char *getwd();
  1785. X
  1786. #ifndef EXTERN
  1787. #define EXTERN extern
  1788. #endif
  1789. X
  1790. /*
  1791. X * Global object definitions.
  1792. X */
  1793. X
  1794. EXTERN Icon    frame_icon;
  1795. EXTERN Display *dpy;
  1796. EXTERN int    display_width;
  1797. EXTERN int    display_height;
  1798. X
  1799. #define MAXGEOMETRYSIZE 20
  1800. X
  1801. EXTERN struct dircache local_dircache;
  1802. EXTERN struct dircache remote_dircache;
  1803. EXTERN int dircache_size;
  1804. EXTERN char *which_remote_file;
  1805. EXTERN mode_t which_remote_mode;
  1806. EXTERN size_t which_remote_size;
  1807. X
  1808. EXTERN struct schedule schedule_list;
  1809. X
  1810. struct base_window {
  1811. X    Frame    frame;
  1812. X    Panel    panel;
  1813. X    Panel_item file;
  1814. X    Panel_item view;
  1815. X    Panel_item props;
  1816. X    Panel_item connect;
  1817. X    Panel_item abort;
  1818. X    Panel_item quit;    /* for non-OPEN LOOK window managers */
  1819. X    Panel_item directory;
  1820. X    Panel_item list;
  1821. X    char    geometry[MAXGEOMETRYSIZE];
  1822. };
  1823. X
  1824. EXTERN struct base_window base_window;
  1825. X
  1826. struct host_window {
  1827. X    Frame    frame;
  1828. X    Panel    panel;
  1829. X    Panel_item    new;
  1830. X    Panel_item    anonymous;
  1831. X    Panel_item    hosts;
  1832. X    Panel_item    host_list_ops;
  1833. X    struct {
  1834. X        Panel    panel;
  1835. X        Panel_item    host;
  1836. X        Panel_item    login;
  1837. X        Panel_item    password;
  1838. X        Panel_item    dismiss;    /* for non-OPEN LOOK window managers */
  1839. X        Panel_item  connect;
  1840. X        Panel_item    plus;
  1841. X    } basic;
  1842. X    struct {
  1843. X        Panel    panel;
  1844. X        Panel_item    alias;
  1845. X        Panel_item    last_visited;
  1846. X        Panel_item    comment;
  1847. X        Panel_item    proxy;
  1848. X        Panel_item    transfer_mode;
  1849. X        Panel_item    remote_auto_cd;
  1850. X        Panel_item    local_auto_cd;
  1851. X        Panel_item    dir_parse;
  1852. X        Panel_item    minus;
  1853. X        int        visible;
  1854. X    } advanced;
  1855. X    int        visible;
  1856. X    char    geometry[MAXGEOMETRYSIZE];
  1857. };
  1858. X
  1859. EXTERN struct host_window host_window;
  1860. X
  1861. struct local_window {
  1862. X    Frame    frame;
  1863. X    Panel    panel;
  1864. X    Panel_item    directory;
  1865. X    Panel_item    space;
  1866. X    Panel_item    list;
  1867. X    Panel_item    dismiss;    /* for non-OPEN LOOK window managers */
  1868. X    int        visible;
  1869. X    char    geometry[MAXGEOMETRYSIZE];
  1870. };
  1871. X
  1872. EXTERN struct local_window local_window;
  1873. X
  1874. struct status_window {
  1875. X    Frame    frame;
  1876. X    Panel    panel;
  1877. X    Panel_item message;
  1878. X    Panel_item size;
  1879. #ifdef notdef
  1880. X    Panel_item file_gauge;
  1881. #endif
  1882. X    Panel_item total_gauge;
  1883. X    Panel_item dismiss;    /* for non-OPEN LOOK window managers */
  1884. X    int        visible;
  1885. X    char    geometry[MAXGEOMETRYSIZE];
  1886. };
  1887. X
  1888. EXTERN struct status_window status_window;
  1889. X
  1890. struct session_window {
  1891. X    Frame    frame;
  1892. X    Panel    panel;
  1893. X    Textsw    log;
  1894. X    char    geometry[MAXGEOMETRYSIZE];
  1895. };
  1896. X
  1897. EXTERN struct session_window session_window;
  1898. X
  1899. struct tool_property_window {
  1900. X    Frame    frame;
  1901. X    Panel    panel;
  1902. X    Textsw    log;
  1903. X    Panel_item category;
  1904. X    struct {
  1905. X        Panel panel;
  1906. X        Panel_item options;
  1907. X        Panel_item unique;
  1908. X        Panel_item automatic;
  1909. X        Panel_item openlook;
  1910. X        Panel_item anonftp;
  1911. X        Panel_item confirm;
  1912. X        Panel_item ignore_case;
  1913. X        Panel_item apply;
  1914. X    } ftptool;
  1915. X    struct {
  1916. X        Panel panel;
  1917. X        Panel_item cache;
  1918. X        Panel_item cache_inf;
  1919. X        Panel_item remote_sort;
  1920. X        Panel_item remote_sortdir;
  1921. X        Panel_item remote_dotfiles;
  1922. X        Panel_item remote_group;
  1923. X        Panel_item local_sort;
  1924. X        Panel_item local_sortdir;
  1925. X        Panel_item local_group;
  1926. X        Panel_item local_dotfiles;
  1927. X        Panel_item apply;
  1928. X    } directory_lists;
  1929. X    struct {
  1930. X        Panel panel;
  1931. X        Panel_item viewer;
  1932. X        Panel_item archive;
  1933. X        Panel_item postscript;
  1934. X        Panel_item apply;
  1935. X    } viewers;
  1936. X    Panel_button_item apply;
  1937. };
  1938. X
  1939. EXTERN struct tool_property_window tool_property_window;
  1940. X
  1941. struct file_property_window    {
  1942. X    Frame    frame;
  1943. X    Panel    panel;
  1944. X    Panel_item filename;
  1945. X    Panel_item owner;
  1946. X    Panel_item group;
  1947. X    Panel_item modtime;
  1948. X    Panel_item size;
  1949. X    Panel_item type;
  1950. X    Panel_item perms_message;
  1951. SHAR_EOF
  1952. true || echo 'restore of ftptool.h failed'
  1953. fi
  1954. echo 'End of  part 2'
  1955. echo 'File ftptool.h is continued in part 3'
  1956. echo 3 > _shar_seq_.tmp
  1957. exit 0
  1958. -- 
  1959. Senior Systems Scientist        mail: dcmartin@msi.com
  1960. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1961. 796 North Pastoria Avenue        at&t: 408/522-9236
  1962. Sunnyvale, California 94086        fax: 408/732-0831
  1963.