⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 se

📁 Algorithms for Image Processing and Computer Vision Source Code
💻
字号:
@c ----------------------------------------------------------------------
@node seekdir, file system
@heading @code{seekdir}
@subheading Syntax

@example
#include <dirent.h>

void seekdir(DIR *dir, long loc);
@end example

@subheading Description

This function sets the location pointer in @var{dir} to the specified
@var{loc}.  Note that the value used for @var{loc} should be either zero
or a value returned by @code{telldir} (@pxref{telldir}).  The next call
to @code{readdir} (@pxref{readdir}) will read whatever entry follows that
point in the directory. 

@subheading Return Value

None.

@subheading Example

@example
int q = telldir(dir);
do_stuff();
seekdir(dir, q);
@end example

@c ----------------------------------------------------------------------
@node setbuf, stdio
@heading @code{setbuf}
@subheading Syntax

@example
#include <stdio.h>

void setbuf(FILE *file, char *buffer);
@end example

@subheading Description

This function modifies the buffering characteristics of @var{file}. 
First, if the file already has a buffer, it is freed.  If there was any
pending data in it, it is lost, so this function should only be used
immediately after a call to @code{fopen}.

If the @var{buffer} passed is @code{NULL}, the file is set to
unbuffered.  If a non-@code{NULL} buffer is passed, it must be at least
@code{BUFSIZ} bytes in size, and the file is set to fully buffered. 

@xref{setbuffer}
@xref{setlinebuf}
@xref{setvbuf}

@subheading Return Value

None.

@subheading Example

@example
setbuf(stdout, malloc(BUFSIZ));
@end example

@c ----------------------------------------------------------------------
@node setbuffer, stdio
@heading @code{setbuffer}
@subheading Syntax

@example
#include <stdio.h>

void setbuffer(FILE *file, char *buffer, int length);
@end example

@subheading Description

This function modifies the buffering characteristics of @var{file}. 
First, if the file already has a buffer, it is freed.  If there was any
pending data in it, it is lost, so this function should only be used
immediately after a call to @code{fopen}.

If the @var{buffer} passed is @code{NULL}, the file is set to
unbuffered.  If a non-@code{NULL} buffer is passed, it must be at least
@var{size} bytes in size, and the file is set to fully buffered.

@xref{setbuf}
@xref{setlinebuf}
@xref{setvbuf}

@subheading Return Value

None.

@subheading Example

@example
setbuffer(stdout, malloc(10000), 10000);
@end example

@c ----------------------------------------------------------------------
@node setcbrk, dos
@heading @code{setcbrk}
@subheading Syntax

@example
#include <dos.h>

void setcbrk(int check);
@end example

@subheading Description

Set the setting of the Ctrl-Break checking flag in MS-DOS.  If @var{check}
is zero, checking is not done.  If nonzero, checking is done.

@subheading Return Value

None.

@c ----------------------------------------------------------------------
@node setdate, time
@heading @code{setdate}
@subheading Syntax

@example
#include <dos.h>

void setdate(struct date *ptr);
@end example

@subheading Description

This function sets the current time.

@xref{getdate} @xref{settime}

@subheading Return Value

None.

@subheading Example

@example
struct date d;
setdate(&d);
@end example

@c ----------------------------------------------------------------------
@node setdisk, dos
@heading @code{setdisk}
@subheading Syntax

@example
#include <dir.h>

int setdisk(int drive);
@end example

@subheading Description

This function sets the current disk (0=A).

@xref{getdisk}

@subheading Return Value

The total number of possible drives.

@subheading Example

@example
printf("There are %d drives\n", setdisk(getdisk()));
@end example

@c ----------------------------------------------------------------------
@node setenv, environment
@heading @code{setenv}
@subheading Syntax

@example
#include <stdlib.h>

int setenv(const char *name, const char *value, int rewrite);
@end example

@subheading Description

Sets the environment variable @var{name} to @var{value}.  If
@var{rewrite} is set, then this function will replace any existing
value.  If it is not set, it will replace the existing value only if the
new value is shorter than the old. 

@subheading Return Value

0 on success, nonzero on failure.

@subheading Example

@example
setenv("TERM", "xterm", 1);
@end example

@c ----------------------------------------------------------------------
@node setftime, file system
@heading @code{setftime}
@subheading Syntax

@example
#include <dos.h>

int setftime(int handle, struct ftime *ftimep);
@end example

@subheading Description

This function sets the modification time of a file.  Note that since
writing to a file, and closing a file opened for writing, also sets the
modification time, you should only use this function on files opened for
reading.

@xref{getftime}

@subheading Return Value

Zero on success, nonzero on failure.

@subheading Example

@example
int q = open("data.txt", O_RDONLY);
struct ftime f;
f.ft_sec = f.ft_min = f.ft_hour = f.ft_day = f.ft_month = f.ft_year = 0;
setftime(q, &f);
close(q);
@end example

@c ----------------------------------------------------------------------
@node setgrent, unix
@heading @code{setgrent}
@subheading Syntax

@example
#include <grp.h>

void setgrent(void);
@end example

@subheading Description

This function should be called before any call to getgrent, getgrgid, or
getgrnam.  @xref{getgrent}

@subheading Return Value

None.

@c ----------------------------------------------------------------------
@node setjmp, misc
@heading @code{setjmp}
@subheading Syntax

@example
#include <setjmp.h>

int setjmp(jmp_buf j);
@end example

@subheading Description

This function stores the complete CPU state into @var{j}.  This
information is complete enough that @code{longjmp} (@pxref{longjmp}) can
return the program to that state.  It is also complete enough to
implement coroutines.

@subheading Return Value

This function will return zero if it is returning from it's own call. 
If longjmp is used to restore the state, it will return whatever value
was passed to longjmp, except if zero is passed to longjmp it will
return one. 

@subheading Example

@example
jmp_buf j;
if (setjmp(j))
  return;
do_something();
longjmp(j);
@end example

@c ----------------------------------------------------------------------
@node setlinebuf, stdio
@heading @code{setlinebuf}
@subheading Syntax

@example
#include <stdio.h>

void setlinebuf(FILE *file);
@end example

@subheading Description

This function modifies the buffering characteristics of @var{file}. 
First, if the file already has a buffer, it is freed.  If there was any
pending data in it, it is lost, so this function should only be used
immediately after a call to @code{fopen}.

Next, a buffer is allocated and the file is set to line buffering.

@xref{setbuf}
@xref{setlinebuf}
@xref{setvbuf}

@subheading Return Value

None.

@subheading Example

@example
setlinebuf(stderr);
@end example

@c ----------------------------------------------------------------------
@node setlocale, locale
@heading @code{setlocale}
@subheading Syntax

@example
#include <locale.h>

char *setlocale(int category, const char *locale);
@end example

@subheading Description

This function sets part or all of the current locale.  The
@var{category} is one of the following:

@table @code

@item LC_ALL

Set all parts of the locale.

@item LC_COLLATE

Set the collating information.

@item LC_CTYPE

Set the character type information.

@item LC_MONETARY

Set the monetary formatting information.

@item LC_NUMERIC

Set the numeric formatting information.

@item LC_TIME

Set the time formatting information.

@end table

The @var{locale} should be the name of the current locale.  Currently,
only the "C" and "POSIX" locales are supported.  If the @var{locale}
is NULL, no action is performed.  If @var{locale} is "", the locale is
identified by environment variables (currently not supported).

@xref{localeconv}.

@subheading Return Value

A static string naming the current locale for the given category, or
NULL if the requested locale is not supported.

@subheading Example

@example
setlocale(LC_ALL, "C");
@end example


@c ----------------------------------------------------------------------
@node setmntent, unix
@heading @code{setmntent}
@subheading Syntax

@example
#include <mntent.h>

FILE *setmntent(char *filename, char *type);
@end example

@subheading Description

This function returns an open FILE* pointer which can be used by
getmntent (@pxref{getmntent}).

@subheading Return Value

The FILE* pointer is returned.  For MS-DOS, this FILE* is not a real
pointer and may only be used by @code{getmntent}.

@c ----------------------------------------------------------------------
@node _setmode, io
@heading @code{_setmode}
@subheading Syntax

@example
int _setmode(int file, int mode);
@end example

@subheading Description

This function sets the mode of the given @var{file} to @var{mode}, which
is either @code{O_TEXT} or @code{O_BINARY}.  It will also set the file
into either cooked or raw mode accordingly. 

This function will not affect any @code{FILE*} objects using it.

@subheading Return Value

Previous value on success, nonzero on failure.

@subheading Example

@example
if (_setmode(0, O_BINARY) == -1)
  do_error();
@end example

@c ----------------------------------------------------------------------
@node setmode, io
@heading @code{setmode}
@subheading Syntax

@example
#include <io.h>

int setmode(int file, int mode);
@end example

@subheading Description


This function sets the mode of the given @var{file} to @var{mode}, which
is either @code{O_TEXT} or @code{O_BINARY}.  It will also set the file
into either cooked or raw mode accordingly, and set any @code{FILE*}
objects that use this file into text or binary mode. 

@subheading Return Value

Zero on success, nonzero on failure.

@subheading Example

@example
setmode(0, O_BINARY);
@end example

@c ----------------------------------------------------------------------
@node setpwent, unix
@heading @code{setpwent}
@subheading Syntax

@example
#include <pwd.h>

void setpwent(void);
@end example

@subheading Description

This function reinitializes @code{getpwent} so that scanning will start
from the start of the list.  @xref{getpwent}

@subheading Return Value

None.

@c ----------------------------------------------------------------------
@node _setstack, go32
@heading @code{_setstack}

@subheading Description

This is an internal function used to set the size of the stack in DPMI
mode. 

@xref{_stklen}

@c ----------------------------------------------------------------------
@node setstate, misc
@heading @code{setstate}
@subheading Syntax

@example
#include <stdlib.h>

char *setstate(char *state);
@end example

@subheading Description

This function initializes the random number generator (@pxref{random}). 
For more details, consult the source code @file{libsrc/c/gen/random.c}. 

@subheading Return Value

The old state.

@c ----------------------------------------------------------------------
@node settime, time
@heading @code{settime}
@subheading Syntax

@example
#include <dos.h>

void settime(struct time *ptr);
@end example

@subheading Description

This function sets the current time.

@xref{gettime} @xref{setdate}

@subheading Return Value

None.

@subheading Example

@example
struct time t;
settime(&t);
@end example

@c ----------------------------------------------------------------------
@node settimeofday, time
@heading @code{settimeofday}
@subheading Syntax

@example
#include <sys/time.h>

int settimeofday(struct timeval *tp, struct timezone *tzp);
@end example

@subheading Description

Sets the current GMT time and the local timezone information. 
@xref{gettimeofday} for information on the structure types. 

@subheading Return Value

Zero if the time was set, nonzero on error.

@c ----------------------------------------------------------------------
@node setvbuf, stdio
@heading @code{setvbuf}
@subheading Syntax

@example
#include <stdio.h>

int setvbuf(FILE *file, char *buffer, int type, int length);
@end example

@subheading Description

This function modifies the buffering characteristics of @var{file}. 
First, if the file already has a buffer, it is freed.  If there was any
pending data in it, it is lost, so this function should only be used
immediately after a call to @code{fopen}.

If the @var{type} is @code{_IONBF}, the @var{buffer} and @var{length}
are ignored and the file is set to unbuffered mode. 

If the @var{type} is @code{_IOLBF} or @code{_IOFBF}, then the file is
set to line or fully buffered, respectively.  If @var{buffer} is
@code{NULL}, a buffer of size @var{size} is created and used as the
buffer.  If @var{buffer} is non-@code{NULL}, it must point to a buffer
of at least size @var{size} and will be used as the buffer. 

@xref{setbuf}
@xref{setbuffer}
@xref{setlinebuf}

@subheading Return Value

Zero on success, nonzero on failure.

@subheading Example

@example
setbuf(stderr, NULL, _IOLBF, 1000);
@end example

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -