hagbard% cvs annotate bla.c Annotations for bla.c *************** 1.6 (spowers 02-Feb-96): /**************************************************************************** 1.6 (spowers 02-Feb-96): * NCSA Mosaic for the X Window System * 1.6 (spowers 02-Feb-96): * Software Development Group * 1.6 (spowers 02-Feb-96): * National Center for Supercomputing Applications * 1.6 (spowers 02-Feb-96): * University of Illinois at Urbana-Champaign * 1.6 (spowers 02-Feb-96): * 605 E. Springfield, Champaign IL 61820 * 1.6 (spowers 02-Feb-96): * mosaic@ncsa.uiuc.edu * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * Copyright (C) 1993, Board of Trustees of the University of Illinois * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * NCSA Mosaic software, both binary and source (hereafter, Software) is * 1.6 (spowers 02-Feb-96): * copyrighted by The Board of Trustees of the University of Illinois * 1.6 (spowers 02-Feb-96): * (UI), and ownership remains with the UI. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * The UI grants you (hereafter, Licensee) a license to use the Software * 1.6 (spowers 02-Feb-96): * for academic, research and internal business purposes only, without a * 1.6 (spowers 02-Feb-96): * fee. Licensee may distribute the binary and source code (if released) * 1.6 (spowers 02-Feb-96): * to third parties provided that the copyright notice and this statement * 1.6 (spowers 02-Feb-96): * appears on all copies and that no charge is associated with such * 1.6 (spowers 02-Feb-96): * copies. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * Licensee may make derivative works. However, if Licensee distributes * 1.6 (spowers 02-Feb-96): * any derivative work based on or derived from the Software, then * 1.6 (spowers 02-Feb-96): * Licensee will (1) notify NCSA regarding its distribution of the * 1.6 (spowers 02-Feb-96): * derivative work, and (2) clearly notify users that such derivative * 1.6 (spowers 02-Feb-96): * work is a modified version and not the original NCSA Mosaic * 1.6 (spowers 02-Feb-96): * distributed by the UI. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * Any Licensee wishing to make commercial use of the Software should * 1.6 (spowers 02-Feb-96): * contact the UI, c/o NCSA, to negotiate an appropriate license for such * 1.6 (spowers 02-Feb-96): * commercial use. Commercial use includes (1) integration of all or * 1.6 (spowers 02-Feb-96): * part of the source code into a product for sale or license by or on * 1.6 (spowers 02-Feb-96): * behalf of Licensee to third parties, or (2) distribution of the binary * 1.6 (spowers 02-Feb-96): * code or source code to third parties that need it to utilize a * 1.6 (spowers 02-Feb-96): * commercial product sold or licensed by or on behalf of Licensee. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR * 1.6 (spowers 02-Feb-96): * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED * 1.6 (spowers 02-Feb-96): * WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE * 1.6 (spowers 02-Feb-96): * USERS OF THIS SOFTWARE. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * By using or copying this Software, Licensee agrees to abide by the * 1.6 (spowers 02-Feb-96): * copyright law and all other applicable laws of the U.S. including, but * 1.6 (spowers 02-Feb-96): * not limited to, export control laws, and the terms of this license. * 1.6 (spowers 02-Feb-96): * UI shall have the right to terminate this license immediately by * 1.6 (spowers 02-Feb-96): * written notice upon Licensee's breach of, or non-compliance with, any * 1.6 (spowers 02-Feb-96): * of its terms. Licensee may be held legally responsible for any * 1.6 (spowers 02-Feb-96): * copyright infringement that is caused or encouraged by Licensee's * 1.6 (spowers 02-Feb-96): * failure to abide by the terms of this license. * 1.6 (spowers 02-Feb-96): * * 1.6 (spowers 02-Feb-96): * Comments and questions are welcome and can be sent to * 1.6 (spowers 02-Feb-96): * mosaic-x@ncsa.uiuc.edu. * 1.6 (spowers 02-Feb-96): ****************************************************************************/ 1.6 (spowers 02-Feb-96): 1.1 (alanb 11-Jan-95): /* CCI redirect object 1.1 (alanb 11-Jan-95): ** ================= 1.1 (alanb 11-Jan-95): */ 1.10 (tpreilly 26-Jun-96): 1.10 (tpreilly 26-Jun-96): #include "../config.h" 1.1 (alanb 11-Jan-95): #include 1.1 (alanb 11-Jan-95): #include "cciServer.h" 1.1 (alanb 11-Jan-95): #include "list.h" 1.1 (alanb 11-Jan-95): #include "memStuffForPipSqueeks.h" 1.1 (alanb 11-Jan-95): 1.11 (spowers 13-Nov-96): #include "../libwww2/HTPlain.h" 1.11 (spowers 13-Nov-96): #include "../libwww2/HTUtils.h" 1.11 (spowers 13-Nov-96): #include "../libwww2/HText.h" 1.11 (spowers 13-Nov-96): #include "../libwww2/HTFile.h" 1.11 (spowers 13-Nov-96): #include "../libwww2/HTCompressed.h" 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): extern void MoCCISendOutputToClient(); 1.5 (spowers 21-Jul-95): extern void HTCompressedFileToFile (char *fnam, int compressed); 1.1 (alanb 11-Jan-95): 1.8 (spowers 12-Feb-96): #ifndef DISABLE_TRACE 1.7 (spowers 09-Feb-96): extern int srcTrace; 1.8 (spowers 12-Feb-96): #endif 1.7 (spowers 09-Feb-96): 1.1 (alanb 11-Jan-95): /* HTML Object 1.1 (alanb 11-Jan-95): ** ----------- 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): struct _HTStream { 1.9 (spowers 29-Mar-96): WWW_CONST HTStreamClass * isa; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): HTAtom *dataType; 1.1 (alanb 11-Jan-95): char fileName[L_tmpnam]; /* name of temp file... kept for unlink()ing*/ 1.1 (alanb 11-Jan-95): FILE *fp; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): int compressed; 1.1 (alanb 11-Jan-95): }; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /*_________________________________________________________________________ 1.1 (alanb 11-Jan-95): ** 1.1 (alanb 11-Jan-95): ** A C T I O N R O U T I N E S 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* Character handling 1.1 (alanb 11-Jan-95): ** ------------------ 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): PRIVATE void CCI_put_character ARGS2(HTStream *, me, char, c) 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): fputc(c,me->fp); 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* String handling 1.1 (alanb 11-Jan-95): ** --------------- 1.1 (alanb 11-Jan-95): ** 1.1 (alanb 11-Jan-95): */ 1.9 (spowers 29-Mar-96): PRIVATE void CCI_put_string ARGS2(HTStream *, me, WWW_CONST char*, s) 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): fwrite(s,1,strlen(s),me->fp); 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.9 (spowers 29-Mar-96): PRIVATE void CCI_write ARGS3(HTStream *, me, WWW_CONST char*, s, int, l) 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): fwrite(s,1,l,me->fp); 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* Free an HTML object 1.1 (alanb 11-Jan-95): ** ------------------- 1.1 (alanb 11-Jan-95): ** 1.1 (alanb 11-Jan-95): ** Note that the SGML parsing context is freed, but the created object is not, 1.1 (alanb 11-Jan-95): ** as it takes on an existence of its own unless explicitly freed. 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): PRIVATE void CCI_free ARGS1(HTStream *, me) 1.1 (alanb 11-Jan-95): { 1.7 (spowers 09-Feb-96): 1.8 (spowers 12-Feb-96): #ifndef DISABLE_TRACE 1.7 (spowers 09-Feb-96): if (srcTrace) { 1.7 (spowers 09-Feb-96): fprintf(stderr,"CCI_free()\n"); 1.7 (spowers 09-Feb-96): } 1.8 (spowers 12-Feb-96): #endif 1.7 (spowers 09-Feb-96): 1.1 (alanb 11-Jan-95): /* 1.1 (alanb 11-Jan-95): if (me->compressed != COMPRESSED_NOT) 1.1 (alanb 11-Jan-95): { 1.8 (spowers 12-Feb-96): #ifndef DISABLE_TRACE 1.7 (spowers 09-Feb-96): if (cciTrace) 1.1 (alanb 11-Jan-95): fprintf 1.1 (alanb 11-Jan-95): (stderr, 1.1 (alanb 11-Jan-95): "[CCI_free] OK, we're going to decompress HText\n"); 1.8 (spowers 12-Feb-96): #endif 1.1 (alanb 11-Jan-95): HTCompressedHText (me->text, me->compressed, 1); 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): free(me); 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* End writing 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): PRIVATE void CCI_end_document ARGS1(HTStream *, me) 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): fclose(me->fp); 1.1 (alanb 11-Jan-95): /* ship it */ 1.5 (spowers 21-Jul-95): if ( me->compressed != COMPRESSED_NOT) 1.5 (spowers 21-Jul-95): HTCompressedFileToFile (me->fileName, me->compressed); 1.1 (alanb 11-Jan-95): MoCCISendOutputToClient(HTAtom_name(me->dataType),me->fileName); 1.1 (alanb 11-Jan-95): /* 1.1 (alanb 11-Jan-95): unlink(me->fileName); 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): PRIVATE void CCI_handle_interrupt ARGS1(HTStream *, me) 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): fclose(me->fp); 1.11 (spowers 13-Nov-96): #ifndef VMS 1.1 (alanb 11-Jan-95): unlink(me->fileName); 1.11 (spowers 13-Nov-96): #else 1.11 (spowers 13-Nov-96): remove(me->fileName); 1.11 (spowers 13-Nov-96): #endif 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* Structured Object Class 1.1 (alanb 11-Jan-95): ** ----------------------- 1.1 (alanb 11-Jan-95): */ 1.9 (spowers 29-Mar-96): PUBLIC WWW_CONST HTStreamClass CCIout = 1.1 (alanb 11-Jan-95): { 1.1 (alanb 11-Jan-95): "CCIout", 1.1 (alanb 11-Jan-95): CCI_free, 1.1 (alanb 11-Jan-95): CCI_end_document, 1.1 (alanb 11-Jan-95): CCI_put_character, CCI_put_string, CCI_write, 1.1 (alanb 11-Jan-95): CCI_handle_interrupt 1.1 (alanb 11-Jan-95): }; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* New object 1.1 (alanb 11-Jan-95): ** ---------- 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): PUBLIC HTStream* CCIPresent ARGS5( 1.1 (alanb 11-Jan-95): HTPresentation *, pres, 1.1 (alanb 11-Jan-95): HTParentAnchor *, anchor, 1.1 (alanb 11-Jan-95): HTStream *, sink, 1.1 (alanb 11-Jan-95): HTFormat, format_in, 1.1 (alanb 11-Jan-95): int, compressed) 1.1 (alanb 11-Jan-95): { 1.2 (edburns 17-Feb-95): HTStream* me = (HTStream*)malloc(sizeof(HTStream)); 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): me->isa = &CCIout; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): (void) tmpnam(me->fileName); 1.1 (alanb 11-Jan-95): if (!(me->fp = fopen(me->fileName,"w"))) { 1.1 (alanb 11-Jan-95): /*error, can't open tmp file */ 1.1 (alanb 11-Jan-95): return(sink); 1.1 (alanb 11-Jan-95): } 1.1 (alanb 11-Jan-95): me->dataType = pres->rep; 1.1 (alanb 11-Jan-95): me->compressed = compressed; 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): /* 1.1 (alanb 11-Jan-95): if (me->compressed == COMPRESSED_NOT) 1.1 (alanb 11-Jan-95): HText_appendText(me->text, "\n"); 1.1 (alanb 11-Jan-95): */ 1.1 (alanb 11-Jan-95): 1.1 (alanb 11-Jan-95): return (HTStream*) me; 1.1 (alanb 11-Jan-95): }