Coding_convention - miniRT-jiphyeonjeon/MiniRT GitHub Wiki

μ½”λ“œ μž‘μ„± κ·œμΉ™

폴더 ꡬ성

/root
β”œβ”€β”€ include
β”œβ”€β”€ lib
β”œβ”€β”€ src
|   β”œβ”€β”€ λ²”μ£Όλ³„λ‘œ 폴더화
|   └── ...
β”œβ”€β”€ *.rt
└── Makefile

.h

  • header λ‚΄ header include μ΅œμ†Œν™”ν•˜κΈ°
  • srcλ‚΄λΆ€μ˜ ν΄λ”λ³„λ‘œ header λ§Œλ“€μ–΄μ„œ ν”„λ‘œν† νƒ€μž… μ •μ˜ν•΄μ„œ μ‚¬μš©ν•˜κΈ°
  • libft_type.h에 μžˆλŠ” t_bool, t_res ν™œμš©ν•˜κΈ°

접두사 | 접미사

  • 동적할당과 κ΄€λ ¨λœ 경우 new_와 del_둜 μ‹œμž‘
  • bool ν•¨μˆ˜μ˜ 경우 is_둜 μ‹œμž‘
  • libft에 μ†ν•˜λŠ” ν•¨μˆ˜λŠ” λͺ¨λ‘ ft_둜 μ‹œμž‘
    • 단, 이 μ•ˆμ—μ„œλ„ 동적할당, bool ν•¨μˆ˜μ˜ 경우 μœ„μ˜ κ·œμΉ™μ„ 따름
  • ν•¨μˆ˜ν¬μΈν„°λŠ” _f둜 μ’…λ£Œ

ν•¨μˆ˜λͺ… | λ³€μˆ˜λͺ…

  • libftλŠ” 기쑴에 μžˆλŠ” ν•¨μˆ˜λ₯Ό λͺ¨λ°©ν•œ 것듀이 λŒ€λΆ€λΆ„μ΄λΌ 단어 μ‚¬μ΄μ˜ _κ°€ μƒλž΅λ˜μ–΄μžˆμ§€λ§Œ κ·Έ μ™Έμ˜ ν•¨μˆ˜λͺ…은 단어 사이에 _λ₯Ό μ‚¬μš©ν•˜μ—¬ μž‘μ„± ex) camera_set()
  • 동사가 뒀에 μ˜€λ„λ‘ μž‘μ„± ex) struct_init(), num_count()
    • 단, new_, del_, is_λŠ” κ·ΈλŒ€λ‘œ μ•žμ— μ‚¬μš©
  • λ‹¨μ–΄λŠ” μ΅œλŒ€ν•œ κ·ΈλŒ€λ‘œ μ‚¬μš©ν•˜κ³ , μ€„μ—¬μ„œ μ‚¬μš©ν•  λ‹¨μ–΄λŠ” ν˜‘μ˜ν•΄μ„œ μ‚¬μš©
    • sh == shell
    • num == number
    • str == string
    • arr == array
    • len == length
    • res == result
    • i, idx == index
⚠️ **GitHub.com Fallback** ⚠️