Diff for /Amaya/amaya/HTMLbook.c between versions 1.100 and 1.101

version 1.100, 2003/09/05 09:38:37 version 1.101, 2003/11/18 08:10:23
Line 14 Line 14
   
   
 /* Included headerfiles */  /* Included headerfiles */
 #define THOT_EXPORT  #define THOT_EXPORT extern
 #include "amaya.h"  #include "amaya.h"
 #include "AHTURLTools_f.h"  #include "AHTURLTools_f.h"
 #include "print.h"  #include "print.h"
 #include "css.h"  #include "css.h"
   #include "init_f.h"
   
 /* structure to register sub-documents in MakeBook function*/  /* structure to register sub-documents in MakeBook function*/
 typedef struct _SubDoc  typedef struct _SubDoc
Line 66  static int              PagePerSheet; Line 67  static int              PagePerSheet;
 #include "wininclude.h"  #include "wininclude.h"
 #endif /* _WINDOWS */  #endif /* _WINDOWS */
   
 static ThotBool GetIncludedDocuments ();  static ThotBool GetIncludedDocuments (Element el, Element link,
                                         Document doc, IncludeCtxt *prev);
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   RedisplayDocument redisplays a view of a document    RedisplayDocument redisplays a view of a document
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
Line 97  static void RegisterSubDoc (Element el, Line 98  static void RegisterSubDoc (Element el,
   if (url == NULL || url[0] == EOS)    if (url == NULL || url[0] == EOS)
     return;      return;
   
   entry = TtaGetMemory (sizeof (struct _SubDoc));    entry = (struct _SubDoc *)TtaGetMemory (sizeof (struct _SubDoc));
   entry->SDnext = NULL;    entry->SDnext = NULL;
   entry->SDel = el;    entry->SDel = el;
   entry->SDname = TtaStrdup (url);    entry->SDname = TtaStrdup (url);
Line 242  void SetInternalLinks (Document document Line 243  void SetInternalLinks (Document document
             /* this element has an HREF or cite attribute */              /* this element has an HREF or cite attribute */
             {              {
               length = TtaGetTextAttributeLength (HrefAttr);                length = TtaGetTextAttributeLength (HrefAttr);
               text = TtaGetMemory (length + 1);                text = (char *)TtaGetMemory (length + 1);
               TtaGiveTextAttributeValue (HrefAttr, text, &length);                TtaGiveTextAttributeValue (HrefAttr, text, &length);
   
               /* does an external link become an internal link ? */                /* does an external link become an internal link ? */
Line 673  void InitPrint (void) Line 674  void InitPrint (void)
 {  {
   char* ptr;    char* ptr;
   
    BasePrint = TtaSetCallback (CallbackPrint, PRINT_MAX_REF);     BasePrint = TtaSetCallback ((Proc)CallbackPrint, PRINT_MAX_REF);
    DocPrint = 0;     DocPrint = 0;
    DocPrintURL = NULL;     DocPrintURL = NULL;
   
Line 1015  static void CloseMakeBook (Document docu Line 1016  static void CloseMakeBook (Document docu
   SetInternalLinks (document);    SetInternalLinks (document);
   /* if the document changed force the browser mode */    /* if the document changed force the browser mode */
   if (SubDocs)    if (SubDocs)
     SetBrowserEditor (document);      SetBrowserEditor (document,0);
   /* remove registered  sub-documents */    /* remove registered  sub-documents */
   FreeSubDocTable ();    FreeSubDocTable ();
   DocBook = 0;    DocBook = 0;
Line 1123  static ThotBool GetIncludedDocuments (El Line 1124  static ThotBool GetIncludedDocuments (El
       if (attr)        if (attr)
         {          {
           length = TtaGetTextAttributeLength (attr);            length = TtaGetTextAttributeLength (attr);
           text = TtaGetMemory (length + 1);            text = (char *)TtaGetMemory (length + 1);
           TtaGiveTextAttributeValue (attr, text, &length);            TtaGiveTextAttributeValue (attr, text, &length);
           /* Valid rel values are rel="chapter" or rel="subdocument" */            /* Valid rel values are rel="chapter" or rel="subdocument" */
           if (strcasecmp (text, "chapter") &&            if (strcasecmp (text, "chapter") &&
Line 1142  static ThotBool GetIncludedDocuments (El Line 1143  static ThotBool GetIncludedDocuments (El
         /* this link has an attribute HREF */          /* this link has an attribute HREF */
         {          {
           length = TtaGetTextAttributeLength (attr);            length = TtaGetTextAttributeLength (attr);
           text = TtaGetMemory (length + 1);            text = (char *)TtaGetMemory (length + 1);
           TtaGiveTextAttributeValue (attr, text, &length);            TtaGiveTextAttributeValue (attr, text, &length);
           ptr = strrchr (text, '#');            ptr = strrchr (text, '#');
           url = text;            url = text;
Line 1163  static ThotBool GetIncludedDocuments (El Line 1164  static ThotBool GetIncludedDocuments (El
               if (IncludedDocument != 0)                if (IncludedDocument != 0)
                 {                  {
                   TtaSetStatus (doc, 1, TtaGetMessage (AMAYA, AM_FETCHING), url);                    TtaSetStatus (doc, 1, TtaGetMessage (AMAYA, AM_FETCHING), url);
                   ctx = TtaGetMemory (sizeof (IncludeCtxt));                    ctx = (IncludeCtxt *)TtaGetMemory (sizeof (IncludeCtxt));
                   ctx->div =  el;                    ctx->div =  el;
                   ctx->link = link;                    ctx->link = link;
                   ctx->url = url; /* the URL of the document */                    ctx->url = url; /* the URL of the document */
Line 1178  static ThotBool GetIncludedDocuments (El Line 1179  static ThotBool GetIncludedDocuments (El
 #endif /* _I18N_ */  #endif /* _I18N_ */
                   newdoc = GetAmayaDoc (url, NULL, IncludedDocument,                    newdoc = GetAmayaDoc (url, NULL, IncludedDocument,
                                         doc, CE_MAKEBOOK, FALSE,                                           doc, CE_MAKEBOOK, FALSE, 
                                         (void *) GetIncludedDocuments_callback,                                          (void (*)(int, int, char*, char*, const AHTHeaders*, void*)) GetIncludedDocuments_callback,
                                         (void *) ctx, charset);                                          (void *) ctx, charset);
                   found = TRUE;                    found = TRUE;
                 }                  }

Removed from v.1.100  
changed lines
  Added in v.1.101


Webmaster