Freeciv-3.1: /fast/freeciv/nightly/S3_1/utility/capability.c File Reference

Freeciv-3.1

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)
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 */ \
} \
}
fc_isspace
bool fc_isspace(char c)
Definition support.c:1249

Definition at line 28 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 46 of file capability.c.

Referenced by has_capabilities(), and has_capability().

## ◆ has_capabilities()

bool has_capabilities | ( | const char * | us,
|  | const char * | them
| ) |  |

This routine returns TRUE if all the mandatory capabilities in us appear in them.

Definition at line 86 of file capability.c.

Referenced by check_audiofile_capstr(), check_themespec_capabilities(), check_tilespec_capabilities(), download_modpack_list(), download_modpack_recursive(), handle_login_request(), load_install_info_list(), rscompat_check_capabilities(), savegame_load(), sg_load_savefile(), theme_read_toplevel(), and tileset_read_toplevel().

## ◆ has_capability()

bool has_capability | ( | const char * | cap,
|  | const char * | capstr
| ) |  |

Wrapper for fc_has_capability() for NULL terminated strings.

Definition at line 77 of file capability.c.

Referenced by compat_load_020400(), diplomat_investigate(), handle_city_buy(), handle_city_change(), handle_city_change_specialist(), handle_city_info(), handle_city_make_specialist(), handle_city_make_worker(), handle_city_name_suggestion_info(), handle_city_name_suggestion_req(), handle_city_nationalities(), handle_city_options_req(), handle_city_rally_point(), handle_city_rally_point(), handle_city_refresh(), handle_city_remove(), handle_city_rename(), handle_city_sabotage_list(), handle_city_sell(), handle_city_short_info(), handle_city_worklist(), handle_edit_city(), handle_edit_city_remove(), handle_edit_unit(), handle_edit_unit_remove_by_id(), handle_investigate_started(), handle_ruleset_control(), handle_tile_info(), handle_trade_route_info(), handle_unit_action_answer(), handle_unit_action_query(), handle_unit_actions(), handle_unit_change_activity(), handle_unit_combat_info(), handle_unit_do_action(), handle_unit_get_actions(), handle_unit_orders(), handle_unit_remove(), handle_unit_server_side_agent_set(), handle_unit_short_info(), handle_unit_sscs_set(), handle_worker_task(), handle_worker_task(), packet_handlers_fill_capability(), packet_handlers_fill_initial(), packet_handlers_get(), sg_load_map(), unpackage_short_unit(), and unpackage_unit().