summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe/minifind.c
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-02-28 23:06:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-02-28 23:06:31 +0000
commitb32fd10dd6fc1292d78a3a6a6cb87e1ad904f142 (patch)
tree3de51de387129c058de30ba6b769989e53c61ad3 /tools/ddcprobe/minifind.c
parent1f2d53396dd61b3ee999db70f1b373dd015d0b73 (diff)
downloaddrakx-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar
drakx-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.gz
drakx-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.bz2
drakx-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.xz
drakx-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.zip
- remove ddcxinfos, replaced by monitor-edid (which is in a separate package)
- add many resolutions (they are structured by aspect ratio for next move) - put the "Monitor preferred modeline" from EDID in xorg.conf - for this ModeLine must be exported from the monitor section - specifying a VendorName|ModelName in auto_inst is valid, don't overwrite it with edid probe - the strange /dev/zero needed (?) by ddcxinfos is no more needed - field {size} is now {diagonal_size}, and is no more "corrected" - add @CVT_ratios and @CVT_vfreqs (unused at the moment) - Getopt::Long is needed by monitor-parse-edid
Diffstat (limited to 'tools/ddcprobe/minifind.c')
-rw-r--r--tools/ddcprobe/minifind.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/tools/ddcprobe/minifind.c b/tools/ddcprobe/minifind.c
deleted file mode 100644
index f483055b4..000000000
--- a/tools/ddcprobe/minifind.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* minifind.c -- simple find library
- *
- * Copyright (c) 2002 Terra Soft Solutions, Inc.
- * Written by Dan Burcaw <dburcaw@terrasoftsolutions.com>
- *
- * This software may be freely redistributed under the terms of the GNU
- * library public license.
- *
- * You should have received a copy of the GNU Library Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "minifind.h"
-
-// insert a node at head of linked-list
-void insert_node(struct pathNode *n, char *path)
-{
- struct pathNode *new = (struct pathNode *) malloc(sizeof(struct pathNode));
- new->path = path;
- new->next = n->next;
- n->next = new;
-}
-
-// return input strip less last character
-char *stripLastChar(char *in)
-{
- char *out = malloc(sizeof(char)*strlen(in));
- snprintf(out, strlen(in) - 1, "%s", in);
- return out;
-}
-
-// do the work
-char *minifind(char *dir, char *search, struct findNode *list)
-{
- char *d = NULL;
- int n;
- struct dirent **namelist;
- struct stat buf;
-
- if (dir[strlen(dir)-1] == '/')
- dir = stripLastChar(dir);
-
- // check is there is an exact filematch to dir
- // when search is not specified
- if (search == NULL)
- {
- if (lstat(dir, &buf) == 0)
- insert_node(list->result, dir);
- return 0;
- }
-
- n = scandir(dir, &namelist, 0, alphasort);
- if (n >= 0)
- {
- while (n--)
- {
- d = malloc(sizeof(char) * (strlen(dir) \
- + strlen(namelist[n]->d_name)+1));
- sprintf(d, "%s/%s", dir, namelist[n]->d_name);
- if (strstr(namelist[n]->d_name, search))
- insert_node(list->result, d);
-
- if ((lstat(d, &buf) == 0) && S_ISDIR(buf.st_mode))
- {
- if (strcmp(namelist[n]->d_name, ".") &&
- strcmp(namelist[n]->d_name, ".."))
- d = minifind(d, search, list);
- }
- free(namelist[n]);
- }
- free(namelist);
- return d;
- }
- return 0;
-}