Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/global_worklist.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
global_worklist.c File Reference
`#include <stdarg.h>`
`#include "fcintl.h"`
`#include "log.h"`
`#include "mem.h"`
`#include "registry.h"`
`#include "shared.h"`
`#include "support.h"`
`#include "fc_types.h"`
`#include "requirements.h"`
`#include "worklist.h"`
`#include "client_main.h"`
`#include "global_worklist.h"`

Go to the source code of this file.

## Data Structures

struct | global_worklist

## Enumerations

enum | global_worklist_status { STATUS_UNBUILT , STATUS_WORKLIST }

## Functions

static bool | global_worklist_load (struct section_file *file, const char *path,...) fc__attribute((__format__(__printf__
static bool static void | global_worklist_save (const struct global_worklist *pgwl, struct section_file *file, int fill_until, const char *path,...) fc__attribute((__format__(__printf__
static bool static void void | global_worklists_init (void)
void | global_worklists_free (void)
void | global_worklists_build (void)
void | global_worklists_unbuild (void)
int | global_worklists_number (void)
static struct global_worklist * | global_worklist_alloc (enum global_worklist_status type)
void | global_worklist_destroy (struct global_worklist *pgwl)
struct global_worklist * | global_worklist_new (const char *name)
bool | global_worklist_is_valid (const struct global_worklist *pgwl)
bool | global_worklist_set (struct global_worklist *pgwl, const struct worklist *pwl)
const struct worklist * | global_worklist_get (const struct global_worklist *pgwl)
int | global_worklist_id (const struct global_worklist *pgwl)
struct global_worklist * | global_worklist_by_id (int id)
void | global_worklist_set_name (struct global_worklist *pgwl, const char *name)
const char * | global_worklist_name (const struct global_worklist *pgwl)
void | global_worklists_load (struct section_file *file)
void | global_worklists_save (struct section_file *file)

## Enumeration Type Documentation

## ◆ global_worklist_status

enum global_worklist_status

Enumerator
STATUS_UNBUILT |
STATUS_WORKLIST |

Definition at line 37 of file global_worklist.c.

## Function Documentation

## ◆ global_worklist_alloc()

static struct global_worklist * global_worklist_alloc | ( | enum global_worklist_status | type | ) |

static

Returns a new created global worklist structure.

Definition at line 188 of file global_worklist.c.

Referenced by global_worklist_load(), and global_worklist_new().

## ◆ global_worklist_by_id()

struct global_worklist * global_worklist_by_id | ( | int | id | ) |

Returns the global worklist corresponding to this id. N.B.: It can returns an invalid glocbal worklist.

Definition at line 298 of file global_worklist.c.

Referenced by add_global_worklist(), append_worklist_callback(), append_worklist_callback(), cell_edited(), commit_worklist(), city_widget::display_list_menu(), city_dialog::display_worklist_menu(), edit_worklist_callback(), menu_item_callback(), menu_item_callback(), ok_worklist_editor_callback(), refresh_worklist(), set_global_worklist(), set_worklist_callback(), set_worklist_callback(), update_worklist_report_dialog(), and worklists_response().

## ◆ global_worklist_destroy()

void global_worklist_destroy | ( | struct global_worklist * | pgwl | ) |

Destroys a glocal worklist.

Definition at line 214 of file global_worklist.c.

Referenced by edit_worklist_callback(), global_worklists_free(), global_worklists_load(), and worklists_response().

## ◆ global_worklist_get()

const struct worklist * global_worklist_get | ( | const struct global_worklist * | pgwl | ) |

Returns the worklist of this global worklist or NULL if it's not valid.

Definition at line 276 of file global_worklist.c.

Referenced by add_global_worklist(), append_worklist_callback(), append_worklist_callback(), city_widget::display_list_menu(), city_dialog::display_worklist_menu(), menu_item_callback(), menu_item_callback(), popup_worklist_editor(), refresh_worklist(), set_global_worklist(), set_worklist_callback(), and set_worklist_callback().

## ◆ global_worklist_id()

int global_worklist_id | ( | const struct global_worklist * | pgwl | ) |

Returns the id of the global worklist.

Definition at line 288 of file global_worklist.c.

Referenced by add_new_worklist_callback(), create_wl_menu(), create_wl_menu(), delete_worklist(), city_dialog::display_worklist_menu(), city_widget::gen_worklist_labels(), get_worklist(), insert_worklist(), option_dialog_worklist(), popdown_worklist(), popup_add_menu(), popup_worklist(), popup_worklist_editor(), production_menu_shown(), reset_global_worklist(), and update_worklist_report_dialog().

## ◆ global_worklist_is_valid()

bool global_worklist_is_valid | ( | const struct global_worklist * | pgwl | ) |

Returns TRUE if this global worklist is valid.

Definition at line 255 of file global_worklist.c.

## ◆ global_worklist_load()

static bool global_worklist_load | ( | struct section_file * | file,
|  | const char * | path,
|  |  | ...
| ) |  |

static

Load a global worklist form a section file. Returns FALSE if we reached the end of the array.

Definition at line 333 of file global_worklist.c.

Referenced by global_worklists_load().

## ◆ global_worklist_name()

const char * global_worklist_name | ( | const struct global_worklist * | pgwl | ) |

Return the name of the global worklist.

Definition at line 323 of file global_worklist.c.

Referenced by add_new_worklist_callback(), create_wl_menu(), create_wl_menu(), city_dialog::display_worklist_menu(), city_widget::gen_worklist_labels(), option_dialog_worklist(), popup_add_menu(), popup_worklist(), popup_worklist_editor(), production_menu_shown(), and update_worklist_report_dialog().

## ◆ global_worklist_new()

struct global_worklist * global_worklist_new | ( | const char * | name | ) |

Creates a new global worklist form a normal worklist.

Definition at line 244 of file global_worklist.c.

Referenced by add_new_worklist_callback(), city_dialog::save_worklist(), and worklists_response().

## ◆ global_worklist_save()

static void global_worklist_save | ( | const struct global_worklist * | pgwl,
|  | struct section_file * | file,
|  | int | fill_until,
|  | const char * | path,
|  |  | ...
| ) |  |

static

Save one global worklist into a section file.

Definition at line 412 of file global_worklist.c.

Referenced by global_worklists_save().

## ◆ global_worklist_set()

bool global_worklist_set | ( | struct global_worklist * | pgwl,
|  | const struct worklist * | pwl
| ) |  |

Sets the worklist. Return TRUE on success.

Definition at line 263 of file global_worklist.c.

Referenced by commit_worklist(), ok_worklist_editor_callback(), and city_dialog::save_worklist().

## ◆ global_worklist_set_name()

void global_worklist_set_name | ( | struct global_worklist * | pgwl,
|  | const char * | name
| ) |  |

Sets the name of this global worklist.

Definition at line 312 of file global_worklist.c.

Referenced by cell_edited(), global_worklist_load(), global_worklist_new(), and ok_worklist_editor_callback().

## ◆ global_worklists_build()

void global_worklists_build | ( | void |  | ) |

Check if the global worklists are valid or not for the ruleset.

Definition at line 100 of file global_worklist.c.

Referenced by global_worklists_load(), and set_client_state().

## ◆ global_worklists_free()

void global_worklists_free | ( | void |  | ) |

Free the client global worklists.

Definition at line 86 of file global_worklist.c.

## ◆ global_worklists_init()

static bool static void void global_worklists_init | ( | void |  | ) |

Initialize the client global worklists.

Definition at line 76 of file global_worklist.c.

## ◆ global_worklists_load()

void global_worklists_load | ( | struct section_file * | file | ) |

Load all global worklist from a section file.

Definition at line 390 of file global_worklist.c.

## ◆ global_worklists_number()

int global_worklists_number | ( | void |  | ) |

Returns the number of valid global worklists. N.B.: This counts only the valid global worklists.

Definition at line 173 of file global_worklist.c.

## ◆ global_worklists_save()

void global_worklists_save | ( | struct section_file * | file | ) |

Save all global worklist into a section file.

Definition at line 465 of file global_worklist.c.

## ◆ global_worklists_unbuild()

void global_worklists_unbuild | ( | void |  | ) |

Convert the universal pointers to strings to work out-ruleset.

Definition at line 145 of file global_worklist.c.

Referenced by set_client_state().