Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions
capability.c File Reference
#include "fc_prehdrs.h"
#include <string.h>
#include "shared.h"
#include "support.h"
#include "capability.h"

Go to the source code of this file.

Macros

#define GET_TOKEN(start, end)
 

Functions

static bool fc_has_capability (const char *cap, const char *capstr, const size_t cap_len) fc__attribute((nonnull(1
 
bool has_capability (const char *cap, const char *capstr)
 
bool has_capabilities (const char *us, const char *them)
 

Macro Definition Documentation

◆ GET_TOKEN

#define GET_TOKEN (   start,
  end 
)
Value:
{ \
/* Skip leading whitespace */ \
while (fc_isspace(*start)) { \
start++; \
} \
/* Skip to end of token */ \
for (end = start; *end != '\0' && !fc_isspace(*end) && *end != ','; \
end++) { \
/* Nothing */ \
} \
}
char * incite_cost
Definition comments.c:76
bool fc_isspace(char c)
Definition support.c:1240

Definition at line 32 of file capability.c.

Function Documentation

◆ fc_has_capability()

static bool fc_has_capability ( const char cap,
const char capstr,
const size_t  cap_len 
)
static

This routine returns TRUE if the capability in cap appears in the capability list in capstr. The capabilities in capstr are allowed to start with a "+", but the capability in cap must not.

Definition at line 50 of file capability.c.

Referenced by has_capabilities(), and has_capability().

◆ has_capabilities()

bool has_capabilities ( const char us,
const char them 
)

◆ has_capability()

bool has_capability ( const char cap,
const char capstr 
)

Wrapper for fc_has_capability() for nullptr terminated strings.

Definition at line 79 of file capability.c.

Referenced by compat_load_020400(), packet_handlers_get(), and sg_load_map().