]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOS9/mDNSLibraryLoader.c
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 Change History (most recent first):
27 $Log: mDNSLibraryLoader.c,v $
28 Revision 1.1 2004/03/12 21:30:26 cheshire
29 Build a System-Context Shared Library from mDNSCore, for the benefit of developers
30 like Muse Research who want to be able to use mDNS/DNS-SD from GPL-licensed code.
34 #include <Resources.h>
35 #include <CodeFragments.h>
36 #include "ShowInitIcon.h"
38 extern pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
);
40 extern void main(void)
46 // 1. Show our "icon march" icon
47 ShowInitIcon(128, true);
51 fcbPB
.ioNamePtr
= fss
.name
;
53 fcbPB
.ioRefNum
= (short)CurResFile();
55 err
= PBGetFCBInfoSync(&fcbPB
);
57 // 3. Tell CFM that we're a CFM library container file
58 fss
.vRefNum
= fcbPB
.ioFCBVRefNum
;
59 fss
.parID
= fcbPB
.ioFCBParID
;
60 if (err
== noErr
) err
= FragRegisterFileLibs(&fss
, false);
62 // 4. Now that CFM knows we're a library container, tell it to go and get our library
68 THz oldZone
= GetZone();
69 SetZone(SystemZone());
70 err
= GetSharedLibrary("\pDarwin;mDNS", kPowerPCCFragArch
, kLoadCFrag
, &c
, &m
, e
);
75 // There's no CFM stub library for the FragRegisterFileLibs() call, so we'll make our own
76 #if __ide_target("FragRegisterFileLibsStub")
78 pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
)
81 (void)unregister
; // Unused