diff options
author | Alexandra Ellwood <lxs@mit.edu> | 2003-03-06 18:41:58 +0000 |
---|---|---|
committer | Alexandra Ellwood <lxs@mit.edu> | 2003-03-06 18:41:58 +0000 |
commit | 86251dc01f3cccbbaa60338585231a99ec1cca84 (patch) | |
tree | 85e808f2c300e27b5d9a0fd11299ff3dbded1df6 /src | |
parent | 416d9a774090ee78c30a844025887bd2b9e79d16 (diff) | |
download | krb5-86251dc01f3cccbbaa60338585231a99ec1cca84.tar.gz krb5-86251dc01f3cccbbaa60338585231a99ec1cca84.tar.xz krb5-86251dc01f3cccbbaa60338585231a99ec1cca84.zip |
* com_err.c, com_err.h, error_message.c, et_c.awk, et_h.awk: Removed Mac OS 9-specific code. * et_h.awk: define compat macro for init_foo_err_table so that it gets defined to nothing on the Mac
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15238 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/util/et/ChangeLog | 6 | ||||
-rw-r--r-- | src/util/et/com_err.c | 97 | ||||
-rw-r--r-- | src/util/et/com_err.h | 15 | ||||
-rw-r--r-- | src/util/et/error_message.c | 23 | ||||
-rw-r--r-- | src/util/et/et_c.awk | 4 | ||||
-rw-r--r-- | src/util/et/et_h.awk | 11 |
6 files changed, 17 insertions, 139 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 2810fd0395..1aaaf6ca23 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,9 @@ +2003-03-06 Alexandra Ellwood <lxs@mit.edu> + * com_err.c, com_err.h, error_message.c, et_c.awk, et_h.awk: + Removed Mac OS 9-specific code. + * et_h.awk: define compat macro for init_foo_err_table + so that it gets defined to nothing on the Mac. + 2003-01-10 Ken Raeburn <raeburn@mit.edu> * configure.in: Don't explicitly invoke AC_PROG_INSTALL, diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c index ef03d1232f..59db443456 100644 --- a/src/util/et/com_err.c +++ b/src/util/et/com_err.c @@ -28,17 +28,13 @@ #if defined(_WIN32) #include <io.h> #endif -#ifdef macintosh -#include "icons.h" -static void MacMessageBox(char *errbuf); -#endif static /*@null@*/ et_old_error_hook_func com_err_hook = 0; static void default_com_err_proc (const char *whoami, errcode_t code, const char *fmt, va_list ap) { -#if defined(_WIN32) || defined(macintosh) +#if defined(_WIN32) char errbuf[1024] = ""; @@ -57,9 +53,6 @@ static void default_com_err_proc (const char *whoami, errcode_t code, vsprintf (errbuf + strlen (errbuf), fmt, ap); errbuf[sizeof(errbuf) - 1] = '\0'; -#ifdef macintosh - MacMessageBox(errbuf); -#else #ifdef _WIN32 if (_isatty(_fileno(stderr))) { fputs(errbuf, stderr); @@ -69,9 +62,8 @@ static void default_com_err_proc (const char *whoami, errcode_t code, } else #endif /* _WIN32 */ MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION); -#endif /* macintosh */ -#else /* !_WIN32 && !macintosh */ +#else /* !_WIN32 */ if (whoami) { fputs(whoami, stderr); @@ -132,88 +124,3 @@ et_old_error_hook_func reset_com_err_hook () return x; } #endif - -#ifdef macintosh -static void MacMessageBox(errbuf) - char *errbuf; -{ - WindowPtr errWindow; - ControlHandle errOkButton; - Rect errOkButtonRect = { 120, 220, 140, 280 }; - Rect errRect = { 0, 0, 150, 300 }; - GDHandle mainDevice = GetMainDevice(); - Rect mainRect = (**mainDevice).gdRect; - Rect tmpRect; - Rect errTextRect = { 10, 70, 110, 290 }; - Rect errIconRect = { 10, 10, 10 + 32, 10 + 32 }; - EventRecord theEvent; - Point localPt; - Boolean done; - long gestaltResult; - OSErr theError; - - /* Find Centered rect for window */ - tmpRect.top = ((mainRect.bottom + mainRect.top)/2 - - (errRect.bottom + errRect.top)/2); - tmpRect.bottom = tmpRect.top + (errRect.bottom - errRect.top); - tmpRect.left = ((mainRect.right + mainRect.left)/2 - - (errRect.right + errRect.left)/2); - tmpRect.right = tmpRect.left + (errRect.right - errRect.left); - - /* Create the error window - as a dialog window */ - /* First check if we have color QuickDraw */ - /* (we can assume we have Gestalt because we are on system 7) */ - theError = Gestalt (gestaltQuickdrawFeatures, &gestaltResult); - if ((theError == noErr) && (gestaltResult & (1 << gestaltHasColor) != 0)) - errWindow = NewCWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L); - else - errWindow = NewWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L); - - SetPort(errWindow); - TextFont(systemFont); - TextSize(12); - - errOkButton = NewControl(errWindow, &errOkButtonRect, - "\pOk", TRUE, 0, 0, 1, pushButProc, 0L); - DrawControls(errWindow); - InsetRect(&errOkButtonRect, -4, -4); - PenSize(3,3); - FrameRoundRect(&errOkButtonRect, 15,15); - PenSize(1,1); - InsetRect(&errOkButtonRect, 4, 4); - - /* Draw the error text */ - TETextBox(errbuf, strlen(errbuf), &errTextRect, teForceLeft); - - /* Draw the Stop icon */ - PlotIcon(&errIconRect, GetResource('ICON', 0)); - - /* mini event loop here */ - done = FALSE; - while(!done) { - WaitNextEvent(mDownMask | mUpMask | keyDownMask, &theEvent, 15, nil); - if (theEvent.what == mouseDown) { - localPt = theEvent.where; - GlobalToLocal(&localPt); - if (TestControl(errOkButton, localPt) && - TrackControl(errOkButton, localPt, NULL)) { - done = TRUE; - } - } else if (theEvent.what == keyDown && - (theEvent.message & 0xff) == 0x0d || /* CR */ - (theEvent.message & 0xff) == 0x03 || /* Enter */ - (theEvent.message & 0xff) == 0x1b) { /* Escape */ - long t; - /* Hilite the button for a bit */ - HiliteControl(errOkButton, 1); - Delay(5, &t); - /* Dehilite the button */ - HiliteControl(errOkButton, 0); - done = TRUE; - } - } - - /* Dispose of the Window, disposes of controls */ - DisposeWindow(errWindow); -} -#endif diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h index 8738a5a7fc..042a9bd452 100644 --- a/src/util/et/com_err.h +++ b/src/util/et/com_err.h @@ -12,15 +12,8 @@ #ifndef __COM_ERR_H -#if defined(_WIN32) || defined(macintosh) -#ifdef _WIN32 +#if defined(_WIN32) #include <win-mac.h> -#else -#include <Kerberos5/win-mac.h> -#endif -#if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -#pragma import on -#endif #endif #ifndef KRB5_CALLCONV @@ -60,7 +53,7 @@ extern errcode_t KRB5_CALLCONV remove_error_table (const struct error_table *) /*@modifies internalState@*/; -#if !defined(_WIN32) && !defined(macintosh) && !defined(__MACH__) +#if !defined(_WIN32) /* * The display routine should be application specific. A global hook, * may cause inappropriate display procedures to be called between @@ -75,9 +68,5 @@ extern et_old_error_hook_func reset_com_err_hook (void); } #endif -#if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -#pragma import reset -#endif - #define __COM_ERR_H #endif /* ! defined(__COM_ERR_H) */ diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index 9033f7f5c2..38beadcd1d 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -27,29 +27,18 @@ #include "com_err.h" #include "error_table.h" -#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) -# include <KerberosSupport/KerberosSupport.h> -# include <KerberosSupport/ErrorLib.h> -#endif - #if defined(_WIN32) #define HAVE_STRERROR #endif -#ifdef macintosh -#define sys_nerr 100 /* XXX - What is this? */ -#endif - #if !defined(HAVE_STRERROR) && !defined(SYS_ERRLIST_DECLARED) extern char const * const sys_errlist[]; -#ifndef macintosh extern const int sys_nerr; #endif -#endif static char buffer[ET_EBUFSIZ]; -#if (defined(_WIN32) || defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))) +#if (defined(_WIN32) || TARGET_OS_MAC /*@null@*/ static struct et_list * _et_list = (struct et_list *) NULL; #else /* Old interface compatibility */ @@ -202,17 +191,9 @@ oops: #if TARGET_OS_MAC { - /* This may be a Mac OS Toolbox error or an MIT Support Library Error. Ask ErrorLib */ - if (GetErrorLongString(code, buffer, ET_EBUFSIZ - 1) == noErr) { - return buffer; - } - -#if TARGET_API_MAC_OSX - /* ComErr and ErrorLib don't know about this error, ask the system */ + /* ComErr doesn't know about this error, ask the system */ /* Of course there's no way to tell if it knew what error it got */ return (strerror (code)); -#endif - } #endif diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk index 0305bafc22..04451366e4 100644 --- a/src/util/et/et_c.awk +++ b/src/util/et/et_c.awk @@ -187,11 +187,7 @@ END { print " 0" > outfile print "};" > outfile print "" > outfile - print "#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))" > outfile - print "#include <KerberosComErr/KerberosComErr.h>" > outfile - print "#else" > outfile print "#include <com_err.h>" > outfile - print "#endif" > outfile print "" > outfile if (tab_base_high == 0) { print "const struct error_table et_" table_name "_error_table = { text, " \ diff --git a/src/util/et/et_h.awk b/src/util/et/et_h.awk index d56101de80..6bccc98e97 100644 --- a/src/util/et/et_h.awk +++ b/src/util/et/et_h.awk @@ -111,11 +111,7 @@ c2n["_"]=63 print " * This file is automatically generated; please do not edit it." > outfile print " */" > outfile print "" > outfile - print "#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))" > outfile - print "#include <KerberosComErr/KerberosComErr.h>" > outfile - print "#else" > outfile print "#include <com_err.h>" > outfile - print "#endif" > outfile print "" > outfile } @@ -155,10 +151,13 @@ END { print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile print "/* for compatibility with older versions... */" > outfile print "extern void initialize_" table_name "_error_table () /*@modifies internalState@*/;" > outfile - print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile - print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile print "#else" > outfile print "#define initialize_" table_name "_error_table()" > outfile print "#endif" > outfile + print "" > outfile + print "#if !defined(_WIN32)" > outfile + print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile + print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile + print "#endif" > outfile } |