home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / rdf / src / hist2rdf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.2 KB  |  97 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. #ifndef    _RDF_HIST2RDF_H_
  20. #define    _RDF_HIST2RDF_H_
  21.  
  22.  
  23. #include "rdf-int.h"
  24. #include "mcom_ndbm.h"
  25. #include "time.h"
  26. #include "xp_mcom.h"
  27. #include "xp_mem.h"
  28. #include "xp_str.h"
  29. #include "xpgetstr.h"
  30. #include "glhist.h"
  31.  
  32. #include <stdio.h>
  33.  
  34. #ifndef    NSPR20
  35. #include "prosdep.h"    /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */
  36. #else
  37. #include "prtypes.h"
  38. #endif
  39.  
  40.  
  41.  
  42. #if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
  43. #error Must have a byte order
  44. #endif
  45.  
  46. #ifdef IS_LITTLE_ENDIAN
  47. #define COPY_INT32(_a,_b)  XP_MEMCPY(_a, _b, sizeof(int32));
  48. #else
  49. #define    COPY_INT32(_a,_b)                \
  50.     do {                        \
  51.     ((char *)(_a))[0] = ((char *)(_b))[3];        \
  52.     ((char *)(_a))[1] = ((char *)(_b))[2];        \
  53.     ((char *)(_a))[2] = ((char *)(_b))[1];        \
  54.     ((char *)(_a))[3] = ((char *)(_b))[0];        \
  55.     } while(0)
  56. #endif
  57.  
  58. #if !defined(XP_MAC) && !defined(COPY_INT32)
  59.     #define COPY_INT32(_a,_b)  XP_MEMCPY(_a, _b, sizeof(int32));
  60. #endif
  61.  
  62.  
  63.  
  64. /* hist2rdf.c data structures and defines */
  65.  
  66. #define remoteAddParent(child, parent)   histAddParent(child, parent);
  67. #define remoteAddName(u, name)  remoteStoreAdd(gRemoteStore, u, gCoreVocab->RDF_name, copyString(name), RDF_STRING_TYPE, 1);
  68.  
  69. #define SECS_IN_HOUR            (60L * 60L)
  70. #define SECS_IN_DAY             (SECS_IN_HOUR * 24L)
  71.  
  72.  
  73.  
  74. /* hist2rdf.c function prototypes */
  75.  
  76. XP_BEGIN_PROTOS
  77.  
  78. void        collateHistory (RDF r, RDF_Resource u, PRBool byDateFlag);
  79. void        collateOneHist (RDF r, RDF_Resource u, char* url, char* title, time_t lastAccessDate, time_t firstAccessDate, uint32 numAccesses, PRBool byDateFlag);
  80. RDF_Resource    hostUnitOfURL (RDF r, RDF_Resource top, RDF_Resource nu, char* title);
  81. void        hourRange(char *buffer, struct tm *theTm);
  82. RDF_Resource    hostUnitOfDate (RDF r, RDF_Resource u, time_t lastAccessDate);
  83. void        deleteCurrentSitemaps (char *address);
  84. void        addRelatedLinks (char* address);
  85. PRBool        displayHistoryItem (char* url);
  86. RDF_Resource    HistCreate (char* url, PRBool createp);
  87. Assertion    histAddParent (RDF_Resource child, RDF_Resource parent);
  88. PRBool        historyUnassert (RDFT hst,  RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type);
  89. RDF_Cursor    historyStoreGetSlotValuesInt (RDFT mcf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PRBool inversep, PRBool tv);
  90. PRBool        historyStoreHasAssertion (RDFT mcf, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv);
  91. RDFT        MakeHistoryStore (char* url);
  92. void        dumpHist ();
  93.  
  94. XP_END_PROTOS
  95.  
  96. #endif
  97.