From 47e5b7d01735d130e07e2c8c3be8db667c1b442e Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Mon, 18 Mar 2019 01:03:44 +0000 Subject: core ports and restore script revision --- core/scripts/backup-ports.sh | 130 ++++++++++++++++++++++++++---------------- core/scripts/restore-ports.sh | 4 +- 2 files changed, 83 insertions(+), 51 deletions(-) (limited to 'core/scripts') diff --git a/core/scripts/backup-ports.sh b/core/scripts/backup-ports.sh index b5667e4..bac18e5 100644 --- a/core/scripts/backup-ports.sh +++ b/core/scripts/backup-ports.sh @@ -3,6 +3,9 @@ DEST_SYS=/usr/ports/releases/stable DEST_ARC=/usr/ports/releases/archives +#PACKAGES=/usr/ports/packages +PACKAGES=/usr/ports/archive/packages + #PRT_GET_FLAGS="-fr -if -is" PRT_GET_FLAGS="-fr" @@ -12,90 +15,119 @@ BUILD_NAME="R1D9" #echo "${DEST_ARC}/NAME-0.0.0.targ.gz" #read BUILD_NAME +#internal +database=${DEST_SYS}/pkg-db.tar.gz +ports=${DEST_SYS}/etc-ports.tar.gz +metadata=${DEST_SYS}/metadata.tar.gz +build=${DEST_SYS}/metadata/build-version +portsver=${DEST_SYS}/metadata/ports-releases +all=${DEST_SYS}/metadata/all-installed +collinst=${DEST_SYS}/metadata/installed +notfound=${DEST_SYS}/metadata/not-found + echo "Give build CRUX_RELEASE.VERSION (3.4.X);" echo "${DEST_ARC}/${BUILD_NAME}-VERSION.tar.gz" read BUILD_VERSION mkdir -p ${DEST_SYS} mkdir -p ${DEST_ARC} +mkdir -p ${DEST_SYS}/metadata + +archive="${DEST_ARC}/${BUILD_NAME}-${BUILD_VERSION}.tar" +echo "Creating $archive ..." +if [ -f ${archive} ]; then + rm ${archive} +fi backup_collections() { # backup collection packages while read COLL_VERSION; do - COLL_NAME=$(echo $COLL_VERSION | cut -d "-" -f 1) - COLL_RELEASE=$(echo $COLL_VERSION | cut -d "-" -f 2) - - while read PORT_NAME; do - # get installed version not version on ports - PACKAGE=$(grep "^${PORT_NAME}#" ${DEST_SYS}/all-installed.pkg) - echo "Backing up package: ${PACKAGE}" - - # check if binary package exist - if [ ! -f /usr/ports/packages/${PACKAGE} ]; then - echo "Building package: ${PACKAGE};" - sudo prt-get update ${PRT_GET_FLAGS} ${PORT_NAME} - fi - - if [ -f /usr/ports/packages/${PACKAGE} ]; then - echo ${PACKAGE} >> ${DEST_SYS}/${COLL_NAME}-backup.pkg - tar rvf ${DEST_SYS}/${COLL_NAME}-${COLL_RELEASE}.tar --directory=/usr/ports/packages ${PACKAGE} - else - echo "Package ${PACKAGE} from ${PORT_NAME} port not found." - echo ${PACKAGE} >> ${DEST_SYS}/${COLL_NAME}-${COLL_RELEASE}-notfound.pkg - fi - done < ${DEST_SYS}/${COLL_NAME}-installed.pkg - done < ${DEST_SYS}/ports_versions.pkg + COLL_NAME=$(echo $COLL_VERSION | cut -d "-" -f 1) + COLL_RELEASE=$(echo $COLL_VERSION | cut -d "-" -f 2) + + if [ -f ${DEST_SYS}/${COLL_VERSION}.tar ]; then + rm ${DEST_SYS}/${COLL_VERSION}.tar + fi + + while read PORT_NAME; do + # get installed version not version on ports + PACKAGE=$(grep "^${PORT_NAME}#" ${all}) + + # check if binary package exist + if [ ! -f /usr/ports/packages/${PACKAGE} ]; then + echo "Building package: ${PACKAGE};" + sudo prt-get update ${PRT_GET_FLAGS} ${PORT_NAME} + fi + + if [ -f /usr/ports/packages/${PACKAGE} ]; then + echo ${PACKAGE} >> ${DEST_SYS}/metadata/${COLL_NAME}-backup + tar rvf ${DEST_SYS}/${COLL_VERSION}.tar --directory=${PACKAGES} ${PACKAGE} + else + echo "Package ${PACKAGE} from ${PORT_NAME} port not found." + echo ${PACKAGE} >> ${notfound}-${COLL_VERSION} + fi + done < ${collinst}-${COLL_NAME} + + tar rvf $archive --directory=${DEST_SYS} ${COLL_VERSION}.tar + + done < ${portsver} } create_metadata() { - echo "${BUILD_NAME}-${BUILD_VERSION}" >> ${DEST_SYS}/build_version + + echo "${BUILD_NAME}-${BUILD_VERSION}" > ${build} # archive pkgutils data - tar --xattrs -zcpf ${DEST_SYS}/pkg-db.tar.gz /var/lib/pkg/db . + tar --xattrs -zcpf $database --directory=/var/lib/pkg/ db + tar rvf $archive --directory=${DEST_SYS} $(basename ${database}) # archive ports data - tar --xattrs -zcpf ${DEST_SYS}/etc_ports.tar.gz --directory=/etc/ports . + tar --xattrs -zcpf $ports --directory=/etc/ports . + tar rvf $archive --directory=${DEST_SYS} $(basename ${ports}) # must be using gwak instead of sed - prt-get listinst -v | sed 's/ /#/g' | sed 's/$/.pkg.tar.gz/g' > ${DEST_SYS}/all-installed.pkg + prt-get listinst -v | sed 's/ /#/g' | sed 's/$/.pkg.tar.gz/g' > ${all} - if [ -f ${DEST_SYS}/ports_versions ]; then - rm ${DEST_SYS}/ports_versions.pkg + if [ -f ${portsver} ]; then + rm ${portsver} fi for filename in /etc/ports/*.git; do - source $filename + source $filename + + echo "${NAME} port collection release (exp; ${BUILD_VERSION}):" + + read RELEASE + echo ${NAME}-${RELEASE} >> ${portsver} - echo "${NAME} port collection release (exp; ${BUILD_VERSION}):" + # backup ports collection + echo "Backing up collection: ${NAME}" + tar --xattrs -zcpf ${DEST_SYS}/"ports"-${NAME}-${RELEASE}.tar.gz \ + --directory=/usr/ports/${NAME} \ + --exclude=.git \ + . - read RELEASE - echo ${NAME}-${RELEASE} >> ${DEST_SYS}/ports_versions.pkg + tar rvf $archive --directory=${DEST_SYS} "ports"-${NAME}-${RELEASE}.tar.gz - # backup ports collection - echo "Backing up collection: ${NAME}" - tar --xattrs -zcpf ${DEST_SYS}/${NAME}-ports-${RELEASE}.tar.gz \ - --directory=/usr/ports/${NAME} \ - --exclude=.git/ \ - . + # create list of installed packages + prt-get printf "%i %p %n\n" | grep "yes /usr/ports/${NAME}" | cut -d " " -f 3 > ${collinst}-${NAME} - # create list of installed packages - prt-get printf "%i %p %n\n" | grep "yes /usr/ports/${NAME}" | cut -d " " -f 3 > ${DEST_SYS}/${NAME}-installed.pkg - done +done } create_archive() { - echo "Creating ${DEST_ARC}/${BUILD_NAME}-${BUILD_VERSION}.tar.gz ..." - tar --xattrs -zcpf ${DEST_ARC}/${BUILD_NAME}-${BUILD_VERSION}.tar.gz --directory=${DEST_SYS} . + tar --xattrs -zcpf ${metadata} --directory=${DEST_SYS} metadata/ + tar rvf $archive --directory=${DEST_SYS} $(basename ${metadata}) } update_host() { - echo "Creating links to /usr/ports/installed" - rm -r /usr/ports/installed - pkg_installed + echo "Creating links to /usr/ports/installed" + rm -r /usr/ports/installed + pkg_installed - echo "Creating ports page" - portspage --title=${BUILD_NAME}-${BUILD_VERSION} /usr/ports/installed > /usr/ports/installed/index.html + echo "Creating ports page" + portspage --title=${BUILD_NAME}-${BUILD_VERSION} /usr/ports/installed > /usr/ports/installed/index.html } create_metadata diff --git a/core/scripts/restore-ports.sh b/core/scripts/restore-ports.sh index 39f5178..b53e723 100644 --- a/core/scripts/restore-ports.sh +++ b/core/scripts/restore-ports.sh @@ -19,7 +19,7 @@ extract_archives() { echo "extracting ${COLL_VERSION}.tar to /usr/ports/packages" tar -C /usr/ports/packages -xf ${WORK_DIR}/${COLL_VERSION}.tar rm ${WORK_DIR}/${COLL_VERSION}.tar - done < ${WORK_DIR}/ports_versions.pkg + done < ${WORK_DIR}/metadata/ports-releases } update_system() { @@ -30,7 +30,7 @@ update_system() { while read COLL_VERSION; do COLL_NAME=$(echo $COLL_VERSION | cut -d "-" -f 1) ports -u $COLL_NAME - done < ${WORK_DIR}/ports_versions.pkg + done < ${WORK_DIR}/metadata/ports-releases # first update with prt-get prt-get sysup -- cgit 1.4.1-2-gfad0 ey <dickey@invisible-island.net> 1998-02-05 17:00:19 -0500 committer Thomas E. Dickey <dickey@invisible-island.net> 1998-02-05 17:00:19 -0500 snapshot of project "lynx", label v2-7-1ac-0_113' href='/ingrix/lynx-snapshots/commit/WWW/Library/Implementation/HTAnchor.h?id=4b034492d7e0a45781e340312e0570e5052c42d9'>4b034492 ^
e087f6d4





4b034492 ^
af9be28b ^
e087f6d4



4b034492 ^

e087f6d4

4b034492 ^


e087f6d4

4b034492 ^
e087f6d4



4b034492 ^


e087f6d4

4b034492 ^





6bd78b38 ^
4b034492 ^
e087f6d4
4b034492 ^





8f8c57cc ^
945e8eb6 ^

e087f6d4
4b034492 ^



e087f6d4
4b034492 ^
c3ec4181 ^
e087f6d4
6bd78b38 ^
e087f6d4

6bd78b38 ^






4b034492 ^
6bd78b38 ^


4b034492 ^

b63d287c ^
e087f6d4



4b034492 ^


e087f6d4

4b034492 ^
e087f6d4

c3ec4181 ^



e087f6d4



6bd78b38 ^
e087f6d4
c3ec4181 ^
e087f6d4

945e8eb6 ^





4b034492 ^

e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^


e087f6d4
4b034492 ^

e087f6d4
4b034492 ^


e087f6d4
c3ec4181 ^

4b034492 ^
c3ec4181 ^

e087f6d4
4b034492 ^

e087f6d4
4b034492 ^



e087f6d4
c3ec4181 ^

e087f6d4
4b034492 ^

e087f6d4
4b034492 ^




e087f6d4
c3ec4181 ^

e087f6d4
4b034492 ^

e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^
4b034492 ^
e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^

e087f6d4
c3ec4181 ^


e087f6d4
c3ec4181 ^

e087f6d4
e087f6d4
c3ec4181 ^


e087f6d4

4b034492 ^

e087f6d4
c3ec4181 ^




















945e8eb6 ^


c3ec4181 ^

e087f6d4
8f8c57cc ^
945e8eb6 ^







4b034492 ^
e087f6d4
c3ec4181 ^

e087f6d4
c3ec4181 ^


e087f6d4
c3ec4181 ^


e087f6d4
6bd78b38 ^

c3ec4181 ^

6bd78b38 ^
c3ec4181 ^


6bd78b38 ^
4b034492 ^
e087f6d4
c3ec4181 ^

e087f6d4
c3ec4181 ^


e087f6d4
4b034492 ^
e087f6d4
c3ec4181 ^

e087f6d4
c3ec4181 ^


e087f6d4
6bd78b38 ^
fbcb509d ^

6bd78b38 ^
c3ec4181 ^

6bd78b38 ^
fbcb509d ^











6bd78b38 ^

c3ec4181 ^

6bd78b38 ^


c3ec4181 ^

6bd78b38 ^


c3ec4181 ^
















6bd78b38 ^
4b034492 ^

e087f6d4
c3ec4181 ^



e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^

e087f6d4
c3ec4181 ^


e087f6d4
c3ec4181 ^


e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^

e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^





e087f6d4
4b034492 ^

e087f6d4
c3ec4181 ^





e087f6d4
4b034492 ^


e087f6d4
4b034492 ^








e4409c40 ^
4b034492 ^
















b63d287c ^

4b034492 ^


e087f6d4


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
                                                                                             

   

                                                                               
  

                                                                             







                                                                       


                   

                  






























                                                        





                                                                      
                                        
                     



                          

                                                                    

         


                                                                           

                                                                               
                                                                             



                                                     


                                                                           

                                         





                                                                                 
                                                      
                                                                       
                                                                               





                                                                             
               

                      
 



                                                                         
                                                                    
                                                                             
                                                  
                                                                
                                                        

                                                                               






                                                                   
                                                            


                                                           

                                                              
                                                                    



                                                     


                                                                           

                                        
                                                                               

                



                                                                        



                             
                    
                  
                

             





                                                                       

                                         
  

                                                                  
  


                                                  
 

                                                          
  


                                                                   
  

                                                         
                                                    

                                                    
 

                                           
  



                                                                              
  

                                               
 

                                                                              
  




                                                                                
  

                                     
 

                                                                      
  

                                                                         
  
                                           
                                     
 

                             
  

                                                
 


                                         
 

                                            
 
                                                                         


                                        

  

                                                           
  




















                                         


                                           

                                         
 
                     







                                           
                       
  

                                           
 


                                        
 


                                         
 

                          

                                              
 


                                           
 
                       
  

                                           
 


                                        
 
                                                                    
  

                                              
 


                                         
 
                                         

                                                          
  

                                              
 











                                                      

                                           

                                                   


                                  

                                          


                                    
















                                                      
 

                                             
  



                                            
 

                             
  

                                                  
 


                                                   
 


                                             
 

                              
  

                                         
 

                
  





                                           
 

                        
  





                                           
 


                                                     
 








                                                     
 
















                                                       

                                                      


                       


      
/*		   /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTAnchor.html
 */

/*	Hypertext "Anchor" Object				     HTAnchor.h
**	==========================
**
**	An anchor represents a region of a hypertext document which is linked
**	to another anchor in the same or a different document.
*/

#ifndef HTANCHOR_H
#define HTANCHOR_H

/* Version 0 (TBL) written in Objective-C for the NeXT browser */
/* Version 1 of 24-Oct-1991 (JFG), written in C, browser-independant */

#include <HTList.h>
#include <HTAtom.h>
#include <UCDefs.h>

#ifdef SHORT_NAMES
#define HTAnchor_findChild			HTAnFiCh
#define HTAnchor_findChildAndLink		HTAnFiLi
#define HTAnchor_findAddress			HTAnFiAd
#define HTAnchor_delete 			HTAnDele
#define HTAnchor_makeLastChild			HTAnMaLa
#define HTAnchor_parent 			HTAnPare
#define HTAnchor_setDocument			HTAnSeDo
#define HTAnchor_document			HTAnDocu
#define HTAnchor_setFormat			HTAnSeFo
#define HTAnchor_format 			HTAnForm
#define HTAnchor_setIndex			HTAnSeIn
#define HTAnchor_setPrompt			HTAnSePr
#define HTAnchor_isIndex			HTAnIsIn
#define HTAnchor_address			HTAnAddr
#define HTAnchor_hasChildren			HTAnHaCh
#define HTAnchor_title				HTAnTitl
#define HTAnchor_setTitle			HTAnSeTi
#define HTAnchor_appendTitle			HTAnApTi
#define HTAnchor_link				HTAnLink
#define HTAnchor_followMainLink 		HTAnFoMa
#define HTAnchor_followTypedLink		HTAnFoTy
#define HTAnchor_makeMainLink			HTAnMaMa
#define HTAnchor_setProtocol			HTAnSePr
#define HTAnchor_protocol			HTAnProt
#define HTAnchor_physical			HTAnPhys
#define HTAnchor_setPhysical			HTAnSePh
#define HTAnchor_methods			HtAnMeth
#endif /* SHORT_NAMES */

/*			Main definition of anchor
**			=========================
*/

typedef struct _HyperDoc HyperDoc;  /* Ready for forward references */
typedef struct _HTAnchor HTAnchor;
typedef struct _HTParentAnchor HTParentAnchor;

/*	After definition of HTFormat: */
#include <HTFormat.h>

typedef HTAtom HTLinkType;

typedef struct {
  HTAnchor *	dest;		/* The anchor to which this leads */
  HTLinkType *	type;		/* Semantics of this link */
} HTLink;

struct _HTAnchor {		/* Generic anchor : just links */
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;		/* List of extra links from this, if any */
  /* We separate the first link from the others to avoid too many small mallocs
     involved by a list creation. Most anchors only point to one place. */
  HTParentAnchor * parent;	/* Parent of this anchor (self for adults) */
};

struct _HTParentAnchor {
  /* Common part from the generic anchor structure */
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;		/* List of extra links from this, if any */
  HTParentAnchor * parent;	/* Parent of this anchor (self) */

  /* ParentAnchor-specific information */
  HTList *	children;	/* Subanchors of this, if any */
  HTList *	sources;	/* List of anchors pointing to this, if any */
  HyperDoc *	document;	/* The document within which this is an anchor */
  char *	address;	/* Absolute address of this node */
  char *	post_data;	/* Posting data */
  char *	post_content_type;  /* Type of post data */
  char *	bookmark;	/* Bookmark filname */
  HTFormat	format; 	/* Pointer to node format descriptor */
  char *	charset;	/* Pointer to character set (kludge, for now */
  BOOL		isIndex;	/* Acceptance of a keyword search */
  char *	isIndexAction;	/* URL of isIndex server */
  char *	isIndexPrompt;	/* Prompt for isIndex query */
  char *	title;		/* Title of document */
  char *	owner;		/* Owner of document */
  char *	RevTitle;	/* TITLE in REV="made" or REV="owner" LINK */
#ifdef USE_HASH
  char *	style;
#endif

  HTList*	methods;	/* Methods available as HTAtoms */
  void *	protocol;	/* Protocol object */
  char *	physical;	/* Physical address */
  BOOL		underway;	/* Document about to be attached to it */
  BOOL		isISMAPScript;	/* Script for clickable image map */
  BOOL		isHEAD; 	/* Document is headers from a HEAD request */
  BOOL		safe;			/* Safe */
  char *	FileCache;	/* Path to a disk-cached copy */
  char *	SugFname;	/* Suggested filename */
  char *	cache_control;	/* Cache-Control */
  BOOL		no_cache;	/* Cache-Control, Pragma or META "no-cache"? */
  char *	content_type;		/* Content-Type */
  char *	content_language;	/* Content-Language */
  char *	content_encoding;	/* Compression algorithm */
  char *	content_base;		/* Content-Base */
  char *	content_disposition;	/* Content-Dispositon */
  char *	content_location;	/* Content-Location */
  char *	content_md5;		/* Content-MD5 */
  int		content_length; 	/* Content-Length */
  char *	date;			/* Date */
  char *	expires;		/* Expires */
  char *	last_modified;		/* Last-Modified */
  char *	server; 		/* Server */
  UCAnchorInfo *UCStages;		/* chartrans stages */
  HTList *	imaps;			/* client side image maps */
};

typedef struct {
  /* Common part from the generic anchor structure */
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;		/* List of extra links from this, if any */
  HTParentAnchor * parent;	/* Parent of this anchor */

  /* ChildAnchor-specific information */
  char *	tag;		/* Address of this anchor relative to parent */
} HTChildAnchor;

/*
**  DocAddress structure is used for loading an absolute anchor with all
**  needed information including posting data and post content type.
*/
typedef struct _DocAddress {
    char * address;
    char * post_data;
    char * post_content_type;
    char * bookmark;
    BOOL   isHEAD;
    BOOL   safe;
} DocAddress;

/* "internal" means "within the same document, with certainty".
   It includes a space so it cannot conflict with any (valid) "TYPE"
   attributes on A elements. [According to which DTD, anyway??] - kw */

#define LINK_INTERNAL HTAtom_for("internal link")

/*	Create new or find old sub-anchor
**	---------------------------------
**
**	This one is for a new anchor being edited into an existing
**	document. The parent anchor must already exist.
*/
extern HTChildAnchor * HTAnchor_findChild PARAMS((
	HTParentAnchor *	parent,
	CONST char *		tag));

/*	Create or find a child anchor with a possible link
**	--------------------------------------------------
**
**	Create new anchor with a given parent and possibly
**	a name, and possibly a link to a _relatively_ named anchor.
**	(Code originally in ParseHTML.h)
*/
extern HTChildAnchor * HTAnchor_findChildAndLink PARAMS((
      HTParentAnchor * parent,	/* May not be 0 */
      CONST char * tag, 	/* May be "" or 0 */
      CONST char * href,	/* May be "" or 0 */
      HTLinkType * ltype));	/* May be 0 */

/*	Create new or find old named anchor
**	-----------------------------------
**
**	This one is for a reference which is found in a document, and might
**	not be already loaded.
**	Note: You are not guaranteed a new anchor -- you might get an old one,
**	like with fonts.
*/
extern HTAnchor * HTAnchor_findAddress PARAMS((
	CONST DocAddress *	address));

/*	Delete an anchor and possibly related things (auto garbage collection)
**	--------------------------------------------
**
**	The anchor is only deleted if the corresponding document is not loaded.
**	All outgoing links from parent and children are deleted, and this anchor
**	is removed from the sources list of all its targets.
**	We also try to delete the targets whose documents are not loaded.
**	If this anchor's source list is empty, we delete it and its children.
*/
extern BOOL HTAnchor_delete PARAMS((
	HTParentAnchor *	me));

/*		Move an anchor to the head of the list of its siblings
**		------------------------------------------------------
**
**	This is to ensure that an anchor which might have already existed
**	is put in the correct order as we load the document.
*/
extern void HTAnchor_makeLastChild PARAMS((
	HTChildAnchor * 	me));

/*	Data access functions
**	---------------------
*/
extern HTParentAnchor * HTAnchor_parent PARAMS((
	HTAnchor *		me));

extern void HTAnchor_setDocument PARAMS((
	HTParentAnchor *	me,
	HyperDoc *		doc));

extern HyperDoc * HTAnchor_document PARAMS((
	HTParentAnchor *	me));

/* We don't want code to change an address after anchor creation... yet ?
extern void HTAnchor_setAddress PARAMS((
	HTAnchor *		me,
	char *			addr));
*/

/*	Returns the full URI of the anchor, child or parent
**	as a malloc'd string to be freed by the caller.
*/
extern char * HTAnchor_address PARAMS((
	HTAnchor *		me));

extern void HTAnchor_setFormat PARAMS((
	HTParentAnchor *	me,
	HTFormat		form));

extern HTFormat HTAnchor_format PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setIndex PARAMS((
	HTParentAnchor *	me,
	char *		address));

extern void HTAnchor_setPrompt PARAMS((
	HTParentAnchor *	me,
	char *			prompt));

extern BOOL HTAnchor_isIndex PARAMS((
	HTParentAnchor *	me));

extern BOOL HTAnchor_isISMAPScript PARAMS((
	HTAnchor *		me));

extern BOOL HTAnchor_hasChildren PARAMS((
	HTParentAnchor *	me));

#if defined(USE_HASH)
extern CONST char * HTAnchor_style PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setStyle PARAMS((
	HTParentAnchor *	me,
	CONST char *		style));
#endif

/*	Title handling.
*/
extern CONST char * HTAnchor_title PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setTitle PARAMS((
	HTParentAnchor *	me,
	CONST char *		title));

extern void HTAnchor_appendTitle PARAMS((
	HTParentAnchor *	me,
	CONST char *		title));

/*	Bookmark handling.
*/
extern CONST char * HTAnchor_bookmark PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setBookmark PARAMS((
	HTParentAnchor *	me,
	CONST char *		bookmark));

/*	Owner handling.
*/
extern CONST char * HTAnchor_owner PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setOwner PARAMS((
	HTParentAnchor *	me,
	CONST char *		owner));

/*	TITLE handling in LINKs with REV="made" or REV="owner". - FM
*/
extern CONST char * HTAnchor_RevTitle PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setRevTitle PARAMS((
	HTParentAnchor *	me,
	CONST char *		title));

/*	Suggested filename handling. - FM
**	(will be loaded if we had a Content-Disposition
**	 header or META element with filename=name.suffix)
*/
extern CONST char * HTAnchor_SugFname PARAMS((
	HTParentAnchor *	me));

/*	Content-Type handling. - FM
*/
extern CONST char * HTAnchor_content_type PARAMS((
	HTParentAnchor *	me));

/*	Content-Encoding handling. - FM
**	(will be loaded if we had a Content-Encoding
**	 header.)
*/
extern CONST char * HTAnchor_content_encoding PARAMS((
	HTParentAnchor *	me));

/*	Last-Modified header handling. - FM
*/
extern CONST char * HTAnchor_last_modified PARAMS((
	HTParentAnchor *	me));

/*	Date header handling. - FM
*/
extern CONST char * HTAnchor_date PARAMS((
	HTParentAnchor *	me));

/*	Server header handling. - FM
*/
extern CONST char * HTAnchor_server PARAMS((
	HTParentAnchor *	me));

/*	Safe header handling. - FM
*/
extern BOOL HTAnchor_safe PARAMS((
	HTParentAnchor *	me));

/*	Content-Base header handling. - FM
*/
extern CONST char * HTAnchor_content_base PARAMS((
	HTParentAnchor *	me));

/*	Content-Location header handling. - FM
*/
extern CONST char * HTAnchor_content_location PARAMS((
	HTParentAnchor *	me));

/*	Link this Anchor to another given one
**	-------------------------------------
*/
extern BOOL HTAnchor_link PARAMS((
	HTAnchor *		source,
	HTAnchor *		destination,
	HTLinkType *		type));

/*	Manipulation of links
**	---------------------
*/
extern HTAnchor * HTAnchor_followMainLink PARAMS((
	HTAnchor *		me));

extern HTAnchor * HTAnchor_followTypedLink PARAMS((
	HTAnchor *		me,
	HTLinkType *		type));

extern BOOL HTAnchor_makeMainLink PARAMS((
	HTAnchor *		me,
	HTLink *		movingLink));

/*	Read and write methods
**	----------------------
*/
extern HTList * HTAnchor_methods PARAMS((
	HTParentAnchor *	me));

/*	Protocol
**	--------
*/
extern void * HTAnchor_protocol PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setProtocol PARAMS((
	HTParentAnchor *	me,
	void *			protocol));

/*	Physical address
**	----------------
*/
extern char * HTAnchor_physical PARAMS((
	HTParentAnchor *	me));

extern void HTAnchor_setPhysical PARAMS((
	HTParentAnchor *	me,
	char *			protocol));

extern LYUCcharset * HTAnchor_getUCInfoStage PARAMS((
	HTParentAnchor *	me,
	int			which_stage));

extern int HTAnchor_getUCLYhndl PARAMS((
	HTParentAnchor *	me,
	int			which_stage));

extern LYUCcharset * HTAnchor_setUCInfoStage PARAMS((
	HTParentAnchor *	me,
	int			LYhndl,
	int			which_stage,
	int			set_by));

extern LYUCcharset * HTAnchor_setUCInfoStage PARAMS((
	HTParentAnchor *	me,
	int			LYhndl,
	int			which_stage,
	int			set_by));

extern LYUCcharset * HTAnchor_resetUCInfoStage PARAMS((
	HTParentAnchor *	me,
	int			LYhndl,
	int			which_stage,
	int			set_by));

extern LYUCcharset * HTAnchor_copyUCInfoStage PARAMS((
	HTParentAnchor *	me,
	int			to_stage,
	int			from_stage,
	int			set_by));

extern void ImageMapList_free PARAMS((HTList * list));

#endif /* HTANCHOR_H */

/*

    */