Changeset 7521 for trunk/src


Ignore:
Timestamp:
Dec 2, 2001, 12:06:23 AM (24 years ago)
Author:
bird
Message:

include ctype.h to get the toupper() proto.

Location:
trunk/src/crtdll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crtdll/dir.c

    r6712 r7521  
    11/*
    22 * CRTDLL drive/directory functions
    3  * 
     3 *
    44 * Copyright 1996,1998 Marcus Meissner
    55 * Copyright 1996 Jukka Iivonen
     
    1919
    2020#include <string.h>
     21#include <ctype.h>                      /* toupper proto */
    2122
    2223DEFAULT_DEBUG_CHANNEL(crtdll);
     
    5758 * RETURNS
    5859 * Sucess:  0
    59  * 
     60 *
    6061 * Failure: -1
    6162 */
     
    6465  dprintf(("CRTDLL: _chdir(%s)\n",
    6566          newdir));
    66  
     67
    6768  if (!SetCurrentDirectoryA(newdir))
    6869  {
     
    8485 * RETURNS
    8586 * Sucess:  0
    86  * 
    87  * Failure: 1 
     87 *
     88 * Failure: 1
    8889 */
    8990BOOL CDECL CRTDLL__chdrive(INT newdrive)
     
    9192  char buffer[3] = "A:";
    9293  buffer[0] += newdrive - 1;
    93  
     94
    9495  dprintf(("CRTDLL: _chdrive(%s)\n",
    9596          buffer));
    96  
     97
    9798  if (!SetCurrentDirectoryA( buffer ))
    9899  {
     
    108109/*********************************************************************
    109110 *                  _findclose     (CRTDLL.098)
    110  * 
     111 *
    111112 * Free the resources from a search handle created from _findfirst.
    112113 *
     
    123124  dprintf(("CRTDLL: _findclose(%08xh)\n",
    124125          hand));
    125  
     126
    126127  if (!FindClose((HANDLE)hand))
    127128  {
     
    141142 * PARAMS
    142143 *   fspec [in]  File specification string for search, e.g "C:\*.BAT"
    143  * 
     144 *
    144145 *   ft [out]    A pointer to a find_t structure to populate.
    145146 *
     
    155156  WIN32_FIND_DATAA find_data;
    156157  HANDLE hfind;
    157  
     158
    158159  dprintf(("CRTDLL: _findfirst(%s)\n",
    159160          fspec));
     
    173174/*********************************************************************
    174175 *                  _findnext     (CRTDLL.100)
    175  * 
     176 *
    176177 * Return the next matching file/directory from a search hadle.
    177178 *
    178179 * PARAMS
    179180 *   hand [in] Search handle from a pervious call to _findfirst
    180  * 
     181 *
    181182 *   ft [out]  A pointer to a find_t structure to populate.
    182183 *
     
    190191{
    191192  WIN32_FIND_DATAA find_data;
    192  
     193
    193194  dprintf(("CRTDLL: _findnext(%08xh)\n",
    194195          hand));
    195  
     196
    196197  if (!FindNextFileA(hand, &find_data))
    197198  {
     
    224225{
    225226  // return (_getcwd(buf, size));
    226  
     227
    227228  char dir[_MAX_PATH];
    228229  int dir_len = GetCurrentDirectoryA(_MAX_PATH,dir);
    229  
     230
    230231  dprintf(("CRTDLL: _getcwd()\n"));
    231  
     232
    232233  if (dir_len < 1)
    233234    return NULL; /* FIXME: Real return value untested */
     
    258259{
    259260  // return (_getdcwd(drive, buffer, maxlen));
    260  
     261
    261262  static CHAR* dummy;
    262  
     263
    263264  dprintf(("CRTDLL: _getdcwd()\n"));
    264  
     265
    265266  if (!drive || drive == CRTDLL__getdrive())
    266267    return CRTDLL__getcwd(buf,size); /* current */
     
    305306  DWORD ret[4];
    306307  UINT err;
    307  
     308
    308309  dprintf(("CRTDLL: _getdiskfree(%08xh)\n", disk));
    309  
     310
    310311  if (disk > 26)
    311312    return ERROR_INVALID_PARAMETER; /* CRTDLL doesn't set errno here */
     
    335336{
    336337  // return DRIVE_GetCurrentDrive() + 1;
    337  
     338
    338339  char buffer[MAX_PATH];
    339  
     340
    340341  dprintf(("CRTDLL: _getdrive()\n"));
    341342
    342   if (!GetCurrentDirectoryA( sizeof(buffer), buffer )) 
    343     return 0;
    344   if (buffer[1] != ':') 
     343  if (!GetCurrentDirectoryA( sizeof(buffer), buffer ))
     344    return 0;
     345  if (buffer[1] != ':')
    345346    return 0;
    346347  return toupper(buffer[0]) - 'A' + 1;
     
    357358  dprintf(("CRTDLL: _mkdir(%s)\n",
    358359          newdir));
    359  
     360
    360361  if (CreateDirectoryA(newdir,NULL))
    361362    return 0;
     
    368369 *                  _rmdir           (CRTDLL.255)
    369370 *
    370  * Delete a directory 
     371 * Delete a directory
    371372 *
    372373 */
     
    375376  dprintf(("CRTDLL: _rmdir(%s)\n",
    376377          dir));
    377  
     378
    378379  if (RemoveDirectoryA(dir))
    379380    return 0;
  • trunk/src/crtdll/string.c

    r4672 r7521  
    1 /* $Id: string.c,v 1.1 2000-11-22 01:11:01 phaller Exp $ */
     1/* $Id: string.c,v 1.2 2001-12-01 23:06:23 bird Exp $ */
    22
    33/*
    44 * The C RunTime DLL
    5  * 
     5 *
    66 * Implements C run-time functionality as known from UNIX.
    77 *
     
    1919//#include <odin.h>
    2020//#include <os2win.h>
    21 //#include <ctype.h>
     21#include <ctype.h>                      /* toupper proto */
    2222//#include <heapstring.h>
    2323#include <string.h>
     
    129129{
    130130  LPSTR y=x;
    131  
     131
    132132  dprintf2(("CRTDLL: _strupr(%s)\n",
    133133           x));
     
    342342  return (strstr(str1, str2));
    343343}
    344  
     344
    345345
    346346/*********************************************************************
     
    416416 *                  _strdec           (CRTDLL.282)
    417417 *
    418  * Return the byte before str2 while it is >= to str1. 
     418 * Return the byte before str2 while it is >= to str1.
    419419 *
    420420 * PARAMS
     
    509509  LPSTR p1;
    510510  LPSTR p2;
    511  
     511
    512512  if (str && *str)
    513513    for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
     
    569569{
    570570  //_swab(s1, s2, i);
    571  
     571
    572572  if (len > 1)
    573573  {
Note: See TracChangeset for help on using the changeset viewer.