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