eudora-mac/register.c

1 line
28 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. */ // Copyright <20> 1996 by QUALCOMM Incorporated #define FILE_NUM 79 #include <gestalt.h> #include "register.h" extern Boolean HaveOT(void); OSErr GatherInfo(AccuPtr accu,short vRef,long dirId); OSErr GetTCPVersion(UPtr versionStr); void DoMonitorInfo(AccuPtr accu); #ifndef NAG //The registration screen is the same in the demo as in light. #if defined(LIGHT)||defined(DEMO) #define LIGHT_REG #endif #define REGISTRATION_DIALOG 20050 OSErr RegisterEudora(void); void SetDialogFontAndSize(DialogPtr theDialog, short fontNum, short fontSize); uLong RegVers(void); void CountryPopup(DialogPtr dlog,short top,short left); #ifndef LIGHT_REG Boolean RegNumValid(Str255 num); #endif //LIGHT_REG void EnterRegValues(DialogPtr dlog,long ***itemsHandle); void SuckRegValues(DialogPtr dlog,long **itemsHandle); enum { REGISTER_BUTTON = 1, ASK_LATER_BUTTON, NEVER_REGISTER_BUTTON, TEXT_PICT, FIRST_NAME_ITEM, LAST_NAME, COMPANY_NAME, TITLE, ADDRESS1, ADDRESS2, CITY, STATE, ZIP_CODE, COUNTRY, PHONE, FAX, // EMAIL, #ifndef LIGHT_REG //Pro-only reg fields REG_NUMBER, JUNKMAIL_CHECKBOX, PART_NUMBER, #else //LIGHT_REG Light/Demo reg fields USE_POPUP, DECISION_MAKER_POPUP, #endif //LIGHT_REG COUNTRY_POPUP=21, } DIALOG_ITEMS; #pragma segment Main /********************************************************************** * **********************************************************************/ void AutoRegister(void) { uLong oldReg = GetPrefLong(PREF_REGISTER); uLong oldVers = GetPrefLong(PREF_REG_VERS); Boolean registered = (oldReg&4)!=0; Boolean sentAndRcvd = (oldReg&3)==3; Boolean regWithOld = (oldVers||MAJOR_VERSION>3)&&oldVers<RegVers(); uLong lastRegAge = GMTDateTime()-(oldReg&~0xf); #ifdef DEBUG #define TRY_AGAIN (RunType==Debugging ? 20 : (3600L*24*7)) #else #define TRY_AGAIN 3600L*24*7 /* non-debug try again in a week */ #endif if (oldReg == 0x0fffffff) return; // never register! if ((!registered || regWithOld) && sentAndRcvd && lastRegAge>TRY_AGAIN) RegisterEudoraHi(); if (registered && !oldVers) SetPrefLong(PREF_REG_VERS,RegVers()); } /********************************************************************** * **********************************************************************/ uLong RegVers(void) { uLong nowVers = MAJOR_VERSION; #ifndef LIGHT nowVers *= 100; #ifndef DEMO nowVers += 1; #endif #endif return(nowVers); } #pragma segment Register /***************