Súbor: [Platon] / games / 3do-view / dir.c (stiahnutie)
Revízia 1.1, Mon May 19 22:24:46 2003 UTC (20 years, 10 months ago) by nepto
Preparing for file selector support in 3do-view.
|
/*
* dir.c
*
* Developed by Ondrej Jombik <nepto@php.net>
* Copyright (c) 2003 Platon SDG, http://www.platon.sk/
* Licensed under terms of GNU General Public License.
* All rights reserved.
*
* Changelog:
* 19/05/2003 - created
*
*/
/* $Platon$ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void get_directories_and_files( /* ... ) {{{ */
const char *path, char ***directories, char ***files)
{
if (directories != NULL) {
*directories = (char **) malloc(5 * sizeof(char *));
if (*directories != NULL) {
(*directories)[0] = strdup("ATTEMPT0");
(*directories)[1] = strdup("ATTEMPT1");
(*directories)[2] = strdup("ATTEMPT2");
(*directories)[3] = strdup("ATTEMPT3");
(*directories)[4] = NULL;
}
}
if (files != NULL) {
*files = (char **) malloc(5 * sizeof(char *));
if (*files != NULL) {
(*files)[0] = strdup("pokus0");
(*files)[1] = strdup("pokus1");
(*files)[2] = strdup("pokus2");
(*files)[3] = strdup("pokus3");
(*files)[4] = NULL;
}
}
} /* }}} */
void free_directories_or_files(char **ar) /* {{{ */
{
register int i;
for (i = 0; ar[i] != NULL; i++)
free(ar[i]);
free(ar);
} /* }}} */
/* Modeline for ViM {{{
* vim: set ts=4:
* vim600: fdm=marker fdl=0 fdc=0:
* }}} */
Platon Group <platon@platon.sk> http://platon.sk/
|