Add externs to avoid multiple definitions, and then add missing definitions.
[rrq/maintain_lilo.git] / src / map.h
1 /* map.c  -  Map file creation
2  * 
3  * Copyright 1992-1998 Werner Almesberger
4  * Copyright 1999-2004 John Coffman
5  * Copyright 2009-2011 Joachim Wiedorn
6  * All rights reserved.
7  * 
8  * Licensed under the terms contained in the file 'COPYING'
9  * in the source directory.
10  */
11
12 #ifndef MAP_H
13 #define MAP_H
14
15
16 #ifndef SEEK_SET
17 #define SEEK_SET 0
18 #endif
19 #ifndef SEEK_CUR
20 #define SEEK_CUR 1
21 #endif
22 #ifndef SEEK_END
23 #define SEEK_END 2
24 #endif
25
26
27 void map_patch_first(char *name,char *str);
28 /* Puts str into the first sector of a map file. */
29
30 void map_create(char *name);
31 /* Create and initialize the specified map file. */
32
33 void map_descrs(DESCR_SECTORS *descr, SECTOR_ADDR* addr, SECTOR_ADDR* dflcmd);
34 /* Updates map file with descriptors & default command line */
35
36 void map_close(BOOT_PARAMS_2 *param2, off_t here);
37 /* closes the map file, write second stage parameters */
38
39 void map_add_sector(void *sector);
40 /* Adds the specified sector to the map file and registers it in the map
41    section. */
42
43 void map_begin_section(void);
44 /* Begins a map section. Note: maps can also be written to memory with 
45    map_write. Thus, the map routines can be used even without map_create. */
46
47 void map_add(GEOMETRY *geo,int from,int num_sect);
48 /* Adds pointers to sectors from the specified file to the map file, starting
49    "from" sectors from the beginning. */
50
51 void map_add_zero(void);
52 /* Adds a zero-filled sector to the current section. */
53
54 int map_end_section(SECTOR_ADDR *addr,int dont_compact);
55 /* Writes a map section to the map file and returns the address of the first
56    sector of that section. The first DONT_COMPACT sectors are never compacted.
57    Returns the number of sectors that have been mapped. */
58
59 #ifdef LCF_FIRST6
60 int map_write(SECTOR_ADDR *list,int max_len,int terminate,int sa6);
61 #else
62 int map_write(SECTOR_ADDR *list,int max_len,int terminate);
63 #endif
64 /* Writes a map section to an array. If terminate is non-zero, a terminating
65    zero entry is written. If the section (including the terminating zero entry)
66    exceeds max_len sectors, map_write dies. */
67
68 off_t map_insert_file(GEOMETRY *geo, int skip, int sectors);
69 /* Copies a file (second stage loader, usually) into the map file, skipping
70    'skip' sectors at the beginning, and writing 'sectors' sectors.  The 
71    sectors are added to the current map section. */
72    
73 off_t map_insert_data(unsigned char *data, int size);
74 /* Copies data from an internal array into the map file.  The sectors
75    are added to the current map section */
76
77    
78 #endif