]>
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.
18 #include <Resources.h>
19 #include <CodeFragments.h>
20 #include "ShowInitIcon.h"
22 extern pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
);
24 extern void main(void)
30 // 1. Show our "icon march" icon
31 ShowInitIcon(128, true);
35 fcbPB
.ioNamePtr
= fss
.name
;
37 fcbPB
.ioRefNum
= (short)CurResFile();
39 err
= PBGetFCBInfoSync(&fcbPB
);
41 // 3. Tell CFM that we're a CFM library container file
42 fss
.vRefNum
= fcbPB
.ioFCBVRefNum
;
43 fss
.parID
= fcbPB
.ioFCBParID
;
44 if (err
== noErr
) err
= FragRegisterFileLibs(&fss
, false);
46 // 4. Now that CFM knows we're a library container, tell it to go and get our library
52 THz oldZone
= GetZone();
53 SetZone(SystemZone());
54 err
= GetSharedLibrary("\pDarwin;mDNS", kPowerPCCFragArch
, kLoadCFrag
, &c
, &m
, e
);
59 // There's no CFM stub library for the FragRegisterFileLibs() call, so we'll make our own
60 #if __ide_target("FragRegisterFileLibsStub")
62 pascal OSErr
FragRegisterFileLibs(ConstFSSpecPtr fss
, Boolean unregister
)
65 (void)unregister
; // Unused