Commit graph

125 commits

Author SHA1 Message Date
bfd14661c5 (ef_close): Reset member fd.
(ef_open): Catch attempt to open open file.
2005-10-23 06:24:08 +00:00
a3dd70f8c0 (EFF_OPEN): New.
(ef_open): Restrict HOW to EFF_OPEN.
2005-10-23 06:17:14 +00:00
Ron Koenderink
898aaf3d3d (empfile, empfile_ca): New struct empfile member ef_uid. 2005-10-22 19:10:22 +00:00
Ron Koenderink
fcf5c59513 (castr,empfile,ship_chr,plane_chr,land_chr,nuke_chr):
Add table index to castr to create a reference to the symbol table.
Add "ship chr flags" table to empfile.
Add "plane chr flags" table to empfile.
Add "land chr flags" table to empfile.
Add "nuke chr flags" table to empfile.
Add EF_SHIP_CHR_FLAGS reference to ship_chr.
Add EF_PLANE_CHR_FLAGS reference to plane_chr.
Add EF_LAND_CHR_FLAGS reference to land_chr.
Add EF_NUKE_CHR_FLAGS reference to nuke_chr.

(show_ship_capab,show_plane_capab,show_land_capab,
show_nuke_capab,ship_flags,land_flags,plane_flags,nuke_flags):
Move ship_flags nsc.c from show.c
Rename ship_flags to ship_chr_flags.
Move plane_flags nsc.c from show.c
Rename plane_flags to plane_chr_flags.
Move land_flags nsc.c from show.c
Rename land_flags to land_chr_flags.
Move nuke_flags nsc.c from show.c
Rename nuke_flags to nuke_chr_flags.
This is to accomodate future symbol table for EF_PLANE table.
2005-10-22 16:39:45 +00:00
Ron Koenderink
cf4faac293 (ef_init): Remove cadef member from fileinit,
insert directly into the empfile structure.
Add ef_type member to fileinit to identify rows with data.
Remove unused rows of fileinit.
2005-10-22 13:55:04 +00:00
Ron Koenderink
29d21997b9 (empfile[]) Add table of tables to empfile[]. 2005-10-22 12:38:58 +00:00
0ab9260151 (empfile, chr_camap): Merge chr_camap[] into empfile[]. No existing
user sees the new elements of empfile[].
(EF_SECTOR_CHR, EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR, EF_NUKE_CHR)
(EF_TREATY_CHR, EF_ITEM, EF_INFRASTRUCTURE, EF_PRODUCT): New.  Not yet
used.
(my_ef_byname): Replacement for ef_byname() that sees the new
elements.
(xdchr): Work with empfile[] instead of chr_camap[].
(xdump): Use my_ef_byname() instead of ef_byname() and
chridx_by_name().
(camap, chr_camap, chridx_by_name): Remove.
2005-10-21 19:38:37 +00:00
ff8c7c249a (empfile): Member itemoffs is unused since file.c rev. 1.15; remove. 2005-09-30 20:02:57 +00:00
03abca9258 Remove leftover declarations that should have been removed along with
the definitions.
2005-09-30 19:40:41 +00:00
326ac671ba (EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets
player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
2005-05-29 14:14:33 +00:00
e27724fbc9 Document implications of EFF_OWNER. 2005-05-28 08:20:07 +00:00
4a67b91f8a Document struct equivalence hack and implications of EFF_XY and
EFF_GROUP.
2005-05-28 08:03:31 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
29da4b6cf4 (empfile, teldir, motdfil, downfil, disablefil, telfil, annfil)
(banfil, authfil, timestampfil): Make file names relative to DATADIR.
(main): emp_server and files change to the data directory.  fairland
has to write newcap_script to the initial current directory, so it
keeps it and makes file names relative to DATADIR absolute.
(fixup_files): Nothing to do, remove.  This fixes the following bug:
fixup_files() formed file names by appending ep->name instead of the
base name of ep->file to datadir.  Thus, fixup_files() changed file
names even when datadir had the compiled-in value.  When emp_config()
couldn't open econfig, it failed to call fixup_files(), and different
file names got used.  Note that with this revision the file names
revert to the names used before fixup_files() was introduced.  Closes
#1146080.
(print_config): Printing file names as comments is not really useful,
remove.
(otherfiles, ofiles): Unused, remove.
(emp_config, main): Previously, pconfig had to call emp_config() even
when it didn't want to read econfig, just to run fixup_files().  This
is no longer necessary.  Simplify.
2005-03-09 18:44:50 +00:00
Marc Olzheim
21761891f0 (EFF_COM,ef_items): No longer in use after removal of 'variables'. Removed.
Clean s_char on the way.
2004-12-16 12:22:58 +00:00
9dbc1cb5e3 Use plain char * instead of s_char *. 2004-09-10 18:18:31 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
dcfd251f95 caddr_t is obsolete. Replace by void *, except for struct empfile
member cache, which becomes char * to keep pointer arithmetic simple.
2004-08-23 18:29:44 +00:00
eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds.
To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
2004-03-03 16:54:22 +00:00
08e182e132 (fileinit): Invalid cast sct_init(); a call couldn't possibly work.
Luckily, it isn't called.  Remove.
(ef_fileinit): Unused, remove.
2004-03-03 10:17:53 +00:00
c53438e7a0 (ef_ensure_space): New.
(edit): Use it to to fix copying to virgin unit slot.  Closes #896475.
From Ron Koenderink.
2004-02-24 18:19:57 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
beba530119 (file_lock, file_unlock, ef_lock, ef_unlock, commlock, communlock):
File locking doesn't make sense, must be a leftover from the distant
past.  Remove.  Callers changed.
2004-01-29 17:07:26 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00