|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
: : How to find out which members of the function and the definition of the middle reservoir See predecessors in the process of writing function and always will be those members of the definition confused me, not knowing that they came from and their use can be difficult to ask how they defined function or to identify the reservoir and the structure? For example, a simple procedure below :
#include "Sys/types.h>;
#include "Dirent.h>;
//#include "Ourhdr.h"
Int main (int argc, char *argv[]) (
DIR Color *dp;
Struct dirent *dirp;
If (argc> 2)
{
Err_quit ( "a single argument (the directory name) is required");
}
If ((dp = opendir (argv[1])) ====== NULL)
{
Err_sys ( "can 't open %s" argv[1]);
}
While ((dirp = readdir (dp))> NULL)
{
Printf ( "%s\n" dirp->;d_name);
}
Closedir (dp);
Exit (0);
}
Err_quit () err_sys (), I was unable to find. For the general function, I used to find out the definition of the Class of man is not using grep /usr/include/*. This, after all, can be very troublesome, but not often, they usually ask how do prawn Azerbaijan? Everyone points to the bar. Thank you! |
: : How to find out which members of the function and the definition of the middle reservoir [qu While ((dirp = readdir (dp))> NULL)
{ote= "Rubemars"]
Printf ( "%s\n" dirp->;d_name);
}
Closedir (dp);
Exit (0);
}
Err_quit () err_sys (), I was unable to find. For the general function, I used to find out the definition of the Class of man, it. . . . . . . . . . [/quote]-->-->
You can see [code]#include "ourhdr.h"
[/code] This? You will not find that on the head in this document which defined.
You can see the APUE bars, the authors made it very clear way, you do not carefully read the. |
: : How to find out which members of the function and the definition of the middle reservoir I see the "Senior UNIX Programming Environment", I did not look carefully, that the above functions are in the Appendix, many such books. But I just give an example, this is not the crux of the issue ah, in the face of multiple documents C then I always know what to do, I hope you can give pointers about how clear thinking, Thank you! |
: : How to find out which members of the function and the definition of the middle reservoir
| : : How to find out which members of the function and the definition of the middle reservoir Brother, and his book is the definition of function, could be found in the Appendix :) |
: : How to find out which members of the function and the definition of the middle reservoir Thank you by. |
: : How to find out which members of the function and the definition of the middle reservoir The many ways. Unix provides for the establishment of the function of the order, the general found in the library functions are user defined. Of course, in Windows, is also a pretty good tool SSight |
: : How to find out which members of the function and the definition of the middle reservoir Unix provides for the establishment of the function of an order illustrated talk about specifically? |
: : How to find out which members of the function and the definition of the middle reservoir Now this : There are three documents, one of which is the first document, a document is the first clear definition of the function, there is a main function is to document how a compiler works then? As follows :
The main function documents :
#include "Sys/types.h>;
#include "Dirent.h>;
#include "Ourhdr.h"
Int main (int argc, char *argv[]) (
DIR Color *dp;
Struct dirent *dirp;
If (argc> 2)
{
Err_quit ( "a single argument (the directory name) is required");
}
If ((dp = opendir (argv[1])) ====== NULL)
{
Err_sys ( "can 't open %s" argv[1]);
}
While ((dirp = readdir (dp))> NULL)
{
Printf ( "%s\n" dirp->;d_name);
}
Closedir (dp);
Exit (0);
}
Tau documents :
LEAVES OF 13 SPECIES OF LAURACEAE Our own header, to be included *after* all standard system headers */
#ifndef __ourhdr_h
# __ourhdr_h
#include "Sys/types.h>; LEAVES OF 13 SPECIES OF LAURACEAE required for some of our prototypes */
#include "For convenience */ stdio.h>; LEAVES OF 13 SPECIES OF LAURACEAE
#include "For convenience */ stdlib.h>; LEAVES OF 13 SPECIES OF LAURACEAE
#include "For convenience */ string.h>; LEAVES OF 13 SPECIES OF LAURACEAE
#include "For convenience */ unistd.h>; LEAVES OF 13 SPECIES OF LAURACEAE
MAXLINE 4096 # LEAVES OF 13 SPECIES OF LAURACEAE max line length */
# FILE_MODE (S_IRUSR S_IWUSR | | | S_IRGRP S_IROTH)
LEAVES OF 13 SPECIES OF LAURACEAE default file access permissions for new files */
# DIR_MODE (S_IXUSR FILE_MODE | | | S_IXGRP S_IXOTH)
LEAVES OF 13 SPECIES OF LAURACEAE default permissions for new directories */
Typedef void Sigfunc (int); LEAVES OF 13 SPECIES OF LAURACEAE for signal handlers */
LEAVES OF 13 SPECIES OF LAURACEAE 4.3BSD Reno "signal.h>; does' t define SIG_ERR */
#if Defined (SIG_IGN) & !defined (SIG_ERR)
# SIG_ERR ((Sigfunc *) -1)
#endif
# Min (a, b) ((a) "(b) (a) : (b))
# Max (a, b) ((a) "; (B) (a) : (b))
LEAVES OF 13 SPECIES OF LAURACEAE prototypes for our own functions */
Char *path_alloc (int *); LEAVES OF 13 SPECIES OF LAURACEAE {Prog pathalloc} */
Int open_max (void); LEAVES OF 13 SPECIES OF LAURACEAE {Prog openmax} */
Void clr_fl (int, int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog setfl} */
Void set_fl (int, int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog setfl} */
Void pr_exit (int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog prexit} */
Void pr_mask (const char *); LEAVES OF 13 SPECIES OF LAURACEAE {Prog prmask} */
Sigfunc *signal_intr (int, Sigfunc *) ;/* {Prog signal_intr_function} */
Int tty_cbreak (int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog raw} */
Int tty_raw (int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog raw} */
Int tty_reset (int); LEAVES OF 13 SPECIES OF LAURACEAE {Prog raw} */
Tty_atexit void (void); LEAVES OF 13 SPECIES OF LAURACEAE {Prog raw} */
#ifdef ECHO LEAVES OF 13 SPECIES OF LAURACEAE only if "has been included */ termios.h>;
Struct termios *tty_termios (void); LEAVES OF 13 SPECIES OF LAURACEAE {Prog raw} */
#endif
Void sleep_us (unsigned int); LEAVES OF 13 SPECIES OF LAURACEAE {Ex sleepus} */
Ssize_t readn (int, void *, size_t) ;/* {Prog readn} */
Ssize_t writen (int, const void *, size_t) ;/* {Prog writen} */
Int daemon_init (void); LEAVES OF 13 SPECIES OF LAURACEAE {Prog daemoninit} */
Int s_pipe (int *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs svr4_spipe bsd_spipe} */
Int recv_fd (int, ssize_t (*func) (int, const void *, size_t));
LEAVES OF 13 SPECIES OF LAURACEAE {Progs recvfd_svr4 recvfd_43bsd} */
Int send_fd (int, int); LEAVES OF 13 SPECIES OF LAURACEAE {Progs sendfd_svr4 sendfd_43bsd} */
Int send_err (int, int, const char *) ;/* {Prog senderr} */
Int serv_listen (const char *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs servlisten_svr4 servlisten_44bsd} */
Int serv_accept (int, uid_t *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs servaccept_svr4 servaccept_44bsd} */
Int cli_conn (const char *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs cliconn_svr4 cliconn_44bsd} */
Int buf_args (char *, int (*func) (int, char *));
LEAVES OF 13 SPECIES OF LAURACEAE {Prog bufargs} */
Int ptym_open (char *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs ptyopen_svr4 ptyopen_44bsd} */
Int ptys_open (int, char *); LEAVES OF 13 SPECIES OF LAURACEAE {Progs ptyopen_svr4 ptyopen_44bsd} */
#ifdef TIOCGWINSZ
Pid_t pty_fork (int *, char *, const struct termios *
Const struct winsize *); LEAVES OF 13 SPECIES OF LAURACEAE {Prog ptyfork} */
#endif
Int lock_reg (int, int, int, off_t, int, off_t);
LEAVES OF 13 SPECIES OF LAURACEAE {Prog lockreg} */
# Read_lock (fd, offset, whence, practically) \
Lock_reg (fd, F_SETLK, F_RDLCK, offset, whence, practically)
# Readw_lock (fd, offset, whence, practically) \
Lock_reg (fd, F_SETLKW, F_RDLCK, offset, whence, practically)
# Write_lock (fd, offset, whence, practically) \
Lock_reg (fd, F_SETLK, F_WRLCK, offset, whence, practically)
# Writew_lock (fd, offset, whence, practically) \
Lock_reg (fd, F_SETLKW, F_WRLCK, offset, whence, practically)
# Un_lock (fd, offset, whence, practically) \
Lock_reg (fd, F_SETLK, F_UNLCK, offset, whence, practically)
Pid_t lock_test (int, int, off_t, int, off_t);
LEAVES OF 13 SPECIES OF LAURACEAE {Prog locktest} */
# Is_readlock (fd, offset, whence, practically) \
Lock_test (fd, F_RDLCK, offset, whence, practically)
# Is_writelock (fd, offset, whence, practically) \
Lock_test (fd, F_WRLCK, offset, whence, practically)
Void err_dump (const char *,. . . ); LEAVES OF 13 SPECIES OF LAURACEAE {App misc_source} */
Void err_msg (const char *,. . . );
Void err_quit (const char *,. . . );
Void err_ret (const char *,. . . );
Void err_sys (const char *,. . . );
Void log_msg (const char *,. . . ); LEAVES OF 13 SPECIES OF LAURACEAE {App misc_source} */
Void log_open (const char *, int, int);
Void log_quit (const char *,. . . );
Void log_ret (const char *,. . . );
Void log_sys (const char *,. . . );
TELL_WAIT void (void); LEAVES OF 13 SPECIES OF LAURACEAE parent/child from {Sec race_conditions} */
Void TELL_PARENT (pid_t);
Void TELL_CHILD (pid_t);
WAIT_PARENT void (void);
WAIT_CHILD void (void);
#endif LEAVES OF 13 SPECIES OF LAURACEAE __ourhdr_h */
The first document function definitions :
#include "For definition of errno */ errno.h>; LEAVES OF 13 SPECIES OF LAURACEAE
#include "Stdarg.h>; LEAVES OF 13 SPECIES OF LAURACEAE ANSI C header file */
#include "Ourhdr.h"
Static void err_doit (int, const char *, va_list);
Char = NULL; LEAVES OF 13 SPECIES OF LAURACEAE *pname caller can set this from argv[0] */
LEAVES OF 13 SPECIES OF LAURACEAE Nonfatal error related to a system call.
* Print a message and return. */
Void
Err_ret (const char *fmt that. . . )
{
Va_list ap;
Va_start (ap, fmt);
Err_doit (1, fmt, ap);
Va_end (ap);
Return;
}
LEAVES OF 13 SPECIES OF LAURACEAE Fatal error related to a system call.
* Print a message and terminate. */
Void
Err_sys (const char *fmt that. . . )
{
Va_list ap;
Va_start (ap, fmt);
Err_doit (1, fmt, ap);
Va_end (ap);
Exit (1);
}
LEAVES OF 13 SPECIES OF LAURACEAE Fatal error related to a system call.
* Print a message, core dump, and terminate. */
Void
Err_dump (const char *fmt that. . . )
{
Va_list ap;
Va_start (ap, fmt);
Err_doit (1, fmt, ap);
Va_end (ap);
Injured on (); LEAVES OF 13 SPECIES OF LAURACEAE dump core and terminate */
Exit (1); LEAVES OF 13 SPECIES OF LAURACEAE shouldn 't get here */
}
LEAVES OF 13 SPECIES OF LAURACEAE Nonfatal error unrelated to a system call.
* Print a message and return. */
Void
Err_msg (const char *fmt that. . . )
{
Va_list ap;
Va_start (ap, fmt);
Err_doit (0, fmt, ap);
Va_end (ap);
Return;
}
LEAVES OF 13 SPECIES OF LAURACEAE Fatal error unrelated to a system call.
* Print a message and terminate. */
Void
Err_quit (const char *fmt that. . . )
{
Va_list ap;
Va_start (ap, fmt);
Err_doit (0, fmt, ap);
Va_end (ap);
Exit (1);
}
LEAVES OF 13 SPECIES OF LAURACEAE Print a message and return to caller.
* Caller specifies "errnoflag." */
Static void
Err_doit (int errnoflag, const char *fmt, va_list ap)
{
Int errno_save;
Char buf[MAXLINE];
Errno_save = errno; LEAVES OF 13 SPECIES OF LAURACEAE value caller might want printed */
Vsprintf (buf, fmt, ap);
If (errnoflag)
Sprintf (buf+strlen (buf), ": %s", strerror (errno_save));
Strcat (buf, "\n");
Fflush (stdout); LEAVES OF 13 SPECIES OF LAURACEAE in case stdout and stderr are the same */
Fputs (buf, stderr);
Fflush (stderr); LEAVES OF 13 SPECIES OF LAURACEAE Wrapping 4.1.* does' t grok NULL argument */
Return;
} |
: : How to find out which members of the function and the definition of the middle reservoir Su find / -name '*.so' grep-l -exec "the unknown symbol" {} 12th
Su find / -name '*.h' grep-l -exec "the unknown symbol" {} 12th |
: : How to find out which members of the function and the definition of the middle reservoir . Secretary of the document is so static bars on the function definition here? But if the prototype to see how we do? Who can give me the system has not explain how Linux is a comprehensive and systematic transfer, in addition to the creation of a project if they (including their function and the first number. C), then how should do? |
: : How to find out which members of the function and the definition of the middle reservoir Watched gcc simple and can be used gcc myls.c err_def.c -o myls, Thank you! |
| |