home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / CInternetConfig ƒ / CInternetConfig.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-07  |  14.9 KB  |  647 lines  |  [TEXT/SPM ]

  1. /*
  2.     CInternetConfig.cpp
  3.     
  4.     C++ Class Interface for Internet Config.  Basically this class encapsulates the
  5.     IC Switch Glue.c code, putting a C++ class wrapper around IC.
  6.     
  7.     This class still requires the inclusion of the IC Link In.c, IC Link In Subs.c, and
  8.     IC Call Glue.c C source files into your project.
  9. */
  10.  
  11. #include <AppleTalk.h>
  12. #include <Aliases.h>
  13. #include <Errors.h>
  14.  
  15. // include types and key information
  16. #include "IC Types.h"
  17. #include "IC Keys.h"
  18.  
  19. // include the main header for this file
  20. #include "CInternetConfig.hpp"
  21.  
  22. // include the headers for the component and resource routines
  23. #include "IC Component API.h"
  24. #include "IC Resource API.h"
  25.  
  26. CInternetConfig::CInternetConfig(OSType theCreator){
  27.     ICError err;
  28.     ICRRecordPtr instr;
  29.     
  30.     instr=(ICRRecordPtr)NewPtr(sizeof(ICRRecord));
  31.     err=MemError();
  32.     
  33.     if (err==noErr){
  34.         err=ICCStart(&(instr->instance),theCreator);
  35.         if (err!=noErr)
  36.             err=ICRStart(instr,theCreator);
  37.         
  38.         if (err!=noErr){
  39.             DisposePtr((Ptr)instr);
  40.             theInstance=(ICInstance)0;
  41.         } else {
  42.             theInstance=(ICInstance)instr;
  43.         }
  44.     }
  45.     lastError=err;
  46. }
  47.  
  48. CInternetConfig::~CInternetConfig(void){
  49.     ICError err;
  50.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  51.     
  52.     if (theInstance!=(ICInstance)0){
  53.         if (rp->instance!=(ComponentInstance)0){
  54.             err=ICCStop(rp->instance);
  55.         } else {
  56.             err=ICRStop(rp);
  57.         }
  58.         
  59.         DisposePtr((Ptr)rp);
  60.     }
  61. }
  62.  
  63. OSErr CInternetConfig::GetComponentInstance(Ptr* cip){
  64.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  65.     ICError err=(ICError)paramErr;
  66.     
  67.     if (theInstance==(ICInstance)0)
  68.         return paramErr;
  69.     
  70.     *cip=(Ptr)rp->instance;
  71.     
  72.     if (*cip==(Ptr)0)
  73.         err=badComponentInstance;
  74.     
  75.     lastError=err;
  76.     return (OSErr)err;
  77. }
  78.  
  79. OSErr CInternetConfig::GetLastError(void){
  80.     return (OSErr)lastError;
  81. }
  82.  
  83. OSErr CInternetConfig::MapICError(ICError err){
  84.     return (OSErr)err;
  85. }
  86.  
  87. OSErr CInternetConfig::FindConfigFile(short count,ICDirSpecArrayPtr folders){
  88.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  89.     ICError err=(ICError)paramErr;
  90.     
  91.     if (theInstance==(ICInstance)0)
  92.         return paramErr;
  93.     
  94.     if (rp->instance!=(ComponentInstance)0)
  95.         err=ICCFindConfigFile(rp->instance,count,folders);
  96.     else
  97.         err=ICRFindConfigFile(rp,count,folders);
  98.     
  99.     lastError=err;
  100.     return (OSErr)err;
  101. }
  102.  
  103. OSErr CInternetConfig::FindUserConfigFile(ICDirSpec* where){
  104.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  105.     ICError err=(ICError)paramErr;
  106.     
  107.     if (theInstance==(ICInstance)0)
  108.         return paramErr;
  109.     
  110.     if (rp->instance!=(ComponentInstance)0)
  111.         err=ICCFindUserConfigFile(rp->instance,where);
  112.     else
  113.         err=ICRFindUserConfigFile(rp,where);
  114.     
  115.     lastError=err;
  116.     return (OSErr)err;
  117. }
  118.  
  119. OSErr CInternetConfig::GeneralFindConfigFile(Boolean search_prefs,Boolean can_create,
  120.         short count,ICDirSpecArrayPtr folders){
  121.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  122.     ICError err=(ICError)paramErr;
  123.     
  124.     if (theInstance==(ICInstance)0)
  125.         return paramErr;
  126.     
  127.     if (rp->instance!=(ComponentInstance)0)
  128.         err=ICCGeneralFindConfigFile(rp->instance,search_prefs,can_create,count,folders);
  129.     else
  130.         err=ICRGeneralFindConfigFile(rp,search_prefs,can_create,count,folders);
  131.     
  132.     lastError=err;
  133.     return (OSErr)err;
  134. }
  135.  
  136. OSErr CInternetConfig::ChooseConfig(void){
  137.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  138.     ICError err=(ICError)paramErr;
  139.     
  140.     if (theInstance==(ICInstance)0)
  141.         return paramErr;
  142.     
  143.     if (rp->instance!=(ComponentInstance)0)
  144.         err=ICCChooseConfig(rp->instance);
  145.     else
  146.         err=ICRChooseConfig(rp);
  147.     
  148.     lastError=err;
  149.     return (OSErr)err;
  150. }
  151.  
  152. OSErr CInternetConfig::ChooseNewConfig(void){
  153.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  154.     ICError err=(ICError)paramErr;
  155.     
  156.     if (theInstance==(ICInstance)0)
  157.         return paramErr;
  158.     
  159.     if (rp->instance!=(ComponentInstance)0)
  160.         err=ICCChooseNewConfig(rp->instance);
  161.     else
  162.         err=ICRChooseNewConfig(rp);
  163.     
  164.     lastError=err;
  165.     return (OSErr)err;
  166. }
  167.  
  168. OSErr CInternetConfig::GetConfigName(StringPtr name,Boolean longname){
  169.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  170.     ICError err=(ICError)paramErr;
  171.     
  172.     if (theInstance==(ICInstance)0)
  173.         return paramErr;
  174.     
  175.     if (rp->instance!=(ComponentInstance)0)
  176.         err=ICCGetConfigName(rp->instance,longname,name);
  177.     else
  178.         err=ICRGetConfigName(rp,longname,name);
  179.     
  180.     lastError=err;
  181.     return (OSErr)err;
  182. }
  183.  
  184. OSErr CInternetConfig::GetConfigReference(ICConfigRefHandle ref){
  185.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  186.     ICError err=(ICError)paramErr;
  187.     
  188.     if (theInstance==(ICInstance)0)
  189.         return paramErr;
  190.     
  191.     if (rp->instance!=(ComponentInstance)0)
  192.         err=ICCGetConfigReference(rp->instance,ref);
  193.     else
  194.         err=ICRGetConfigReference(rp,ref);
  195.     
  196.     lastError=err;
  197.     return (OSErr)err;
  198. }
  199.  
  200. OSErr CInternetConfig::SetConfigReference(ICConfigRefHandle ref,long flags){
  201.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  202.     ICError err=(ICError)paramErr;
  203.     
  204.     if (theInstance==(ICInstance)0)
  205.         return paramErr;
  206.     
  207.     if (rp->instance!=(ComponentInstance)0)
  208.         err=ICCSetConfigReference(rp->instance,ref,flags);
  209.     else
  210.         err=ICRSetConfigReference(rp,ref,flags);
  211.     
  212.     lastError=err;
  213.     return (OSErr)err;
  214. }
  215.  
  216. OSErr CInternetConfig::SpecifyConfigFile(FSSpecPtr config){
  217.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  218.     ICError err=(ICError)paramErr;
  219.     
  220.     if (theInstance==(ICInstance)0)
  221.         return paramErr;
  222.     
  223.     if (rp->instance!=(ComponentInstance)0)
  224.         err=ICCSpecifyConfigFile(rp->instance,config);
  225.     else
  226.         err=ICRSpecifyConfigFile(rp,config);
  227.     
  228.     lastError=err;
  229.     return (OSErr)err;
  230. }
  231.  
  232. OSErr CInternetConfig::GetSeed(long* seed){
  233.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  234.     ICError err=(ICError)paramErr;
  235.     
  236.     if (theInstance==(ICInstance)0)
  237.         return paramErr;
  238.     
  239.     if (rp->instance!=(ComponentInstance)0)
  240.         err=ICCGetSeed(rp->instance,seed);
  241.     else
  242.         err=ICRGetSeed(rp,seed);
  243.     
  244.     lastError=err;
  245.     return (OSErr)err;
  246. }
  247.  
  248. OSErr CInternetConfig::GetPerm(ICPerm* perm){
  249.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  250.     ICError err=(ICError)paramErr;
  251.     
  252.     if (theInstance==(ICInstance)0)
  253.         return paramErr;
  254.     
  255.     if (rp->instance!=(ComponentInstance)0)
  256.         err=ICCGetPerm(rp->instance,perm);
  257.     else
  258.         err=ICRGetPerm(rp,perm);
  259.     
  260.     lastError=err;
  261.     return (OSErr)err;
  262. }
  263.  
  264. OSErr CInternetConfig::DefaultFileName(StringPtr name){
  265.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  266.     ICError err=(ICError)paramErr;
  267.     
  268.     if (theInstance==(ICInstance)0)
  269.         return paramErr;
  270.     
  271.     if (rp->instance!=(ComponentInstance)0)
  272.         err=ICCDefaultFileName(rp->instance,name);
  273.     else
  274.         err=ICRDefaultFileName(rp,name);
  275.     
  276.     lastError=err;
  277.     return (OSErr)err;
  278. }
  279.  
  280. OSErr CInternetConfig::Begin(ICPerm perm){
  281.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  282.     ICError err=(ICError)paramErr;
  283.     
  284.     if (theInstance==(ICInstance)0)
  285.         return paramErr;
  286.     
  287.     if (rp->instance!=(ComponentInstance)0)
  288.         err=ICCBegin(rp->instance,perm);
  289.     else
  290.         err=ICRBegin(rp,perm);
  291.     
  292.     lastError=err;
  293.     return (OSErr)err;
  294. }
  295.  
  296. OSErr CInternetConfig::GetPref(const StringPtr key,ICAttr* attr,Ptr buf,long* size){
  297.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  298.     ICError err=(ICError)paramErr;
  299.     
  300.     if (theInstance==(ICInstance)0)
  301.         return paramErr;
  302.     
  303.     if (rp->instance!=(ComponentInstance)0)
  304.         err=ICCGetPref(rp->instance,key,attr,buf,size);
  305.     else
  306.         err=ICRGetPref(rp,key,attr,buf,size);
  307.     
  308.     lastError=err;
  309.     return (OSErr)err;
  310. }
  311.  
  312. OSErr CInternetConfig::SetPref(const StringPtr key,ICAttr attr,Ptr buf,long size){
  313.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  314.     ICError err=(ICError)paramErr;
  315.     
  316.     if (theInstance==(ICInstance)0)
  317.         return paramErr;
  318.     
  319.     if (rp->instance!=(ComponentInstance)0)
  320.         err=ICCSetPref(rp->instance,key,attr,buf,size);
  321.     else
  322.         err=ICRSetPref(rp,key,attr,buf,size);
  323.     
  324.     lastError=err;
  325.     return (OSErr)err;
  326. }
  327.  
  328. OSErr CInternetConfig::FindPrefHandle(const StringPtr key,ICAttr* attr,Handle prefh){
  329.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  330.     ICError err=(ICError)paramErr;
  331.     
  332.     if (theInstance==(ICInstance)0)
  333.         return paramErr;
  334.     
  335.     if (rp->instance!=(ComponentInstance)0)
  336.         err=ICCFindPrefHandle(rp->instance,key,attr,prefh);
  337.     else
  338.         err=ICRFindPrefHandle(rp,key,attr,prefh);
  339.     
  340.     lastError=err;
  341.     return (OSErr)err;
  342. }
  343.  
  344. OSErr CInternetConfig::GetPrefHandle(const StringPtr key,ICAttr* attr,Handle* prefh){
  345.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  346.     ICError err=(ICError)paramErr;
  347.     
  348.     if (theInstance==(ICInstance)0)
  349.         return paramErr;
  350.     
  351.     if (rp->instance!=(ComponentInstance)0)
  352.         err=ICCGetPrefHandle(rp->instance,key,attr,prefh);
  353.     else
  354.         err=ICRGetPrefHandle(rp,key,attr,prefh);
  355.     
  356.     lastError=err;
  357.     return (OSErr)err;
  358. }
  359.  
  360. OSErr CInternetConfig::SetPrefHandle(const StringPtr key,ICAttr attr,Handle prefh){
  361.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  362.     ICError err=(ICError)paramErr;
  363.     
  364.     if (theInstance==(ICInstance)0)
  365.         return paramErr;
  366.     
  367.     if (rp->instance!=(ComponentInstance)0)
  368.         err=ICCSetPrefHandle(rp->instance,key,attr,prefh);
  369.     else
  370.         err=ICRSetPrefHandle(rp,key,attr,prefh);
  371.     
  372.     lastError=err;
  373.     return (OSErr)err;
  374. }
  375.  
  376. OSErr CInternetConfig::CountPref(long* count){
  377.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  378.     ICError err=(ICError)paramErr;
  379.     
  380.     if (theInstance==(ICInstance)0)
  381.         return paramErr;
  382.     
  383.     if (rp->instance!=(ComponentInstance)0)
  384.         err=ICCCountPref(rp->instance,count);
  385.     else
  386.         err=ICRCountPref(rp,count);
  387.     
  388.     lastError=err;
  389.     return (OSErr)err;
  390. }
  391.  
  392. OSErr CInternetConfig::GetIndPref(long n,StringPtr key){
  393.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  394.     ICError err=(ICError)paramErr;
  395.     
  396.     if (theInstance==(ICInstance)0)
  397.         return paramErr;
  398.     
  399.     if (rp->instance!=(ComponentInstance)0)
  400.         err=ICCGetIndPref(rp->instance,n,key);
  401.     else
  402.         err=ICRGetIndPref(rp,n,key);
  403.     
  404.     lastError=err;
  405.     return (OSErr)err;
  406. }
  407.  
  408. OSErr CInternetConfig::DeletePref(const StringPtr key){
  409.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  410.     ICError err=(ICError)paramErr;
  411.     
  412.     if (theInstance==(ICInstance)0)
  413.         return paramErr;
  414.     
  415.     if (rp->instance!=(ComponentInstance)0)
  416.         err=ICCDeletePref(rp->instance,key);
  417.     else
  418.         err=ICRDeletePref(rp,key);
  419.     
  420.     lastError=err;
  421.     return (OSErr)err;
  422. }
  423.  
  424. OSErr CInternetConfig::End(void){
  425.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  426.     ICError err=(ICError)paramErr;
  427.     
  428.     if (theInstance==(ICInstance)0)
  429.         return paramErr;
  430.     
  431.     if (rp->instance!=(ComponentInstance)0)
  432.         err=ICCEnd(rp->instance);
  433.     else
  434.         err=ICREnd(rp);
  435.     
  436.     lastError=err;
  437.     return (OSErr)err;
  438. }
  439.  
  440. OSErr CInternetConfig::EditPreferences(const StringPtr key){
  441.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  442.     ICError err=(ICError)paramErr;
  443.     
  444.     if (theInstance==(ICInstance)0)
  445.         return paramErr;
  446.     
  447.     if (rp->instance!=(ComponentInstance)0)
  448.         err=ICCEditPreferences(rp->instance,key);
  449.     else
  450.         err=ICREditPreferences(rp,key);
  451.     
  452.     lastError=err;
  453.     return (OSErr)err;
  454. }
  455.  
  456. OSErr CInternetConfig::ParseURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd,Handle url){
  457.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  458.     ICError err=(ICError)paramErr;
  459.     
  460.     if (theInstance==(ICInstance)0)
  461.         return paramErr;
  462.     
  463.     if (rp->instance!=(ComponentInstance)0)
  464.         err=ICCParseURL(rp->instance,hint,data,len,selStart,selEnd,url);
  465.     else
  466.         err=ICRParseURL(rp,hint,data,len,selStart,selEnd,url);
  467.     
  468.     lastError=err;
  469.     return (OSErr)err;
  470. }
  471.  
  472. OSErr CInternetConfig::LaunchURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd){
  473.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  474.     ICError err=(ICError)paramErr;
  475.     
  476.     if (theInstance==(ICInstance)0)
  477.         return paramErr;
  478.     
  479.     if (rp->instance!=(ComponentInstance)0)
  480.         err=ICCLaunchURL(rp->instance,hint,data,len,selStart,selEnd);
  481.     else
  482.         err=ICRLaunchURL(rp,hint,data,len,selStart,selEnd);
  483.     
  484.     lastError=err;
  485.     return (OSErr)err;
  486. }
  487.  
  488. OSErr CInternetConfig::MapFilename(StringPtr filename,ICMapEntry* entry){
  489.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  490.     ICError err=(ICError)paramErr;
  491.     
  492.     if (theInstance==(ICInstance)0)
  493.         return paramErr;
  494.     
  495.     if (rp->instance!=(ComponentInstance)0)
  496.         err=ICCMapFilename(rp->instance,filename,entry);
  497.     else
  498.         err=ICRMapFilename(rp,filename,entry);
  499.     
  500.     lastError=err;
  501.     return (OSErr)err;
  502. }
  503.  
  504. OSErr CInternetConfig::MapTypeCreator(OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry){
  505.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  506.     ICError err=(ICError)paramErr;
  507.     
  508.     if (theInstance==(ICInstance)0)
  509.         return paramErr;
  510.     
  511.     if (rp->instance!=(ComponentInstance)0)
  512.         err=ICCMapTypeCreator(rp->instance,fType,fCreator,filename,entry);
  513.     else
  514.         err=ICRMapTypeCreator(rp,fType,fCreator,filename,entry);
  515.     
  516.     lastError=err;
  517.     return (OSErr)err;
  518. }
  519.  
  520. OSErr CInternetConfig::MapEntriesFilename(Handle entries,StringPtr filename,ICMapEntry* entry){
  521.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  522.     ICError err=(ICError)paramErr;
  523.     
  524.     if (theInstance==(ICInstance)0)
  525.         return paramErr;
  526.     
  527.     if (rp->instance!=(ComponentInstance)0)
  528.         err=ICCMapEntriesFilename(rp->instance,entries,filename,entry);
  529.     else
  530.         err=ICRMapEntriesFilename(rp,entries,filename,entry);
  531.     
  532.     lastError=err;
  533.     return (OSErr)err;
  534. }
  535.  
  536. OSErr CInternetConfig::MapEntriesTypeCreator(Handle entries,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry){
  537.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  538.     ICError err=(ICError)paramErr;
  539.     
  540.     if (theInstance==(ICInstance)0)
  541.         return paramErr;
  542.     
  543.     if (rp->instance!=(ComponentInstance)0)
  544.         err=ICCMapEntriesTypeCreator(rp->instance,entries,fType,fCreator,filename,entry);
  545.     else
  546.         err=ICRMapEntriesTypeCreator(rp,entries,fType,fCreator,filename,entry);
  547.     
  548.     lastError=err;
  549.     return (OSErr)err;
  550. }
  551.  
  552. OSErr CInternetConfig::CountMapEntries(Handle entries,long* count){
  553.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  554.     ICError err=(ICError)paramErr;
  555.     
  556.     if (theInstance==(ICInstance)0)
  557.         return paramErr;
  558.     
  559.     if (rp->instance!=(ComponentInstance)0)
  560.         err=ICCCountMapEntries(rp->instance,entries,count);
  561.     else
  562.         err=ICRCountMapEntries(rp,entries,count);
  563.     
  564.     lastError=err;
  565.     return (OSErr)err;
  566. }
  567.  
  568. OSErr CInternetConfig::GetIndMapEntry(Handle entries,long ndx,long* pos,ICMapEntry* entry){
  569.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  570.     ICError err=(ICError)paramErr;
  571.     
  572.     if (theInstance==(ICInstance)0)
  573.         return paramErr;
  574.     
  575.     if (rp->instance!=(ComponentInstance)0)
  576.         err=ICCGetIndMapEntry(rp->instance,entries,ndx,pos,entry);
  577.     else
  578.         err=ICRGetIndMapEntry(rp,entries,ndx,pos,entry);
  579.     
  580.     lastError=err;
  581.     return (OSErr)err;
  582. }
  583.  
  584. OSErr CInternetConfig::GetMapEntry(Handle entries,long pos,ICMapEntry* entry){
  585.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  586.     ICError err=(ICError)paramErr;
  587.     
  588.     if (theInstance==(ICInstance)0)
  589.         return paramErr;
  590.     
  591.     if (rp->instance!=(ComponentInstance)0)
  592.         err=ICCGetMapEntry(rp->instance,entries,pos,entry);
  593.     else
  594.         err=ICRGetMapEntry(rp,entries,pos,entry);
  595.     
  596.     lastError=err;
  597.     return (OSErr)err;
  598. }
  599.  
  600. OSErr CInternetConfig::SetMapEntry(Handle entries,long pos,ICMapEntry* entry){
  601.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  602.     ICError err=(ICError)paramErr;
  603.     
  604.     if (theInstance==(ICInstance)0)
  605.         return paramErr;
  606.     
  607.     if (rp->instance!=(ComponentInstance)0)
  608.         err=ICCSetMapEntry(rp->instance,entries,pos,entry);
  609.     else
  610.         err=ICRSetMapEntry(rp,entries,pos,entry);
  611.     
  612.     lastError=err;
  613.     return (OSErr)err;
  614. }
  615.  
  616. OSErr CInternetConfig::DeleteMapEntry(Handle entries,long pos){
  617.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  618.     ICError err=(ICError)paramErr;
  619.     
  620.     if (theInstance==(ICInstance)0)
  621.         return paramErr;
  622.     
  623.     if (rp->instance!=(ComponentInstance)0)
  624.         err=ICCDeleteMapEntry(rp->instance,entries,pos);
  625.     else
  626.         err=ICRDeleteMapEntry(rp,entries,pos);
  627.     
  628.     lastError=err;
  629.     return (OSErr)err;
  630. }
  631.  
  632. OSErr CInternetConfig::AddMapEntry(Handle entries,ICMapEntry* entry){
  633.     ICRRecordPtr rp=(ICRRecordPtr)theInstance;
  634.     ICError err=(ICError)paramErr;
  635.     
  636.     if (theInstance==(ICInstance)0)
  637.         return paramErr;
  638.     
  639.     if (rp->instance!=(ComponentInstance)0)
  640.         err=ICCAddMapEntry(rp->instance,entries,entry);
  641.     else
  642.         err=ICRAddMapEntry(rp,entries,entry);
  643.     
  644.     lastError=err;
  645.     return (OSErr)err;
  646. }
  647.