2
__ptr_t
_malloc (size)
     __malloc_size_t size;
{
  return malloc (size);
}

As far as I know of the function declaration it looks as follows :

<return-type> <function-name>(<data-type> <var-name>){

// Code..
}

But above function looks different.

Jongware
  • 22,200
  • 8
  • 54
  • 100
techierishi
  • 413
  • 3
  • 14
  • 1
    Those are K&R-style parameters. You may find [**this interesting**](http://stackoverflow.com/questions/22500/what-are-the-major-differences-between-ansi-c-and-kr-c). – WhozCraig Dec 29 '14 at 04:41

3 Answers3

4

This is old K&R style.

/* ISO style */
int fn(int i, char j)
{
}

/* Pre standard K&R style */
int fn(i, j)  /* return type if int is optional, if omitted defaults to int */
int i;        /* this line if argument type is int is optional */
char j;
{
}

Live Example here

Mohit Jain
  • 30,259
  • 8
  • 73
  • 100
2

__ptr_t - return type

_malloc - function name

size - name of the argument

__malloc_size_t type of the argument named size

this is old legacy syntax, check out more here

To support pre-standard C, instead of writing function definitions in standard prototype form,

int foo (int x, int y) … write the definition in pre-standard style like this,

int foo (x, y) int x, y;

Iłya Bursov
  • 23,342
  • 4
  • 33
  • 57
2

This is an old declaration style from very early C, known as the "K&R" style, after Kernighan and Ritchie, originators of the language. Inside the brackets of the function's parameter list, you just declare the <var-name>s of the arguments; then after the brackets but before the opening curly brace of the function body you place full declarations of the <var-name>s with their <data-type>s, as if you were declaring local variables.

Dave Korn
  • 46
  • 3