Sponsored Content
Top Forums Programming Extern keyward on function in C Post 302970932 by yifangt on Wednesday 13th of April 2016 02:43:53 PM
Old 04-13-2016
Extern keyward on function in C

I saw a header (.h) file with mixture of "regular" function declarations and other extern function declarations. As I was told all function declarations are implicitly external and the extern on functions declarations is superfluous. Here my focus is on function declaration, not variable yet.
Code:
int fq_read_length (char *data);
char *fa_count (char *start, int length);
extern int get_parainfo (char *full, Queue *head, char type);
extern char *fastq_relocate (char *data, int offset, int length);
extern char *jump (char *target, char type, float sampling_rate);
extern char *get_right_sp (char *start_point ,char type);
extern char *check_fmt (Queue *info, Queue *tail, char *start_point, char type);
int total_full_check (bloom * bl, char *p, int length, float tole_rate, F_set *File_head);
extern int fastq_read_check (char *begin, int length, char mode, bloom * bl, float tole_rate, F_set *File_head);
extern int fasta_read_check (char *begin, int length, char mode, bloom * bl, float tole_rate, F_set *File_head);
void isodate(char* buf);
int total_subscan (bloom *bl, F_set *File_head, char *begin, char *start_point, int read_length, int true_length, float tole_rate, char mode, char type);

Then why is extern on function declaration still used, and what is the benefit? Thanks!

Last edited by yifangt; 04-13-2016 at 04:54 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

extern for functions

Hi, Please let me know if the extern keyword is necessary for using functions which is defined and declared in another file and and used in a different file where both these files are linked together. thanks (8 Replies)
Discussion started by: naan
8 Replies

2. Shell Programming and Scripting

Passing global variable to a function which is called by another function

Hi , I have three funcions f1, f2 and f3 . f1 calls f2 and f2 calls f3 . I have a global variable "period" which i want to pass to f3 . Can i pass the variable directly in the definition of f3 ? Pls help . sars (4 Replies)
Discussion started by: sars
4 Replies

3. Programming

Extern variable.

file1.c int a1; int main() { a1 = 2; printf("\na1 = %d\n", a1); next(); printf("\na1 = %d\n", a1); next1(); printf("\na1 = %d\n", a1); } file2.c #include <stdio.h> int b1 = 0; void next(void) (1 Reply)
Discussion started by: Tanvirk
1 Replies

4. Linux

Problem mounting extern hd (fedora 9)

Hi there, I'm having a bit of a strange problem which I would appreciate some help with. The Problem: I have two external hard drives, but I'm borrowing one off my parents to copy data too (one of mine, which is identical to theirs - WD MyBook 300g - is on its way out). Fedora 9 recognizes... (3 Replies)
Discussion started by: lasthidingplace
3 Replies

5. UNIX for Dummies Questions & Answers

fetchmail and forward to an extern address

Hi, I'm searching for an solution for the following problem. I want fetch some mails via pop3 from a@a.com with fetchmail. That works perfectly. Now any incoming mail should forwarded to b@b.com via smtp obv. But I don't know how to configure that. All online tutorials describe forwarding to... (0 Replies)
Discussion started by: mcW
0 Replies

6. Shell Programming and Scripting

Return a value from called function to the calling function

I have two scripts. script1.sh looks -------------------------------- #!/bin/bash display() { echo "Welcome to Unix" } display ----------------------------- Script2.sh #!/bin/bash sh script1.sh //simply calling script1.sh ------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

7. Programming

segmentation fault for extern

Why this is happening when both of them compiled together and run? I am getting segmentation fault SIGSEGV. File1.c: int arr; File2.c: extern int *arr; int main() { arr = 100; } (3 Replies)
Discussion started by: royalibrahim
3 Replies

8. Programming

C header file and extern

In the header file data.h i got: const char ack_msg = "ack: received your msg\n"; In the code file server.c i got: extern const char ack_msg; And else it is only used in a function call: user$ grep ack_msg *c *h server.c:extern const char ack_msg; server.c: n = write(clientsfd,... (5 Replies)
Discussion started by: tornow
5 Replies

9. Shell Programming and Scripting

Will files, creaetd in one function of the same script will be recognized in another function?

Dear All. I have a script, which process files one by one. In the script I have two functions. one sftp files to different server the other from existing file create file with different name. My question is: Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies

10. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
CC_MD5(3cc)							       LOCAL							       CC_MD5(3cc)

NAME
CC_MD2_Init CC_MD2_Update CC_MD2_Final CC_MD2 CC_MD4_Init CC_MD4_Update CC_MD4_Final CC_MD4 CC_MD5_Init CC_MD5_Update CC_MD5_Final CC_MD5 -- MD2, MD4, and MD5 hash functions SYNOPSIS
#include <CommonCrypto/CommonDigest.h> extern int CC_MD2_Init(CC_MD2_CTX *c); extern int CC_MD2_Update(CC_MD2_CTX *c, const void *data, CC_LONG len); extern int CC_MD2_Final(unsigned char *md, CC_MD2_CTX *c); extern unsigned char * CC_MD2(const void *data, CC_LONG len, unsigned char *md); extern int CC_MD4_Init(CC_MD4_CTX *c); extern int CC_MD4_Update(CC_MD4_CTX *c, const void *data, CC_LONG len); extern int CC_MD4_Final(unsigned char *md, CC_MD4_CTX *c); extern unsigned char * CC_MD4(const void *data, CC_LONG len, unsigned char *md); extern int CC_MD5_Init(CC_MD5_CTX *c); extern int CC_MD5_Update(CC_MD5_CTX *c, const void *data, CC_LONG len); extern int CC_MD5_Final(unsigned char *md, CC_MD5_CTX *c); extern unsigned char * CC_MD5(const void *data, CC_LONG len, unsigned char *md); DESCRIPTION
The following functions are used to produce an hash from data: CC_MD2_Init() initializes a CC_MD2_CTX structure. CC_MD2_Update() can be called repeatedly with chunks of the message to be hashed (len bytes at data). CC_MD2_Final() places the MD2 message digest in md, which must have space for CC_MD2_DIGEST_LENGTH == 16 bytes of output, and erases the CC_MD2_CTX. CC_MD2() computes the MD2 message digest of the len bytes at data and places it in md (which must have space for CC_MD2_DIGEST_LENGTH == 16 bytes of output). It returns the md pointer. CC_MD4_Init(), CC_MD4_Update(), CC_MD4_Final(), CC_MD4(), CC_MD5_Init(), CC_MD5_Update(), CC_MD5_Final(), and CC_MD5() are analogous using an CC_MD4_CTX and CC_MD5_CTX structure. NOTE
MD2, MD4, and MD5 are recommended only for compatibility with existing applications. In new applications, SHA-256(or greater) should be pre- ferred. RETURN VALUES
All routines return 1 except for the one-shot routines ( CC_MD2() , etc.), which return the pointer passed in via the md parameter. CONFORMING TO
RFC 1319, RFC 1320, RFC 1321 SEE ALSO
CC_crypto(3cc), CC_SHA(3cc), CCHmac(3cc), CCCryptor(3cc) HISTORY
These functions are available in OS X 10.4 and later. These functions provide similar functionality to the routines found in OpenSSL 0.9.6 and may use the same implementation. BSD
April 5, 2007 BSD
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy