DELTA 8038 14160 4028
SVN  Á&í!ÉW e " ]p  i rR 'KE f{ v\ G \ &Ū&Ū ŊI ~ąa Dą~b Jģ Ŋ G 	 Zđ6h "ŋS G e G  G n G g G i G i G o G m G ~Á	fdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <stdlib.h>		/* size_t */
#include <string.h>		/* memset */
#include <time.h>		/* time_t */

/* utility */
#include "log.h"
#include "support.h" /* bool, fc__attribute */

/* Changing these will break network compatability! */PATH   enum fc_tristate { TRI_NO, TRI_YES, TRI_MAYBE };
#define BOOL_TO_TRISTATE(tri) ((tri) ? TRI_YES : TRI_NO)current,upper) \
    ((current)<(lower)?(lower):(current)>(upper)?(upper):(currentBOOL_VAL(p) != BOOL_VAL(q))
#define EQ(p, q) (BOOL_VAL(p) == BOOL_VAL#define FC_MEMBER(type, member) (((type *) NULL)->member)
#define FC_MEMBER_OFFSETOF(type, member) ((size_t) &FC_MEMBER(type, member))
#define FC_MEMBER_SIZEOF(type, member) sizeof(FC_MEMBER(type, member))
#define FC_MEMBER_ARRAY_SIZE(type, member) \
  ARRAY_SIZE(FC_MEMBER(type, member))

#define FC_INT_TO_PTR(i) ((void *) (intptr_t) (i))
#define FC_PTR_TO_INT(p) ((int) (intptr_t) (p))
#define FC_UINT_TO_PTR(u) ((void *) (intptr_t) (u))
#define FC_PTR_TO_UINT(p) ((unsigned int) (intptr_t) (p))
#define FC_SIZE_TO_PTR(s) ((void *) (intptr_t) (s))
#define FC_PTR_TO_SIZE(p) ((size_t) (intptr_t) (p))

******
  Used to initialize an array 'a' of size 'size' with value 'val' in each
  element. Note that the value is evaluated for each element.
****************************************************************************/
#define INITIALIZE_ARRAY(array, size, value)				    \
  {									    \
    int _ini_index;							    \
    									    \
    for (_ini_index = 0; _ini_index < (size); _ini_index++) {		    \
      (array)[_ini_index] = (value);					    \
    }									    \
  }

char *create_centered_string(const char *s);

char *get_option_malloc(const char *option_name,
			char **argv, int *i, void free_tokens(char **tokens, size_t ntokensascii_name(const char *name);
bool is_base64url(const char *s);
bool is_safe_filename(const char *name);
void randomize_base64url_string(char *s, size_t n);
int compare_strings_strvec(const char *const *first,
                           const char *constspaces(char *s);
void remove_trailing_spaces(char *s);
void remove_leading_trailing_spaces(char *s
bool str_to_int(const char *str, int *pint);

****
...
**************************************************************************/
struct fileinfo {
  char *name;           /* descriptive file name string */
  char *fullname;       /* full absolute filename */
  time_t mtime;         /* last modification time  */
};

#define SPECLIST_TAG fileinfo
#define SPECLIST_TYPE struct fileinfo
#include "speclist.h"
#define fileinfo_list_iterate(list, pnode) \
  TYPED_LIST_ITERATE(struct fileinfo, list, pnode)
#define fileinfo_list_iterate_end LIST_ITERATE_END

char *user_home_dir(void);
void free_user_home_dir(void);
char *user_username(char *buf, size_t bufsz);

const struct strvec *get_data_dirs(void);
const struct strvec *get_save_dirs(void);
const struct strvec *get_scenario_dirs(void);

void free_data_dir_names(void);

struct strvec *fileinfolist(const struct strvec *dirs, const char *suffix);
struct fileinfo_list *fileinfolist_infix(const struct strvec *dirs,
                                         const char *infix, bool nodups);
const char *fileinfoname(const struct strvec *dirs, const char *filename);
void free_fileinfo_data(void);

char *get_langname(void);
void init_nls(void);
void free/* function type to calculate effective string length: */
typedef size_t (m_strlen_fn_t)(const char *str                               m_strlen_fn_t len_fn,
			       const char *prefix,
			       int *ind_result);
enum m_pre_result match_prefix_full(m_pre_accessor_fn_t accessor_fn,
                                    size_t n_names,
                                    size_t max_len_name,
                                    m_pre_strncmp_fn_t cmp_fn,
                                    m_strlen_fn_t len_fn,
                                    const char *prefix,
                                    int *ind_result,
                                    int *matches,
                                    int max_matches,
                                    int *pnum_matches);

char *get_multicast_group(bool ipv6_prefered);
void free_multicast_group(void);
void interpret_tilde(char* buf, size_t buf_size, const char* filename);
char *interpret_tilde_alloc(const char* filename);
char *skip_to_basename(char *filepath);

bool make_dir(const char *pathname);
bool path_is_absolute(const char *filename);

char scanin(const char **buf, char *delimiters, char *dest, int size);

void array_shuffle(int *array, int n);

void format_time_duration(time_t t, char *buf, int maxlen);

bool wildcard_fit_string(const char *pattern, const char *test);

/* Custom format strings. */
struct cf_sequence;

int fc_snprintcf(char *buf, size_t buf_len, const char *format, ...)
     fc__attribute((nonnull (1, 3)));   /* Not a printf format. */
int fc_vsnprintcf(char *buf, size_t buf_len, const char *format,
                  const struct cf_sequence *sequences, size_t sequences_num)
     fc__attribute((nonnull (1, 3, 4)));

/* Tools for fc_snprintcf(). */
static inline struct cf_sequence cf_bool_seq(char letter, bool value);
static inline struct cf_sequence cf_trans_bool_seq(char letter, bool value);
static inline struct cf_sequence cf_char_seq(char letter, char value);
static inline struct cf_sequence cf_int_seq(char letter, int value);
static inline struct cf_sequence cf_hexa_seq(char letter, int value);
static inline struct cf_sequence cf_float_seq(char letter, float value);
static inline struct cf_sequence cf_ptr_seq(char letter, const void *value);
static inline struct cf_sequence cf_str_seq(char letter, const char *value);
static inline struct cf_sequence cf_end(void);

enum cf_type {
  CF_BOOLEAN,
  CF_TRANS_BOOLEAN,
  CF_CHARACTER,
  CF_INTEGER,
  CF_HEXA,
  CF_FLOAT,
  CF_POINTER,
  CF_STRING,

  CF_LAST = -1
};

struct cf_sequence {
  enum cf_type type;
  char letter;
  union {
    bool bool_value;
    char char_value;
    int int_value;
    float float_value;
    const void *ptr_value;
    const char *str_value;
  };
};

******
  Build an argument for fc_snprintcf() of boolean type.
****************************************************************************/
static inline struct cf_sequence cf_bool_seq(char letter, bool value)
{
  struct cf_sequence sequence;

  sequence.type = CF_BOOLEAN;
  sequence.letter = letter;
  sequence.bool_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of boolean type (result will be
  translated).
****************************************************************************/
static inline struct cf_sequence cf_trans_bool_seq(char letter, bool value)
{
  struct cf_sequence sequence;

  sequence.type = CF_TRANS_BOOLEAN;
  sequence.letter = letter;
  sequence.bool_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of character type (%c).
****************************************************************************/
static inline struct cf_sequence cf_char_seq(char letter, char value)
{
  struct cf_sequence sequence;

  sequence.type = CF_CHARACTER;
  sequence.letter = letter;
  sequence.char_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of integer type (%d).
****************************************************************************/
static inline struct cf_sequence cf_int_seq(char letter, int value)
{
  struct cf_sequence sequence;

  sequence.type = CF_INTEGER;
  sequence.letter = letter;
  sequence.int_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of hexadecimal type (%x).
****************************************************************************/
static inline struct cf_sequence cf_hexa_seq(char letter, int value)
{
  struct cf_sequence sequence;

  sequence.type = CF_HEXA;
  sequence.letter = letter;
  sequence.int_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of float type (%f).
****************************************************************************/
static inline struct cf_sequence cf_float_seq(char letter, float value)
{
  struct cf_sequence sequence;

  sequence.type = CF_FLOAT;
  sequence.letter = letter;
  sequence.float_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of pointer type (%p).
****************************************************************************/
static inline struct cf_sequence cf_ptr_seq(char letter, const void *value)
{
  struct cf_sequence sequence;

  sequence.type = CF_POINTER;
  sequence.letter = letter;
  sequence.ptr_value = value;

  return sequence;
}

******
  Build an argument for fc_snprintcf() of string type (%s).
****************************************************************************/
static inline struct cf_sequence cf_str_seq(char letter, const char *value)
{
  struct cf_sequence sequence;

  sequence.type = CF_STRING;
  sequence.letter = letter;
  sequence.str_value = value;

  return sequence;
}

******
  Must finish the list of the arguments of fc_snprintcf().
****************************************************************************/
static inline struct cf_sequence cf_end(void)
{
  struct cf_sequence sequence;

  sequence.type = CF_LAST;

  return sequence;
}

bool formats_match(const char *format1, const char *format2);

#ifdef __cplusplus
}
#endif /* __cplusplus */ENDREP
id: 1d.5qi.r29760/9634
type: file
pred: 1d.5qi.r29369/6539
count: 192
text: 29760 0 9605 13964 99a6243747a601c92f2ab3973a5f769e
props: 10717 817 112 0 a00d30a519ad77ac91be0933c5118bd6
cpath: /branches/S2_6/utility/shared.h
copyroot: 27474 /branches/S2_6

PLAIN
K 11
Makefile.am
V 25
file 2gg.5ck.r26188/18425
K 9
astring.c
V 23
file h5.5ck.r22395/1264
K 9
astring.h
V 23
file h6.5ck.r20479/1668
K 11
bitvector.c
V 25
file 4un.5ck.r26905/46406
K 11
bitvector.h
V 25
file 4uo.5qi.r28013/32595
K 12
capability.c
V 24
file 7p.5ck.r24916/10883
K 12
capability.h
V 24
file 7q.5ck.r18858/85852
K 12
distribute.c
V 26
file 2lp.5ck.r19259/362511
K 12
distribute.h
V 25
file 2lq.5ck.r18858/87951
K 9
fc_utf8.c
V 23
file 4ku.5ck.r26944/198
K 9
fc_utf8.h
V 25
file 4kv.5ck.r26905/46695
K 13
fcbacktrace.c
V 22
file 731.5ck.r26959/58
K 13
fcbacktrace.h
V 25
file 732.5ck.r26905/45245
K 9
fciconv.c
V 25
file 2g7.5ck.r26800/15337
K 9
fciconv.h
V 25
file 2g8.5ck.r18858/89144
K 8
fcintl.c
V 24
file k3.5qi.r29620/12430
K 8
fcintl.h
V 24
file fw.5qi.r29620/12681
K 10
fcthread.c
V 24
file 6hv.5ck.r27333/1127
K 10
fcthread.h
V 23
file 6hw.5ck.r27333/886
K 20
generate_specenum.py
V 23
file 4ia.5ck.r27150/401
K 9
genhash.c
V 23
file 57v.5ck.r27456/668
K 9
genhash.h
V 25
file 57w.5ck.r26905/43784
K 9
genlist.c
V 24
file 51.5ck.r25012/26982
K 9
genlist.h
V 24
file 52.5ck.r20422/10948
K 11
inputfile.c
V 22
file h9.5qi.r29553/159
K 11
inputfile.h
V 24
file ha.5ck.r18858/84203
K 5
ioz.c
V 24
file uh.5qi.r29571/15209
K 5
ioz.h
V 24
file ui.5qi.r29108/10744
K 10
iterator.c
V 25
file 4h5.5ck.r26905/44951
K 10
iterator.h
V 25
file 4f3.5ck.r26905/45830
K 5
log.c
V 21
file 53.5ck.r24492/53
K 5
log.h
V 23
file 54.5qi.r28076/7197
K 5
md5.c
V 22
file 33q.5ck.r25082/54
K 5
md5.h
V 25
file 33r.5ck.r19849/16287
K 5
mem.c
V 25
file d9.5ck.r19259/362758
K 5
mem.h
V 24
file da.5ck.r20315/22211
K 9
netfile.c
V 25
file 6m8.5ck.r26905/41142
K 9
netfile.h
V 25
file 6m9.5ck.r26905/41734
K 9
netintf.c
V 22
file t6.5qi.r27904/160
K 9
netintf.h
V 24
file t7.5qi.r29185/61459
K 6
rand.c
V 25
file m5.5ck.r19259/363664
K 6
rand.h
V 24
file m6.5ck.r20315/22687
K 10
registry.c
V 25
file agw.5ck.r26905/40563
K 10
registry.h
V 25
file 7po.5ck.r26905/40851
K 14
registry_ini.c
V 23
file dh.5si.r29663/6013
K 14
registry_ini.h
V 23
file di.5su.r29663/6291
K 14
registry_xml.c
V 26
file 16x3.5ck.r26905/44658
K 14
registry_xml.h
V 26
file 16x5.5ck.r26905/45535
K 14
section_file.c
V 25
file bw9.5ck.r26905/42610
K 14
section_file.h
V 25
file axo.5ck.r26905/42907
K 8
shared.c
V 22
file 55.5qi.r29709/118
K 8
shared.h
V 23
file 1d.5qi.r29760/9634
K 10
spechash.h
V 25
file 57x.5ck.r26905/46987
K 10
speclist.h
V 24
file gb.5qi.r28013/32335
K 8
specpq.h
V 26
file 1brp.5ck.r26905/42320
K 9
specvec.h
V 24
file z9.5qi.r29571/15743
K 15
string_vector.c
V 25
file 4hy.5ck.r26905/41433
K 15
string_vector.h
V 25
file 4hz.5ck.r26905/42022
K 9
support.c
V 24
file m9.5qi.r29185/61976
K 9
support.h
V 24
file ma.5qi.r29185/62235
K 8
timing.c
V 24
file el.5ck.r24200/17365
K 8
timing.h
V 24
file em.5qi.r28013/32859
END
ENDREP
id: 1c.5qi.r29760/12716
type: dir
pred: 1c.5qi.r29709/3197
count: 910
text: 29760 9889 2814 0 fa09da45036e7c191fd3224d59730d15
props: 17175 331 84 0 5447a85ba28edec0d4a8f6120070e2b2
cpath: /branches/S2_6/utility
copyroot: 27474 /branches/S2_6

PLAIN
K 9
ABOUT-NLS
V 24
file fu.5ck.r27270/69307
K 7
AUTHORS
V 24
file 5u.5ck.r22143/14016
K 7
COPYING
V 22
file 1h.5qi.r29455/952
K 9
ChangeLog
V 26
file 6l.5ck.r27473/7455495
K 7
INSTALL
V 21
file 6.5qi.r29706/131
K 11
Makefile.am
V 22
file 59.5qi.r29568/735
K 4
NEWS
V 24
file 6m.5ck.r25634/30702
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 21
dir 8.5qi.r29724/3011
K 10
autogen.sh
V 24
file 12o.5ck.r25794/4003
K 9
bootstrap
V 23
dir 2p5.5qi.r29679/3655
K 6
client
V 22
dir d.5qi.r29758/25224
K 6
common
V 22
dir p.5qi.r29758/31791
K 12
configure.ac
V 23
file 149.5qi.r29706/372
K 4
data
V 22
dir w.5qi.r29752/41265
K 12
dependencies
V 23
dir 2yu.5qi.r29381/5956
K 3
doc
V 22
dir k7.5qi.r29753/2191
K 10
fc_version
V 25
file 2lo.5qj.r29733/29599
K 11
gen_headers
V 25
dir 1hsw.5qi.r29185/55201
K 2
m4
V 23
dir 12p.5qi.r29627/3033
K 7
scripts
V 23
dir 2yo.5qi.r28717/5437
K 6
server
V 21
dir z.5qi.r29742/7191
K 5
tests
V 22
dir 2g9.5ck.r27023/734
K 5
tools
V 23
dir 4pj.5qp.r29746/1204
K 12
translations
V 24
dir t0a.5qi.r29715/91584
K 7
utility
V 23
dir 1c.5qi.r29760/12716
K 3
vms
V 25
dir u9.5ck.r21528/1396085
K 5
win32
V 23
dir 2eu.5qi.r28346/1712
END
ENDREP
id: 3.5qi.r29760/14131
type: dir
pred: 3.5qi.r29758/33203
count: 19656
text: 29760 12960 1158 0 1c140f89444e60287a6d4a5b1add7a0c
props: 28037 14463 292 0 9e1d5de0253c723466868990c52c129f
cpath: /branches/S2_6
copyroot: 27474 /branches/S2_6

PLAIN
K 5
S1_14
V 21
dir 3.21.r18109/18803
K 4
S2_0
V 21
dir 3.10x.r21862/4178
K 4
S2_1
V 22
dir 3.59e.r20026/11014
K 4
S2_2
V 21
dir 3.5cy.r21861/5036
K 4
S2_3
V 21
dir 3.5f2.r29458/5135
K 4
S2_4
V 24
dir 3.5ii.r29512/2246126
K 4
S2_5
V 22
dir 3.5kv.r29754/20223
K 4
S2_6
V 22
dir 3.5qi.r29760/14131
K 11
freeciv-web
V 22
dir 3.5bl.r13594/14918
END
ENDREP
id: 1.0.r29760/14729
type: dir
pred: 1.0.r29758/33800
count: 9692
text: 29760 14372 344 0 4302ed5e61eef637693ad52c85e95aee
cpath: /branches
copyroot: 0 /

PLAIN
K 8
branches
V 20
dir 1.0.r29760/14729
K 4
tags
V 19
dir 2.0.r29519/6475
K 5
trunk
V 22
dir 3.5ck.r29759/14065
K 7
website
V 21
dir 3ge.0.r22980/2263
END
ENDREP
id: 0.0.r29760/15051
type: dir
pred: 0.0.r29759/14457
count: 29760
text: 29760 14884 154 0 f39ecf17a7a3a00049397337a5f1ad47
cpath: /
copyroot: 0 /

1d.5qi.t29759-1 modify true false /branches/S2_6/utility/shared.h


15051 15199
