Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

Example applications


Detailed Description

The uIP distribution contains a number of example applications that can be either used directory or studied when learning to develop applications for uIP.

uIPÀÇ Æ¯Â¡Àº uIP¸¦ À§ÇÑ ¾îÇø®ÄÉÀ̼ÇÀ» °³¹ßÇϱâ À§ÇØ ÇнÀÀ» ÇÒ ¶§ µµ¿òÀÌ µÉ ¼ö ÀÖ´Â ÇϳªÀÇ ¿¹Á¦ ¾îÇø®ÄÉÀ̼ÇÀÌ ÀÖ´Ù.



Files

file  memb.c
 Memory block allocation routines.
¸Þ¸ð¸® ºí·Ï ÇÒ´ç ·çÆ¾.

file  memb.h
 Memory block allocation routines.
¸Þ¸ð¸® ºí·Ï ÇÒ´ç ·çÆ¾.


Modules

Web client
SMTP E-mail sender
Telnet server
Web server

Defines

#define MEMB(name, size, num)
 Declare a memory block.
¸Þ¸ð¸® ºí·Ï ¼±¾ð.


Functions

void memb_init (struct memb_blocks *m)
 Initialize a memory block that was declared with MEMB().
MEMB()·Î ¼±¾ðµÈ ¸Þ¸ð¸® ºí·Ï ÃʱâÈ­.

char * memb_alloc (struct memb_blocks *m)
 Allocate a memory block from a block of memory declared with MEMB().
MEMB()·Î ¼±¾ðµÈ ¸Þ¸ð¸® ºí·ÏÀ¸·ÎºÎÅÍ ¸Þ¸ð¸® ºí·Ï ÇÒ´ç.

char memb_ref (struct memb_blocks *m, char *ptr)
 Increase the reference count for a memory chunk.
¸Þ¸ð¸®¸¦ À§ÇÑ ÂüÁ¶ Ä«¿îÅ͸¦ Áõ°¡.

char memb_free (struct memb_blocks *m, char *ptr)
 Deallocate a memory block from a memory block previously declared with MEMB().
MEMB()·Î ÀÌÀü¿¡ ¼±¾ðµÈ ¸Þ¸ð¸® ºí·ÏÀ¸·ÎºÎÅÍ ¸Þ¸ð¸® ºí·ÏÀ» ÇØÁ¦.


Define Documentation

#define MEMB name,
size,
num   ) 
 

Value:

static char memb_mem[(size + 1) * num]; \
        static struct memb_blocks name = {size, num, memb_mem}
Declare a memory block.

¸Þ¸ð¸® ºí·Ï ¼±¾ð


Parameters:
name The name of the memory block (later used with memb_init(), memb_alloc() and memb_free()).

¸Þ¸ð¸® ºí·ÏÀÇ À̸§(³ªÁß¿¡ memb_init(), memb_alloc(), memb_free()¿¡¼­ »ç¿ëµÊ)

size The size of each memory chunk, in bytes.

¹ÙÀÌÆ® ´ÜÀ§ÀÇ °¢ ¸Þ¸ð¸® »çÀÌÁî.

num The total number of memory chunks in the block.

ºí·Ï¿¡ ÀÖ´Â ¸Þ¸ð¸®ÀÇ ÃÑ ¼ö.


Function Documentation

char* memb_alloc struct memb_blocks *  m  ) 
 

Allocate a memory block from a block of memory declared with MEMB().

MEMB()·Î ¼±¾ðµÈ ¸Þ¸ð¸® ºí·ÏÀ¸·ÎºÎÅÍ ¸Þ¸ð¸® ºí·Ï ÇÒ´ç


Parameters:
m A memory block previosly declared with MEMB().

MEMB()·Î ÀÌÀü¿¡ ÇÒ´çµÈ ¸Þ¸ð¸® ºí·Ï.

char memb_free struct memb_blocks *  m,
char *  ptr
 

Deallocate a memory block from a memory block previously declared with MEMB().

MEMB()·Î ÀÌÀü¿¡ ¼±¾ðµÈ ¸Þ¸ð¸® ºí·ÏÀ¸·ÎºÎÅÍ ¸Þ¸ð¸® ºí·ÏÀ» ÇØÁ¦.


Parameters:
m m A memory block previosly declared with MEMB().

MEMB()·Î ÀÌÀü¿¡ ÇÒ´çµÈ ¸Þ¸ð¸® ºí·Ï.

ptr A pointer to the memory block that is to be deallocated.

ÇÒ´ç ÇØÁ¦µÇ¾îÁú ¸Þ¸ð¸® ºí·ÏÀÇ Æ÷ÀÎÅÍ.
Returns:
The new reference count for the memory block (should be 0 if successfully deallocated) or -1 if the pointer "ptr" did not point to a legal memory block.

¸Þ¸ð¸® ºí·ÏÀ» À§ÇÑ »õ·Î¿î ÂüÁ¶ Ä«¿îÅÍ, ¸¸¾à Æ÷ÀÎÅÍ "ptr"ÀÌ ¿Ã¹Ù¸¥ ¸Þ¸ð¸® ºí·ÏÀ» °¡¸®Å°°í ÀÖÁö¾Ê´Ù¸é 1

void memb_init struct memb_blocks *  m  ) 
 

Initialize a memory block that was declared with MEMB().

MEMB()·Î ¼±¾ðµÈ ¸Þ¸ð¸® ºí·Ï ÃʱâÈ­.


Parameters:
m A memory block previosly declared with MEMB().

MEMB()·Î ÀÌÀü¿¡ ÇÒ´çµÈ ¸Þ¸ð¸® ºí·Ï.

char memb_ref struct memb_blocks *  m,
char *  ptr
 

Increase the reference count for a memory chunk.

¸Þ¸ð¸®·Î¸¦ À§ÇÑ ÂüÁ¶ Ä«¿îÅ͸¦ Áõ°¡.


Note:
No sanity checks are currently made.

¿À·ù°Ë»ç´Â ÇöÀç ÀÌ·ç¾îÁöÁö ¾Ê´Â´Ù.
Parameters:
m m A memory block previosly declared with MEMB().

MEMB()·Î ÀÌÀü¿¡ ÇÒ´çµÈ ¸Þ¸ð¸® ºí·Ï.

ptr A pointer to the memory chunk for which the reference count should be increased.

ÂüÁ¶ Ä«¿îÅͰ¡ Áõ°¡ µÇ¾î¾ß ÇÏ´Â ¸Þ¸ð¸®¸¦ °¡¸®Å°´Â Æ÷ÀÎÅÍ.
Returns:
The new reference count.

»õ·Î¿î ÂüÁ¶ Ä«¿îÅÍ.


Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by doxygen 1.3.3