]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOS9/mDNSLibraryLoader.c
1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 Change History (most recent first):
19 $Log: mDNSLibraryLoader.c,v $
20 Revision 1.2 2006/08/14 23:24:29 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
23 Revision 1.1 2004/03/12 21:30:26 cheshire
24 Build a System-Context Shared Library from mDNSCore, for the benefit of developers
25 like Muse Research who want to be able to use mDNS/DNS-SD from GPL-licensed code.
29 #include <Resources.h>
30 #include <CodeFragments.h>
31 #include "ShowInitIcon.h"
33 extern pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
);
35 extern void main(void)
41 // 1. Show our "icon march" icon
42 ShowInitIcon(128, true);
46 fcbPB
.ioNamePtr
= fss
.name
;
48 fcbPB
.ioRefNum
= (short)CurResFile();
50 err
= PBGetFCBInfoSync(&fcbPB
);
52 // 3. Tell CFM that we're a CFM library container file
53 fss
.vRefNum
= fcbPB
.ioFCBVRefNum
;
54 fss
.parID
= fcbPB
.ioFCBParID
;
55 if (err
== noErr
) err
= FragRegisterFileLibs(&fss
, false);
57 // 4. Now that CFM knows we're a library container, tell it to go and get our library
63 THz oldZone
= GetZone();
64 SetZone(SystemZone());
65 err
= GetSharedLibrary("\pDarwin;mDNS", kPowerPCCFragArch
, kLoadCFrag
, &c
, &m
, e
);
70 // There's no CFM stub library for the FragRegisterFileLibs() call, so we'll make our own
71 #if __ide_target("FragRegisterFileLibsStub")
73 pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
)
76 (void)unregister
; // Unused