C :: Dynalib :: Struct.

C :: Dynalib :: struct´Â C` struct "µ¥ÀÌÅÍ À¯ÇüÀ» ó¸®ÇÏ´Â µµ±¸ÀÔ´Ï´Ù.
Áö±Ý ´Ù¿î·Îµå

C :: Dynalib :: Struct. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • Perl Artistic License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • John Tobey
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://search.cpan.org/~jtobey/

C :: Dynalib :: Struct. ű×


C :: Dynalib :: Struct. ¼³¸í

C :: Dynalib :: struct´Â C` struct "µ¥ÀÌÅÍ À¯ÇüÀ» ó¸®ÇÏ´Â µµ±¸ÀÔ´Ï´Ù. C :: Dynalib :: struct´Â C` struct 'µ¥ÀÌÅÍ À¯ÇüÀ» ó¸®ÇÏ´Â µµ±¸ÀÔ´Ï´Ù. ½Ä ³ëÇÁ°¡ C :: Dynalib :: struct; c :: dynalib :: struct ($ stright_tag, $ template0, @ field_names0, ...)¸¦ Á¤ÀÇÇϽʽÿÀ. $ rstruct = tie ($ struct, $ stright_tag ); $ value = $ rstruct-> my_field (); $ rstruct-> my_field ($ new_value); $ pointer_to_struct = ÆÑ ( 'p', $ struct); $ struct = $ new_struct; # Æ÷ÀÎÅÍ - ±¸Á¶Ã¼¸¦ C ÇÔ¼ö¿¡ Àü´Þ ÇÑ ÈÄ ¸ðµç Çʵ带 ÇÑ ¹ø¿¡ ÇÒ´çÇÕ´Ï´Ù. $ Rstruct-> Unpack (); $ returned_value = $ rstruct-> my_field (); Perl°ú C¸¦ È¥ÇÕ ÇÒ ¶§ µ¥ÀÌÅÍ À¯ÇüÀÇ º¯È¯Àº ¿ÀÈ÷·Á Áö·çÇÏ°í ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ ¸ðµâÀº PerlÀÇ ÆÑ¿¡¼­ Ãß»óÈ­¸¦ Á¦°øÇÏ°í ±¸¼º¿ø µ¥ÀÌÅÍ À¯Çü°ú À§Ä¡°¡ º¯°æµÇÁö ¾Ê´Â ±¸Á¶¹°À» »ç¿ëÇϱâ À§ÇØ ¿î¿µÀÚ¸¦ ²¨³À´Ï´Ù. ±¸Á¶Ã¼¸¦ ´Ù·ç´Â C ÄÚµåÀÇ ¸î °¡Áö ¿¹°¡ ÀÖ½À´Ï´Ù. ¿À¸¥ÂÊ¿¡´Â °¡´ÉÇÑ Perl ´ç·®ÀÌ ÀÖ½À´Ï´Ù. c perl - ---- typedef struct {c :: dynalib :: struct; int m_int; C :: Dynalib :: struct (double m_double; 'foo', char * m_string; 'i'=> ,} foo; 'd'=> , 'p'=> ); # ¶Ç´Â µ¿µîÈ÷ C :: Dynalib :: struct ( 'foo', 'IDP', ); foo foo; foo * pfoo = $ rfoo = tie ($ foo, 'foo'); i = pfoo-> m_int; $ i = $ rfoo-> m_int; d = foo.m_double; $ d = (¹­¿© $ foo) -> m_double; pfoo-> m_string = "hi"; $ rfoo-> m_string ( "hi"); Foo Bar; ³ØŸÀÌ ($ bar, 'foo'); bar = foo; $ bar = $ foo; void do_foo (foo * arg); C :: Dynalib; $ lib = »õ C :: dynalib ( "- lfoo"); $ do_foo = $ lib-> declaSSUB ( "do_foo", "" "p"); # ¶Ç´Â XSUB¸¦ ¾µ ¼ö ÀÖ½À´Ï´Ù. do_foo (foo); $ do_foo ($ foo); returned_i = foo.m_int; $ rfoo-> unfack (); $ returned_i = $ rfoo-> m_int; ¿ä±¸ »çÇ× : ¡¤ Perl.


C :: Dynalib :: Struct. °ü·Ã ¼ÒÇÁÆ®¿þ¾î