1 /* bookmark.h
2  *
3  * Copyright (c) 1992-2001 by Mike Gleason.
4  * All rights reserved.
5  *
6  */
7 
8 typedef struct Bookmark *BookmarkPtr;
9 typedef struct Bookmark {
10 	char				bookmarkName[16];
11 	char				name[64];
12 	char				user[64];
13 	char				pass[64];
14 	char				acct[64];
15 	char				dir[160];
16 	char				ldir[160];
17 	int				xferType;
18 	unsigned int			port;
19 	time_t				lastCall;
20 	int				hasSIZE;
21 	int				hasMDTM;
22 	int				hasPASV;
23 	int				isUnix;
24 	char				lastIP[32];
25 	char				comment[128];
26 	int				xferMode;
27 	int				hasUTIME;
28 
29 	int				deleted;
30 } Bookmark;
31 
32 #define kBookmarkVersion		8
33 #define kBookmarkMinVersion		3
34 #if defined(WIN32) || defined(_WINDOWS)
35 #	define kBookmarkFileName		"bookmarks.txt"
36 #else
37 #	define kBookmarkFileName		"bookmarks"
38 #endif
39 #define kTmpBookmarkFileName		"bookmarks-tmp"
40 #define kOldBookmarkFileName		"hosts"
41 #define kBookmarkBupFileName		"bookmarks.old"
42 
43 #define BMTINDEX(p) ((int) ((char *) p - (char *) gBookmarkTable) / (int) sizeof(Bookmark))
44 
45 /* bookmark.c */
46 void BookmarkToURL(BookmarkPtr, char *, size_t);
47 void SetBookmarkDefaults(BookmarkPtr);
48 int ParseHostLine(char *, BookmarkPtr);
49 void CloseBookmarkFile(FILE *);
50 FILE *OpenBookmarkFile(int *);
51 FILE *OpenTmpBookmarkFile(int);
52 int SaveBookmarkTable(void);
53 int GetNextBookmark(FILE *, Bookmark *);
54 int GetBookmark(const char *const, Bookmark *);
55 int PutBookmark(Bookmark *, int);
56 int LoadBookmarkTable(void);
57 BookmarkPtr SearchBookmarkTable(const char *);
58 void SortBookmarks(void);
59 void DefaultBookmarkName(char *, size_t, char *);
60