home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / libnet / mkjscfg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.4 KB  |  55 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "mkjscfg.h"
  20. #include "cvsimple.h"
  21. #include "prefapi.h"
  22.  
  23. /*
  24.  * jsc_complete
  25.  */
  26. PRIVATE void
  27. jsc_complete(void* bytes, int32 num_bytes)
  28. {
  29. #ifdef DEBUG_malmer
  30.     extern FILE* real_stderr;
  31.  
  32.     fwrite(bytes, sizeof(char), num_bytes, real_stderr);
  33. #endif
  34.  
  35.     if ( bytes ) {
  36.         PREF_EvaluateConfigScript(bytes, num_bytes, NULL, TRUE, TRUE);
  37.     } else {
  38.         /* If failover is ok, read the local cached config */
  39.     }
  40.  
  41.     /* Need to hash and save to disk here */
  42. }
  43.  
  44.  
  45. /*
  46.  * NET_JavascriptConfig
  47.  */
  48. MODULE_PRIVATE NET_StreamClass*
  49. NET_JavascriptConfig(int fmt, void* data_obj, URL_Struct* URL_s, MWContext* w)
  50. {
  51.     return NET_SimpleStream(fmt, (void*) jsc_complete, URL_s, w);
  52. }
  53.  
  54.  
  55.