DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/* * xlink.c : implementation of the hyperlinks detection module * This version supports both XML XLinks and HTML simple links * * See Copyright for the status of this software. * * daniel@veillard.com */ #define IN_LIBXML #include "libxml.h" #ifdef LIBXML_XPTR_ENABLED #include
/* for memset() only */ #ifdef HAVE_CTYPE_H #include
#endif #ifdef HAVE_STDLIB_H #include
#endif #ifdef HAVE_SYS_STAT_H #include
#endif #ifdef HAVE_FCNTL_H #include
#endif #ifdef HAVE_UNISTD_H #include
#endif #ifdef HAVE_ZLIB_H #include
#endif #include
#include
#include
#include
#include
#include
#define XLINK_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xlink/namespace/") #define XHTML_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xhtml/") /**************************************************************** * * * Default setting and related functions * * * ****************************************************************/ static xlinkHandlerPtr xlinkDefaultHandler = NULL; static xlinkNodeDetectFunc xlinkDefaultDetect = NULL; /** * xlinkGetDefaultHandler: * * Get the default xlink handler. * * Returns the current xlinkHandlerPtr value. */ xlinkHandlerPtr xlinkGetDefaultHandler(void) { return(xlinkDefaultHandler); } /** * xlinkSetDefaultHandler: * @handler: the new value for the xlink handler block * * Set the default xlink handlers */ void xlinkSetDefaultHandler(xlinkHandlerPtr handler) { xlinkDefaultHandler = handler; } /** * xlinkGetDefaultDetect: * * Get the default xlink detection routine * * Returns the current function or NULL; */ xlinkNodeDetectFunc xlinkGetDefaultDetect (void) { return(xlinkDefaultDetect); } /** * xlinkSetDefaultDetect: * @func: pointer to the new detection routine. * * Set the default xlink detection routine */ void xlinkSetDefaultDetect (xlinkNodeDetectFunc func) { xlinkDefaultDetect = func; } /**************************************************************** * * * The detection routines * * * ****************************************************************/ /** * xlinkIsLink: * @doc: the document containing the node * @node: the node pointer itself * * Check whether the given node carries the attributes needed * to be a link element (or is one of the linking elements issued * from the (X)HTML DtDs). * This routine don't try to do full checking of the link validity * but tries to detect and return the appropriate link type. * * Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no * link detected. */ xlinkType xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { xmlChar *type = NULL, *role = NULL; xlinkType ret = XLINK_TYPE_NONE; if (node == NULL) return(XLINK_TYPE_NONE); if (doc == NULL) doc = node->doc; if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) { /* * This is an HTML document. */ } else if ((node->ns != NULL) && (xmlStrEqual(node->ns->href, XHTML_NAMESPACE))) { /* * !!!! We really need an IS_XHTML_ELEMENT function from HTMLtree.h @@@ */ /* * This is an XHTML element within an XML document * Check whether it's one of the element able to carry links * and in that case if it holds the attributes. */ } /* * We don't prevent a-priori having XML Linking constructs on * XHTML elements */ type = xmlGetNsProp(node, BAD_CAST"type", XLINK_NAMESPACE); if (type != NULL) { if (xmlStrEqual(type, BAD_CAST "simple")) { ret = XLINK_TYPE_SIMPLE; } if (xmlStrEqual(type, BAD_CAST "extended")) { role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE); if (role != NULL) { xmlNsPtr xlink; xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE); if (xlink == NULL) { /* Humm, fallback method */ if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset")) ret = XLINK_TYPE_EXTENDED_SET; } else { xmlChar buf[200]; snprintf((char *) buf, sizeof(buf), "%s:external-linkset", (char *) xlink->prefix); buf[sizeof(buf) - 1] = 0; if (xmlStrEqual(role, buf)) ret = XLINK_TYPE_EXTENDED_SET; } } ret = XLINK_TYPE_EXTENDED; } } if (type != NULL) xmlFree(type); if (role != NULL) xmlFree(role); return(ret); } #endif /* LIBXML_XPTR_ENABLED */ #define bottom_xlink #include "elfgcchack.h"
xlink.c
Page URL
File URL
Prev
97/114
Next
Download
( 4 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.