eudora-mac/linkmng.c

1 line
82 KiB
C
Raw Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "linkmng.h" #define FILE_NUM 128 /* Copyright (c) 1999 by QUALCOMM Incorporated */ /************************************************************************ * routines to manage multiple link history lists ************************************************************************/ #include "linkmng.h" #define FILE_NUM 128 #define LINK_HISTORY_VERSION 4 // increment this when changing the HistoryStruct #define LINK_TOC_TYPE 'LToc' #define LINK_RESID 130 // until ListView is taught about items with names > 31 characters typedef Str31 URLNameStr; // // Data structures for link management // /* LinkTypeEnum - types of links stored in the link history */ typedef enum { ltAd=0, ltHttp, ltFtp, ltMail, ltDirectoryServices, ltSetting, ltFile, LinkTypeLimit } LinkTypeEnum; /* LinkLabelEnum - labels for links */ typedef enum { llRemindMe=1, llBookmarked, llAttempted, llNone, llNotDisplayed, LinkLabelLimit } LinkLabelEnum; /* Structure for a given history entry, version 1 */ typedef struct { short version; /* the version of the link history entry */ long hashName; /* hash value on history name */ URLNameStr name; /* the name of the url */ unsigned long cacheSeconds; /* date this url was last clicked */ LinkTypeEnum type; /* the type of url this is */ long dirty:1; /* has the history entry been modified */ long deleted:1; /* has the history entry been deleted */ long thumb:1; /* does this history entry have a thumbnail */ long label:4; /* label */ long incompleteAd:1; /* this entry is an ad that's not ready yo be displayed in the history */ long remind:1; /* remind the user to visit this link */ long spare:23; /* leftovers */ long urlOffset; /* offset in file where the real url is at */ long imageOffset; /* offset in file where the location of the icon is at */ Handle hUrl; /* Handle to URL this entry will link to */ AdId adId; /* ID of Ad this entry refers to */ } HistoryStruct, *HistoryStructPtr, **HistoryStructHandle; /* Structure to keep track of an infividual history file */ typedef struct HistoryDStruct { FSSpec spec; /* the history file */ HistoryStructHandle theData; /* the toc */ Boolean ro; /* read only */ Boolean dirty; /* is the history file dirty? */ } HistoryDesc, *HistoryDPtr, **HistoryDHandle; /* Structure just enough inf