OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
group.c File Reference
#include <string.h>
#include "mape/cpp-handles/group-handle.h"
#include "mape/group.h"
Include dependency graph for group.c:

Go to the source code of this file.

Classes

struct  _MapeGroupPrivate
 

Macros

#define MAPE_GROUP_PRIVATE(obj)   (G_TYPE_INSTANCE_GET_PRIVATE((obj), MAPE_TYPE_GROUP, MapeGroupPrivate))
 

Typedefs

typedef struct _MapeGroupPrivate MapeGroupPrivate
 

Enumerations

enum  { PROP_0, PROP_NAME, PROP_FULL_NAME }
 

Functions

C4GroupHandle_mape_group_get_handle (MapeGroup *group)
 
MapeGroupmape_group_new (void)
 
gboolean mape_group_is_open (MapeGroup *group)
 
gboolean mape_group_open (MapeGroup *group, const gchar *path, GError **error)
 
MapeGroupmape_group_open_child (MapeGroup *group, const gchar *entry, GError **error)
 
void mape_group_close (MapeGroup *group)
 
const gchar * mape_group_get_name (MapeGroup *group)
 
gchar * mape_group_get_full_name (MapeGroup *group)
 
gboolean mape_group_has_entry (MapeGroup *group, const gchar *entry)
 
void mape_group_rewind (MapeGroup *group)
 
gchar * mape_group_get_next_entry (MapeGroup *group)
 
guchar * mape_group_load_entry (MapeGroup *group, const gchar *entry, gsize *size, GError **error)
 
gboolean mape_group_is_drive_container (MapeGroup *group)
 
gboolean mape_group_is_child_folder (MapeGroup *group, const gchar *child)
 

Class Documentation

struct _MapeGroupPrivate

Definition at line 42 of file group.c.

Class Members
C4GroupHandle * handle

Macro Definition Documentation

Typedef Documentation

Definition at line 41 of file group.c.

Enumeration Type Documentation

anonymous enum
Enumerator
PROP_0 
PROP_NAME 
PROP_FULL_NAME 

Definition at line 55 of file group.c.

55  {
56  PROP_0,
57 
58  /* read only */
59  PROP_NAME,
61 };
Definition: group.c:56

Function Documentation

C4GroupHandle * _mape_group_get_handle ( MapeGroup group)

SECTION:mape-group : MapeGroup : C4Group interface mape/group.h : Unstable

MapeGroup is a simple GObject-based interface to C4Group. It currntly only supports a subset of the C4Group operations, it does not support writing groups for example. It is just enough for what Mape requires.

Definition at line 682 of file group.c.

References MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_mapgen_set_root_group(), mape_material_map_load(), and mape_texture_map_load_map().

683 {
684  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
685  return MAPE_GROUP_PRIVATE(group)->handle;
686 }
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the caller graph for this function:

void mape_group_close ( MapeGroup group)

mape_group_close: : A MapeGroup.

Closes an open group. The group can be reopened afterwards.

Definition at line 355 of file group.c.

References c4_group_handle_free(), _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

356 {
357  MapeGroupPrivate* priv;
358 
359  g_return_if_fail(MAPE_IS_GROUP(group));
360  g_return_if_fail(mape_group_is_open(group) == FALSE);
361 
362  priv = MAPE_GROUP_PRIVATE(group);
363 
364 #ifdef G_OS_WIN32
365  priv->drive = 0;
366 #endif
367 
368  if(priv->handle != NULL)
369  {
371  priv->handle = NULL;
372 
373  /* Don't notify when only drive was reset, as name and full-name are
374  * not specified for these anyway (yet). */
375  g_object_notify(G_OBJECT(group), "name");
376  g_object_notify(G_OBJECT(group), "full-name");
377  }
378 }
void c4_group_handle_free(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

gchar* mape_group_get_full_name ( MapeGroup group)

mape_group_get_full_name: : An open MapeGroup.

Returns the full path to the group.

Return Value: The group path. Free with g_free() when no longer needed.

Definition at line 407 of file group.c.

References c4_group_handle_get_full_name(), mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

408 {
409  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
410  g_return_val_if_fail(mape_group_is_open(group), NULL);
411 
412  return c4_group_handle_get_full_name(MAPE_GROUP_PRIVATE(group)->handle);
413 }
gchar * c4_group_handle_get_full_name(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

const gchar* mape_group_get_name ( MapeGroup group)

mape_group_get_name: : An open MapeGroup.

Returns the name of the group.

Return Value: The group's name. The name is owned by the group and must not be freed.

Definition at line 390 of file group.c.

References c4_group_handle_get_name(), mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

391 {
392  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
393  g_return_val_if_fail(mape_group_is_open(group), NULL);
394 
395  return c4_group_handle_get_name(MAPE_GROUP_PRIVATE(group)->handle);
396 }
const gchar * c4_group_handle_get_name(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

gchar* mape_group_get_next_entry ( MapeGroup group)

mape_group_get_next_entry: : An open MapeGroup. : Location to store error information, if any.

Advances the group's internal iterator by one and returns the name of the entry it now points to. Use mape_group_load_entry() to load its contents into memory, or mape_group_open_child() if you expect the entry to be a subgroup. If there are no more entries in the group, the function returns NULL.

Returns: The name of the next entry, or NULL if there is no next entry.

Definition at line 496 of file group.c.

References c4_group_handle_find_next_entry(), _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_texture_map_load_textures().

497 {
498  MapeGroupPrivate* priv;
499  gchar* buf;
500 #ifdef G_OS_WIN32
501  DWORD drv_c;
502  guint drive;
503 #endif
504 
505  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
506  g_return_val_if_fail(mape_group_is_open(group), NULL);
507 
508  priv = MAPE_GROUP_PRIVATE(group);
509 
510 #ifdef G_OS_WIN32
511  static const guint DRV_C_SUPPORT = 26;
512  if(priv->handle == NULL)
513  {
514  drv_c = GetLogicalDrives();
515 
516  /* Find next available drive or wait for overflow */
517  drive = priv->drive - 1;
518  while( (drive < DRV_C_SUPPORT) && ((~drv_c & (1 << drive)) != 0))
519  ++drive;
520  if(drive >= DRV_C_SUPPORT) return NULL;
521 
522  buf = g_malloc(3 * sizeof(gchar));
523  buf[0] = 'A' + drive;
524  buf[1] = ':';
525  buf[2] = '\0';
526  priv->drive = drive + 2;
527 
528  return buf;
529  }
530 #endif
531 
532  buf = g_malloc(512 * sizeof(gchar));
533  if(!c4_group_handle_find_next_entry(priv->handle, "*", NULL, buf, FALSE))
534  {
535  g_free(buf);
536  buf = NULL;
537  }
538 
539  return buf;
540 }
gboolean c4_group_handle_find_next_entry(C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean start_at_filename)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
uint32_t DWORD
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean mape_group_has_entry ( MapeGroup group,
const gchar *  entry 
)

mape_group_has_entry: : An open MapeGroup. : The entry name to check.

Returns TRUE if contains an entry with the given name, and FALSE otherwise.

Definition at line 424 of file group.c.

References c4_group_handle_find_next_entry(), c4_group_handle_reset_search(), _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

426 {
427  MapeGroupPrivate* priv;
428 #ifdef G_OS_WIN32
429  DWORD chk_drv;
430 #endif
431 
432  g_return_val_if_fail(MAPE_IS_GROUP(group), FALSE);
433  g_return_val_if_fail(mape_group_is_open(group), FALSE);
434  g_return_val_if_fail(entry != NULL, FALSE);
435 
436  priv = MAPE_GROUP_PRIVATE(group);
437 
438 #ifdef G_OS_WIN32
439  if(priv->handle == NULL)
440  {
441  if(entry[0] == '\0') return FALSE;
442  if(entry[1] != ':') return FALSE;
443 
444  chk_drv = 1 << (entry[0] - 'A');
445  return (GetLogicalDrives() & chk_drv) != 0;
446  }
447 #endif
448 
450  return c4_group_handle_find_next_entry(priv->handle, entry,
451  NULL, NULL, FALSE);
452 }
gboolean c4_group_handle_find_next_entry(C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean start_at_filename)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
uint32_t DWORD
#define MAPE_IS_GROUP(obj)
Definition: group.h:26
void c4_group_handle_reset_search(C4GroupHandle *handle)

Here is the call graph for this function:

gboolean mape_group_is_child_folder ( MapeGroup group,
const gchar *  child 
)

Definition at line 631 of file group.c.

References c4_group_handle_get_full_name(), c4_group_handle_is_folder(), _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

633 {
634  MapeGroupPrivate* priv;
635  const gchar* ext;
636  gchar* fullname;
637  gchar* filename;
638  gboolean result;
639 
640  g_return_val_if_fail(MAPE_IS_GROUP(group), FALSE);
641  g_return_val_if_fail(mape_group_is_open(group), FALSE);
642  g_return_val_if_fail(child != NULL, FALSE);
643 
644  priv = MAPE_GROUP_PRIVATE(group);
645 
646 #ifdef G_OS_WIN32
647  /* Drives are always folders */
648  if(priv->handle == NULL)
649  return TRUE;
650 #endif
651 
652  /* Guess on extension */
653  ext = strrchr(child, '.');
654  if(ext != NULL)
655  {
656  if(g_ascii_strcasecmp(ext, ".ocs") == 0 ||
657  g_ascii_strcasecmp(ext, ".ocd") == 0 ||
658  g_ascii_strcasecmp(ext, ".ocf") == 0 ||
659  g_ascii_strcasecmp(ext, ".ocg") == 0)
660  {
661  return TRUE;
662  }
663  }
664 
665  /* Otherwise assume it's not a subgroup */
667  return FALSE;
668 
669  /* It is an open directory - check for regular directory */
670  fullname = c4_group_handle_get_full_name(priv->handle);
671  filename = g_build_filename(fullname, child, NULL);
672  g_free(fullname);
673 
674  result = g_file_test(filename, G_FILE_TEST_IS_DIR);
675  g_free(filename);
676 
677  return result;
678 }
gboolean c4_group_handle_is_folder(C4GroupHandle *handle)
gchar * c4_group_handle_get_full_name(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

gboolean mape_group_is_drive_container ( MapeGroup group)

Definition at line 603 of file group.c.

References _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

604 {
605  g_return_val_if_fail(MAPE_IS_GROUP(group), FALSE);
606  g_return_val_if_fail(mape_group_is_open(group), FALSE);
607 
608 #ifdef G_OS_WIN32
609  {
610  MapeGroupPrivate* priv = MAPE_GROUP_PRIVATE(group);
611  if(priv->handle == NULL)
612  return TRUE;
613  }
614 #endif
615 
616  return FALSE;
617 }
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

gboolean mape_group_is_open ( MapeGroup group)

mape_group_is_open: : A MapeGroup.

Returns whether is open or not.

Returns: Whether is open.

Definition at line 220 of file group.c.

References _MapeGroupPrivate::handle, MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_group_close(), mape_group_get_full_name(), mape_group_get_name(), mape_group_get_next_entry(), mape_group_has_entry(), mape_group_is_child_folder(), mape_group_is_drive_container(), mape_group_load_entry(), mape_group_open(), mape_group_open_child(), mape_group_rewind(), and mape_material_map_load().

221 {
222  MapeGroupPrivate* priv;
223 
224  g_return_val_if_fail(MAPE_IS_GROUP(group), FALSE);
225 
226  priv = MAPE_GROUP_PRIVATE(group);
227 
228  if(priv->handle != NULL) return TRUE;
229 #ifdef G_OS_WIN32
230  if(priv->drive != 0) return TRUE;
231 #endif
232  return FALSE;
233 }
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the caller graph for this function:

guchar* mape_group_load_entry ( MapeGroup group,
const gchar *  entry,
gsize *  size,
GError **  error 
)

mape_group_load_entry: : An open MapeGroup. : The name of the file to open. : Location to store the size of the entry in, or NULL. : Location to store error information, if any.

Attempts to load the entry with the given name into memory. If is non-NULL, the size of the entry will be stored at the location points to. On error, NULL is returned, is set and is left untouched.

Returns: A pointer pointing to the loaded entry's contents.

Definition at line 557 of file group.c.

References c4_group_handle_access_entry(), c4_group_handle_get_error(), c4_group_handle_read(), _MapeGroupPrivate::handle, MAPE_GROUP_ERROR_ACCESS, MAPE_GROUP_ERROR_READ, mape_group_is_open(), MAPE_GROUP_PRIVATE, MAPE_IS_GROUP, and s.

Referenced by mape_texture_map_load_textures().

561 {
562  MapeGroupPrivate* priv;
563  gsize s;
564  guchar* res;
565 
566  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
567  g_return_val_if_fail(mape_group_is_open(group), NULL);
568  g_return_val_if_fail(error == NULL || *error == NULL, NULL);
569 
570  priv = MAPE_GROUP_PRIVATE(group);
571  if(!c4_group_handle_access_entry(priv->handle, entry, &s, NULL, FALSE))
572  {
573  g_set_error(error, mape_group_error_quark, MAPE_GROUP_ERROR_ACCESS,
574  "%s", c4_group_handle_get_error(priv->handle));
575  return NULL;
576  }
577 
578  res = g_malloc(s);
579  if(!c4_group_handle_read(priv->handle, (char*)res, s))
580  {
581  g_set_error(error, mape_group_error_quark, MAPE_GROUP_ERROR_READ,
582  "%s", c4_group_handle_get_error(priv->handle));
583  g_free(res);
584  return NULL;
585  }
586 
587  if(size != NULL) *size = s;
588  return res;
589 }
gboolean c4_group_handle_read(C4GroupHandle *handle, gpointer buffer, gsize size)
gboolean c4_group_handle_access_entry(C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean needs_to_be_a_group)
const gchar * c4_group_handle_get_error(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define s
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

Here is the caller graph for this function:

MapeGroup* mape_group_new ( void  )

mape_group_new:

Creates a new group object. The group object is initially closed. Open it with mape_group_open(). To open a child group from an existing group, use mape_group_open_child() instead of this function.

Return Value: A new MapeGroup. Free with g_object_unref().

Definition at line 206 of file group.c.

References MAPE_GROUP, and MAPE_TYPE_GROUP.

Referenced by mape_group_open_child().

207 {
208  return MAPE_GROUP(g_object_new(MAPE_TYPE_GROUP, NULL));
209 }
#define MAPE_TYPE_GROUP
Definition: group.h:23
#define MAPE_GROUP(obj)
Definition: group.h:24

Here is the caller graph for this function:

gboolean mape_group_open ( MapeGroup group,
const gchar *  path,
GError **  error 
)

mape_group_open: : A MapeGroup. : A path leading to a non-packed C4Group file or a directory on disk. : Location to store error information, if any.

must not be open yet. Upon success, has been opened and its content can be read via mape_group_get_next_entry() and mape_group_load_entry(). On error, the function returns FALSE and will be set.

Return Value: TRUE on success, and FALSE on error.

Definition at line 249 of file group.c.

References c4_group_handle_free(), c4_group_handle_get_error(), c4_group_handle_new(), c4_group_handle_open(), _MapeGroupPrivate::handle, MAPE_GROUP_ERROR_OPEN, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_group_open_child().

252 {
253  MapeGroupPrivate* priv;
254 
255  g_return_val_if_fail(MAPE_IS_GROUP(group), FALSE);
256  g_return_val_if_fail(path != NULL, FALSE);
257  g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
258  g_return_val_if_fail(mape_group_is_open(group) == FALSE, FALSE);
259 
260  priv = MAPE_GROUP_PRIVATE(group);
261 
262 #ifdef G_OS_WIN32
263  if(strcmp(path, "/") == 0)
264  {
265  priv->drive = 1;
266  return TRUE;
267  }
268 #endif
269 
270  priv->handle = c4_group_handle_new();
271  if(c4_group_handle_open(priv->handle, path, FALSE) == FALSE)
272  {
273  g_set_error(error, mape_group_error_quark, MAPE_GROUP_ERROR_OPEN,
274  "Could not open '%s': %s", path,
277  priv->handle = NULL;
278  return FALSE;
279  }
280 
281  g_object_notify(G_OBJECT(group), "name");
282  g_object_notify(G_OBJECT(group), "full-name");
283 
284  return TRUE;
285 }
void c4_group_handle_free(C4GroupHandle *handle)
const gchar * c4_group_handle_get_error(C4GroupHandle *handle)
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
C4GroupHandle * c4_group_handle_new(void)
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
gboolean c4_group_handle_open(C4GroupHandle *handle, const gchar *path, gboolean create)
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

Here is the caller graph for this function:

MapeGroup* mape_group_open_child ( MapeGroup group,
const gchar *  entry,
GError **  error 
)

mape_group_open_child: : A MapeGroup. : A subgroup entry in . : Location to store error information, if any.

This function attempts to open a child group which is contained in , named . On success the new, opened group is returned. On failure, the function returns NULL and is set.

Returns: A new group to be freed with g_object_unref() when no longer needed, or NULL on error.

Definition at line 301 of file group.c.

References c4_group_handle_free(), c4_group_handle_get_error(), c4_group_handle_new(), c4_group_handle_open_as_child(), _MapeGroupPrivate::handle, MAPE_GROUP_ERROR_OPEN, mape_group_is_open(), mape_group_new(), mape_group_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_mapgen_set_root_group().

304 {
305  MapeGroupPrivate* parent_priv;
306  MapeGroup* child;
307  MapeGroupPrivate* child_priv;
308  C4GroupHandle* child_handle;
309 
310  g_return_val_if_fail(MAPE_IS_GROUP(group), NULL);
311  g_return_val_if_fail(entry != NULL, NULL);
312  g_return_val_if_fail(error == NULL || *error == NULL, NULL);
313  g_return_val_if_fail(mape_group_is_open(group) == TRUE, NULL);
314 
315  parent_priv = MAPE_GROUP_PRIVATE(group);
316 #ifdef G_OS_WIN32
317  if(parent_priv->handle == NULL)
318  {
319  child = mape_group_new();
320  if(!mape_group_open(child, entry, error))
321  {
322  g_object_unref(child);
323  return NULL;
324  }
325 
326  return child;
327  }
328 #endif
329 
330  child_handle = c4_group_handle_new();
331  if(!c4_group_handle_open_as_child(child_handle, parent_priv->handle,
332  entry, FALSE, FALSE))
333  {
334  g_set_error(error, mape_group_error_quark, MAPE_GROUP_ERROR_OPEN,
335  "Could not open '%s': %s", entry,
336  c4_group_handle_get_error(child_handle));
337  c4_group_handle_free(child_handle);
338  return NULL;
339  }
340 
341  child = mape_group_new();
342  child_priv = MAPE_GROUP_PRIVATE(child);
343  child_priv->handle = child_handle;
344 
345  return child;
346 }
gboolean mape_group_open(MapeGroup *group, const gchar *path, GError **error)
Definition: group.c:249
typedefG_BEGIN_DECLS struct _C4GroupHandle C4GroupHandle
Definition: group-handle.h:23
gboolean c4_group_handle_open_as_child(C4GroupHandle *handle, C4GroupHandle *mother, const gchar *name, gboolean exclusive, gboolean create)
void c4_group_handle_free(C4GroupHandle *handle)
const gchar * c4_group_handle_get_error(C4GroupHandle *handle)
MapeGroup * mape_group_new(void)
Definition: group.c:206
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
C4GroupHandle * c4_group_handle_new(void)
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26

Here is the call graph for this function:

Here is the caller graph for this function:

void mape_group_rewind ( MapeGroup group)

mape_group_rewind: : An open MapeGroup.

Resets the group's internal iterator. The next call to mape_group_get_next_entry() will return the first entry in the group again.

Definition at line 462 of file group.c.

References c4_group_handle_reset_search(), _MapeGroupPrivate::handle, mape_group_is_open(), MAPE_GROUP_PRIVATE, and MAPE_IS_GROUP.

Referenced by mape_texture_map_load_textures().

463 {
464  MapeGroupPrivate* priv;
465 
466  g_return_if_fail(MAPE_IS_GROUP(group));
467  g_return_if_fail(mape_group_is_open(group));
468 
469  priv = MAPE_GROUP_PRIVATE(group);
470 
471 #ifdef G_OS_WIN32
472  if(priv->handle == NULL)
473  {
474  priv->drive = 1;
475  return;
476  }
477 #endif
478 
480 }
#define MAPE_GROUP_PRIVATE(obj)
Definition: group.c:63
C4GroupHandle * handle
Definition: group.c:43
gboolean mape_group_is_open(MapeGroup *group)
Definition: group.c:220
#define MAPE_IS_GROUP(obj)
Definition: group.h:26
void c4_group_handle_reset_search(C4GroupHandle *handle)

Here is the call graph for this function:

Here is the caller graph for this function: